Skip to content

Commit b918ff3

Browse files
committed
Removed Android 2.3 compat code and updated commit to apply
1 parent 41ae9c9 commit b918ff3

12 files changed

+16
-156
lines changed

OneSignalSDK/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
maven { url 'https://maven.google.com' }
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.0.0-alpha8'
10+
classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
1111

1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sat Jul 15 00:03:19 PDT 2017
1+
#Tue Aug 01 13:07:13 PDT 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip

OneSignalSDK/onesignal/build.gradle

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,11 @@ android {
2828
dependencies {
2929
provided fileTree(dir: 'libs', include: ['*.jar'])
3030

31-
compile 'com.android.support:support-v4:26.0.0'
32-
33-
// NOTE: Starting with play-services 10.2.0, minSdkVersion is now 14
3431
compile 'com.google.android.gms:play-services-gcm:11.0.4'
3532
compile 'com.google.android.gms:play-services-location:11.0.4'
3633

37-
// NOTE: customtabs sets minSdkVersion to 15.
34+
compile 'com.android.support:support-v4:26.0.0'
3835
compile 'com.android.support:customtabs:26.0.0'
3936
}
4037

41-
// Remove OnActivityPausedListener class.
42-
// Only required to compile but doesn't need to be in the release jar / aar
43-
project.afterEvaluate {
44-
android.libraryVariants.all { variant ->
45-
String variantName = variant.name.capitalize()
46-
Task cleanTask = task("removeUnneeded${variantName}Classes") << {
47-
delete "build/intermediates/classes/${variant.name}/android/app/OnActivityPausedListener.class"
48-
}
49-
tasks.findByName("bundle${variantName}").dependsOn cleanTask
50-
cleanTask.mustRunAfter tasks.findByName("compile${variantName}Sources")
51-
}
52-
}
53-
5438
apply from: 'maven-push.gradle'

OneSignalSDK/onesignal/src/main/java/android/app/OnActivityPausedListener.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

OneSignalSDK/onesignal/src/main/java/com/onesignal/ActivityLifecycleHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Modified MIT License
33
*
4-
* Copyright 2016 OneSignal
4+
* Copyright 2017 OneSignal
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

OneSignalSDK/onesignal/src/main/java/com/onesignal/ActivityLifecycleListener.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Modified MIT License
33
*
4-
* Copyright 2016 OneSignal
4+
* Copyright 2017 OneSignal
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -27,12 +27,10 @@
2727

2828
package com.onesignal;
2929

30-
import android.annotation.TargetApi;
3130
import android.app.Activity;
3231
import android.app.Application;
3332
import android.os.Bundle;
3433

35-
@TargetApi(14)
3634
class ActivityLifecycleListener implements Application.ActivityLifecycleCallbacks {
3735

3836
@Override

OneSignalSDK/onesignal/src/main/java/com/onesignal/ActivityLifecycleListenerCompat.java

Lines changed: 0 additions & 85 deletions
This file was deleted.

OneSignalSDK/onesignal/src/main/java/com/onesignal/OSPermissionState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void persistAsFrom() {
7272
final SharedPreferences prefs = getGcmPreferences(appContext);
7373
SharedPreferences.Editor editor = prefs.edit();
7474
editor.putBoolean("ONESIGNAL_ACCEPTED_NOTIFICATION_LAST", enabled);
75-
editor.commit();
75+
editor.apply();
7676
}
7777

7878
boolean compare(OSPermissionState from) {

OneSignalSDK/onesignal/src/main/java/com/onesignal/OSSubscriptionState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void persistAsFrom() {
122122
editor.putString("ONESIGNAL_PUSH_TOKEN_LAST", pushToken);
123123
editor.putBoolean("ONESIGNAL_PERMISSION_ACCEPTED_LAST", accepted);
124124

125-
editor.commit();
125+
editor.apply();
126126
}
127127

128128
boolean compare(OSSubscriptionState from) {

OneSignalSDK/onesignal/src/main/java/com/onesignal/OneSignal.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,8 @@ public static void init(Context context, String googleProjectNumber, String oneS
396396
lastTrackedFocusTime = SystemClock.elapsedRealtime();
397397

398398
OneSignalStateSynchronizer.initUserState(appContext);
399-
400-
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB_MR2)
401-
((Application)appContext).registerActivityLifecycleCallbacks(new ActivityLifecycleListener());
402-
else
403-
ActivityLifecycleListenerCompat.startListener();
399+
400+
((Application)appContext).registerActivityLifecycleCallbacks(new ActivityLifecycleListener());
404401

405402
try {
406403
Class.forName("com.amazon.device.iap.PurchasingListener");
@@ -1238,7 +1235,7 @@ private static void SaveAppId(String appId) {
12381235
final SharedPreferences prefs = getGcmPreferences(appContext);
12391236
SharedPreferences.Editor editor = prefs.edit();
12401237
editor.putString("GT_APP_ID", appId);
1241-
editor.commit();
1238+
editor.apply();
12421239
}
12431240

12441241
static String getSavedAppId() {
@@ -1289,7 +1286,7 @@ static void saveFilterOtherGCMReceivers(boolean set) {
12891286
final SharedPreferences prefs = getGcmPreferences(appContext);
12901287
SharedPreferences.Editor editor = prefs.edit();
12911288
editor.putBoolean("OS_FILTER_OTHER_GCM_RECEIVERS", set);
1292-
editor.commit();
1289+
editor.apply();
12931290
}
12941291

12951292
static void updateUserIdDependents(String userId) {
@@ -1684,7 +1681,7 @@ private static void SaveUnsentActiveTime(long time) {
16841681
final SharedPreferences prefs = getGcmPreferences(appContext);
16851682
SharedPreferences.Editor editor = prefs.edit();
16861683
editor.putLong("GT_UNSENT_ACTIVE_TIME", time);
1687-
editor.commit();
1684+
editor.apply();
16881685
}
16891686

16901687
static SharedPreferences getGcmPreferences(Context context) {

0 commit comments

Comments
 (0)