From 053b9553bc0d4c684c163dbf6f73616c4f9a5f18 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 11 Sep 2016 00:36:04 +0200 Subject: [PATCH] correct changelog (pebble health is also affected by userid and deviceid swapping) --- CHANGELOG.md | 2 +- .../gadgetbridge/externalevents/NotificationListener.java | 8 +++----- app/src/main/res/xml/changelog_master.xml | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a3e1f0b9..3116a8d5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ###Changelog ####Version 0.12.1 -* Pebble: fix Morpheuz and Misfit data being associated with the wrong device and/or user in some cases causing them to invisible in charts +* Pebble: Fix activity data being associated with the wrong device and/or user in some cases causing them to invisible in charts * Remove special handling for Conversations notfications since upstream dropped special pebble support ####Version 0.12.0 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 0c07eee69..74c63af30 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -56,7 +56,6 @@ public class NotificationListener extends NotificationListenerService { private LimitedQueue mActionLookup = new LimitedQueue(16); private final BroadcastReceiver mReceiver = new BroadcastReceiver() { - @SuppressLint("NewApi") @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); @@ -69,7 +68,7 @@ public class NotificationListener extends NotificationListenerService { StatusBarNotification[] sbns = NotificationListener.this.getActiveNotifications(); int handle = intent.getIntExtra("handle", -1); for (StatusBarNotification sbn : sbns) { - if ((int) sbn.getPostTime() == handle) { + if (sbn.getId() == handle) { if (action.equals(ACTION_OPEN)) { try { PendingIntent pi = sbn.getNotification().contentIntent; @@ -92,7 +91,7 @@ public class NotificationListener extends NotificationListenerService { StatusBarNotification[] sbns = NotificationListener.this.getActiveNotifications(); int handle = intent.getIntExtra("handle", -1); for (StatusBarNotification sbn : sbns) { - if ((int) sbn.getPostTime() == handle) { + if (sbn.getId() == handle) { if (GBApplication.isRunningLollipopOrLater()) { String key = sbn.getKey(); NotificationListener.this.cancelNotification(key); @@ -276,8 +275,7 @@ public class NotificationListener extends NotificationListenerService { LOG.info("Processing notification from source " + source); dissectNotificationTo(notification, notificationSpec); - notificationSpec.id = (int) sbn.getPostTime(); //FIMXE: a truly unique id would be better - + notificationSpec.id = sbn.getId(); NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender(notification); List actions = wearableExtender.getActions(); for (NotificationCompat.Action act : actions) { diff --git a/app/src/main/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index ef2ae4574..c174eeb1d 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -1,7 +1,7 @@ - Pebble: fix Morpheuz and Misfit data being associated with the wrong device and/or user in some cases causing them to invisible in charts + Pebble: fix activity data being associated with the wrong device and/or user in some cases causing them to invisible in charts Remove special handling for Conversations notfications since upstream dropped special pebble support