From db1a282656269795c99bacbcfcf75960e501d6cd Mon Sep 17 00:00:00 2001 From: TaaviE Date: Sat, 20 Jan 2018 22:27:37 +0200 Subject: [PATCH] Changed API version and everything else required. --- app/build.gradle | 20 +++++++++---------- .../externalevents/NotificationListener.java | 8 +++++--- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 22fd6717f..f89480ec3 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.1" @@ -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 7ecdeb32a..9f5280bf6 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -44,7 +44,7 @@ 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.v4.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/build.gradle b/build.gradle index 7c5917d4e..adf8a7d43 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.0-alpha08' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files 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