From 18cec2087f0081fd52c04e5cf85fb87f1be1e478 Mon Sep 17 00:00:00 2001 From: TaaviE Date: Sat, 20 Jan 2018 21:27:37 +0100 Subject: [PATCH] Changed API version and everything else required. (cherry picked from commit db1a282) --- .travis.yml | 4 ++-- app/build.gradle | 20 +++++++++---------- .../externalevents/NotificationListener.java | 8 +++++--- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index be891d615..0b4ea0afa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,10 +16,10 @@ android: - tools # The BuildTools version used by your project - - build-tools-26.0.2 + - build-tools-27.0.3 # The SDK version used to compile your project - - android-25 + - android-27 # Additional components - extra-android-m2repository diff --git a/app/build.gradle b/app/build.gradle index ecf397c07..b8fe0b5cf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,13 +17,13 @@ android { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } - compileSdkVersion 25 - buildToolsVersion '26.0.2' + compileSdkVersion 27 + buildToolsVersion '27.0.3' defaultConfig { applicationId "nodomain.freeyourgadget.gadgetbridge" minSdkVersion 19 - targetSdkVersion 25 + targetSdkVersion 27 // note: always bump BOTH versionCode and versionName! versionName "0.24.5" @@ -64,13 +64,13 @@ dependencies { testCompile "org.robolectric:robolectric:3.5.1" compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:25.4.0' - compile 'com.android.support:cardview-v7:25.4.0' - compile 'com.android.support:recyclerview-v7:25.4.0' - compile 'com.android.support:support-v4:25.4.0' - compile 'com.android.support:gridlayout-v7:25.4.0' - compile 'com.android.support:design:25.4.0' - compile 'com.android.support:palette-v7:25.4.0' + compile 'com.android.support:appcompat-v7:27.0.2' + compile 'com.android.support:cardview-v7:27.0.2' + compile 'com.android.support:recyclerview-v7:27.0.2' + compile 'com.android.support:support-v4:27.0.2' + compile 'com.android.support:gridlayout-v7:27.0.2' + compile 'com.android.support:design:27.0.2' + compile 'com.android.support:palette-v7:27.0.2' compile('com.github.tony19:logback-android-classic:1.1.1-6') { exclude group: 'com.google.android', module: 'android' } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java index b9229f7db..dc737b7de 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -38,13 +38,13 @@ import android.os.PowerManager; import android.os.RemoteException; import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; +import android.support.v4.app.NotificationCompat; import android.support.v4.app.RemoteInput; import android.support.v4.content.LocalBroadcastManager; import android.support.v4.media.MediaMetadataCompat; import android.support.v4.media.session.MediaControllerCompat; import android.support.v4.media.session.MediaSessionCompat; import android.support.v4.media.session.PlaybackStateCompat; -import android.support.v7.app.NotificationCompat; import android.support.v7.graphics.Palette; import org.slf4j.Logger; @@ -67,6 +67,8 @@ import nodomain.freeyourgadget.gadgetbridge.util.LimitedQueue; import nodomain.freeyourgadget.gadgetbridge.util.PebbleUtils; import nodomain.freeyourgadget.gadgetbridge.util.Prefs; +import static android.support.v4.media.app.NotificationCompat.MediaStyle.getMediaSession; + public class NotificationListener extends NotificationListenerService { private static final Logger LOG = LoggerFactory.getLogger(NotificationListener.class); @@ -203,7 +205,7 @@ public class NotificationListener extends NotificationListenerService { String source = sbn.getPackageName().toLowerCase(); Notification notification = sbn.getNotification(); NotificationSpec notificationSpec = new NotificationSpec(); - notificationSpec.id = (int) sbn.getPostTime(); //FIMXE: a truly unique id would be better + notificationSpec.id = (int) sbn.getPostTime(); //FIXME: a truly unique id would be better // determinate Source App Name ("Label") PackageManager pm = getPackageManager(); @@ -434,7 +436,7 @@ public class NotificationListener extends NotificationListenerService { private boolean shouldIgnoreNotification(Notification notification, String source) { - MediaSessionCompat.Token mediaSession = NotificationCompat.getMediaSession(notification); + MediaSessionCompat.Token mediaSession = getMediaSession(notification); //try to handle media session notifications if (mediaSession != null && handleMediaSessionNotification(mediaSession)) return true; diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ceeb26604..f59d96438 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Mar 03 09:26:56 CET 2017 +#Sat Jan 20 22:13:05 EET 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip