Changed API version and everything else required.

This commit is contained in:
TaaviE 2018-01-20 22:27:37 +02:00
parent a74ffca249
commit db1a282656
4 changed files with 18 additions and 16 deletions

View File

@ -17,13 +17,13 @@ android {
sourceCompatibility JavaVersion.VERSION_1_7 sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7
} }
compileSdkVersion 25 compileSdkVersion 27
buildToolsVersion '26.0.2' buildToolsVersion '27.0.3'
defaultConfig { defaultConfig {
applicationId "nodomain.freeyourgadget.gadgetbridge" applicationId "nodomain.freeyourgadget.gadgetbridge"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 25 targetSdkVersion 27
// note: always bump BOTH versionCode and versionName! // note: always bump BOTH versionCode and versionName!
versionName "0.24.1" versionName "0.24.1"
@ -64,13 +64,13 @@ dependencies {
testCompile "org.robolectric:robolectric:3.5.1" testCompile "org.robolectric:robolectric:3.5.1"
compile fileTree(dir: 'libs', include: ['*.jar']) compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.4.0' compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:cardview-v7:25.4.0' compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:recyclerview-v7:25.4.0' compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.android.support:support-v4:25.4.0' compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support:gridlayout-v7:25.4.0' compile 'com.android.support:gridlayout-v7:27.0.2'
compile 'com.android.support:design:25.4.0' compile 'com.android.support:design:27.0.2'
compile 'com.android.support:palette-v7:25.4.0' compile 'com.android.support:palette-v7:27.0.2'
compile('com.github.tony19:logback-android-classic:1.1.1-6') { compile('com.github.tony19:logback-android-classic:1.1.1-6') {
exclude group: 'com.google.android', module: 'android' exclude group: 'com.google.android', module: 'android'
} }

View File

@ -44,7 +44,7 @@ import android.support.v4.media.MediaMetadataCompat;
import android.support.v4.media.session.MediaControllerCompat; import android.support.v4.media.session.MediaControllerCompat;
import android.support.v4.media.session.MediaSessionCompat; import android.support.v4.media.session.MediaSessionCompat;
import android.support.v4.media.session.PlaybackStateCompat; 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 android.support.v7.graphics.Palette;
import org.slf4j.Logger; 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.PebbleUtils;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs; import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
import static android.support.v4.media.app.NotificationCompat.MediaStyle.getMediaSession;
public class NotificationListener extends NotificationListenerService { public class NotificationListener extends NotificationListenerService {
private static final Logger LOG = LoggerFactory.getLogger(NotificationListener.class); private static final Logger LOG = LoggerFactory.getLogger(NotificationListener.class);
@ -203,7 +205,7 @@ public class NotificationListener extends NotificationListenerService {
String source = sbn.getPackageName().toLowerCase(); String source = sbn.getPackageName().toLowerCase();
Notification notification = sbn.getNotification(); Notification notification = sbn.getNotification();
NotificationSpec notificationSpec = new NotificationSpec(); 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") // determinate Source App Name ("Label")
PackageManager pm = getPackageManager(); PackageManager pm = getPackageManager();
@ -434,7 +436,7 @@ public class NotificationListener extends NotificationListenerService {
private boolean shouldIgnoreNotification(Notification notification, String source) { private boolean shouldIgnoreNotification(Notification notification, String source) {
MediaSessionCompat.Token mediaSession = NotificationCompat.getMediaSession(notification); MediaSessionCompat.Token mediaSession = getMediaSession(notification);
//try to handle media session notifications //try to handle media session notifications
if (mediaSession != null && handleMediaSessionNotification(mediaSession)) if (mediaSession != null && handleMediaSessionNotification(mediaSession))
return true; return true;

View File

@ -6,7 +6,7 @@ buildscript {
google() google()
} }
dependencies { 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 // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

View File

@ -1,6 +1,6 @@
#Fri Mar 03 09:26:56 CET 2017 #Sat Jan 20 22:13:05 EET 2018
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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