diff --git a/.travis.yml b/.travis.yml index 1459683d..1ccae814 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ android: - tools - platform-tools - tools - - build-tools-25.0.2 + - build-tools-25.0.3 - android-25 - extra-android-m2repository - extra-google-m2repository diff --git a/README.md b/README.md index 57f0ac00..d53c6ac3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ You should add this to your dependencies: compile 'io.nlopez.smartlocation:library:3.3.1' ``` -Google Play Services compatible version: 10.2.0 +Google Play Services compatible version: 11.0.1 If you want the rxjava wrappers, these are now in a separate dependency. Just add this new dependency as well: diff --git a/build.gradle b/build.gradle index 37f38fec..39597265 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,6 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' + classpath 'com.android.tools.build:gradle:2.3.3' } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bfde008e..edcaa7c1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Aug 29 12:50:39 CEST 2016 +#Thu Jun 15 14:53:11 PDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip diff --git a/library/build.gradle b/library/build.gradle index 419b5a8f..43269a4a 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -18,8 +18,8 @@ dependencies { mavenCentral() maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } - compile 'com.google.android.gms:play-services-location:10.2.0' - compile 'com.android.support:support-annotations:25.2.0' + compile 'com.google.android.gms:play-services-location:11.0.1' + compile 'com.android.support:support-annotations:25.3.1' testCompile "junit:junit:$junitVersion" testCompile "org.robolectric:robolectric:$robolectricVersion" testCompile "org.robolectric:robolectric-shadows:$robolectricVersion" @@ -28,7 +28,7 @@ dependencies { android { compileSdkVersion 25 - buildToolsVersion '25.0.2' + buildToolsVersion '25.0.3' buildTypes { defaultConfig { diff --git a/library/src/main/java/io/nlopez/smartlocation/activity/providers/ActivityGooglePlayServicesProvider.java b/library/src/main/java/io/nlopez/smartlocation/activity/providers/ActivityGooglePlayServicesProvider.java index c4fdbbd8..fa7fdea2 100644 --- a/library/src/main/java/io/nlopez/smartlocation/activity/providers/ActivityGooglePlayServicesProvider.java +++ b/library/src/main/java/io/nlopez/smartlocation/activity/providers/ActivityGooglePlayServicesProvider.java @@ -171,10 +171,15 @@ private void notifyActivity(final DetectedActivity detectedActivity) { private BroadcastReceiver activityReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - if (BROADCAST_INTENT_ACTION.equals(intent.getAction()) && intent.hasExtra(DETECTED_ACTIVITY_EXTRA_ID)) { - logger.d("sending new activity"); - DetectedActivity detectedActivity = intent.getParcelableExtra(DETECTED_ACTIVITY_EXTRA_ID); - notifyActivity(detectedActivity); + try { + if (BROADCAST_INTENT_ACTION.equals(intent.getAction()) && intent.hasExtra(DETECTED_ACTIVITY_EXTRA_ID)) { + logger.d("sending new activity"); + DetectedActivity detectedActivity = intent.getParcelableExtra(DETECTED_ACTIVITY_EXTRA_ID); + if (detectedActivity != null) + notifyActivity(detectedActivity); + } + } catch (Exception ignored) { + // Catch bad parcelable exception } } }; diff --git a/rxjava/build.gradle b/rxjava/build.gradle index dff972ba..a9906660 100644 --- a/rxjava/build.gradle +++ b/rxjava/build.gradle @@ -19,7 +19,7 @@ dependencies { maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } compile project(':library') - compile 'io.reactivex.rxjava2:rxjava:2.0.6' + compile 'io.reactivex.rxjava2:rxjava:2.1.0' compile 'io.reactivex.rxjava2:rxandroid:2.0.1' testCompile "junit:junit:$junitVersion" testCompile "org.robolectric:robolectric:$robolectricVersion" @@ -29,7 +29,7 @@ dependencies { android { compileSdkVersion 25 - buildToolsVersion '25.0.2' + buildToolsVersion '25.0.3' buildTypes { defaultConfig { diff --git a/sample/build.gradle b/sample/build.gradle index 1b7e869a..a9be868f 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 25 - buildToolsVersion '25.0.2' + buildToolsVersion '25.0.3' defaultConfig { applicationId "io.nlopez.smartlocation" @@ -19,6 +19,7 @@ repositories { dependencies { compile project(':library') - debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2' - releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2' + debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1' + releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1' + testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1' }