diff --git a/CHANGELOG.md b/CHANGELOG.md index 82c8ebdb..ec7726c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ###Changelog +####Version next +* Improved handling of notifications for some apps + ####Version 0.15.0 * New device: Liveview * Liveview: initial support (set the time and receive notifications) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100644 index e876751d..00000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,39 +0,0 @@ - Andreas Shimokawa - Carsten Pfeiffer - Daniele Gobbetti - Julien Pivotto - Steffen Liebergeld - Lem Dulfo - Sergey Trofimov - JohnnySun - Uwe Hermann - 0nse <0nse@users.noreply.github.com> - Gergely Peidl - Christian Fischer - Normano64 - Ⲇⲁⲛⲓ Φi - xzovy - xphnx - Tarik Sekmen - Szymon Tomasz Stefanek - Roman Plevka - rober - Nicolò Balzarotti - Natanael Arndt - Marc Schlaich - kevlarcade - Kevin Richter - Kasha - Ivan - Gilles MOREL - Gilles Émilien MOREL - Chris Perelstein - Carlos Ferreira - atkyritsis - andre - Alexey Afanasev - 6arms1leg - -And all the Transifex translators, which I cannot automatically list, at the moment. - -git log --raw | grep "^Author: " | sort | uniq -c | sort -k 1 -n -r | cut -f 2- -d: > CONTRIBUTORS.md diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst new file mode 100644 index 00000000..e6698fda --- /dev/null +++ b/CONTRIBUTORS.rst @@ -0,0 +1,63 @@ +.. 2>/dev/null + names () + { + echo -e "\n exit;\n**Contributors (sorted by number of commits):**\n"; + git log --all --format='%aN:%aE' | sed 's/@users.github.com/@users.noreply.github.com/g' | awk 'BEGIN{FS=":"}{ct[$2]+=1;if (length($1) > length(e[$2])) {e[$2]=$1}}END{for (i in e) { n[e[i]]=i;c[e[i]]+=ct[i] }; for (a in n) print c[a]"\t* "a" <"n[a]">";}' | sort -n -r | cut -f 2- + } + quine () + { + { + echo ".. 2>/dev/null"; + declare -f names | sed -e 's/^[[:space:]]*/ /'; + declare -f quine | sed -e 's/^[[:space:]]*/ /'; + echo -e " quine\n"; + names; + echo -e "\nAnd all the Transifex translators, which I cannot automatically list, at the moment.\n\n*To update the contributors list just run this file with bash*" + } > CONTRIBUTORS.rst; + exit + } + quine + + + exit; +**Contributors (sorted by number of commits):** + +* Andreas Shimokawa +* Carsten Pfeiffer +* Daniele Gobbetti +* Julien Pivotto +* Steffen Liebergeld +* Lem Dulfo +* Sergey Trofimov +* JohnnySun +* Uwe Hermann +* Gergely Peidl +* 0nse <0nse@users.noreply.github.com> +* Christian Fischer +* Normano64 +* Ⲇⲁⲛⲓ Φi +* xzovy +* xphnx +* Tarik Sekmen +* Szymon Tomasz Stefanek +* Roman Plevka +* rober +* Nicolò Balzarotti +* Natanael Arndt +* Marc Schlaich +* kevlarcade +* Kevin Richter +* Kasha +* Ivan +* Gilles MOREL +* Gilles Émilien MOREL +* Chris Perelstein +* Carlos Ferreira +* atkyritsis +* andre +* Alexey Afanasev +* 6arms1leg + +And all the Transifex translators, which I cannot automatically list, at the moment. + +*To update the contributors list just run this file with bash* 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 0c29c664..c3cd2b3c 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -34,7 +34,6 @@ import nodomain.freeyourgadget.gadgetbridge.model.AppNotificationType; import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec; import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec; import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec; -import nodomain.freeyourgadget.gadgetbridge.model.NotificationType; import nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService; import nodomain.freeyourgadget.gadgetbridge.util.LimitedQueue; import nodomain.freeyourgadget.gadgetbridge.util.Prefs; @@ -190,19 +189,13 @@ public class NotificationListener extends NotificationListenerService { if (!prefs.getBoolean("notifications_generic_whenscreenon", false)) { PowerManager powermanager = (PowerManager) getSystemService(POWER_SERVICE); if (powermanager.isScreenOn()) { - LOG.info("Not forwarding notification, screen seems to be on and settings do not allow this"); +// LOG.info("Not forwarding notification, screen seems to be on and settings do not allow this"); return; } } - //don't forward group summary notifications to the wearable, they are meant for the android device only - if ((notification.flags & Notification.FLAG_GROUP_SUMMARY) == Notification.FLAG_GROUP_SUMMARY) { - LOG.info("Not forwarding notification, FLAG_GROUP_SUMMARY is set"); - return; - } - if ((notification.flags & Notification.FLAG_ONGOING_EVENT) == Notification.FLAG_ONGOING_EVENT) { - LOG.info("Not forwarding notification, FLAG_ONGOING_EVENT is set"); +// LOG.info("Not forwarding notification, FLAG_ONGOING_EVENT is set. Notification flags: " + notification.flags); return; } @@ -258,7 +251,7 @@ public class NotificationListener extends NotificationListenerService { notificationSpec.type = AppNotificationType.getInstance().get(source); - LOG.info("Processing notification from source " + source); + LOG.info("Processing notification from source " + source + " with flags: " + notification.flags); dissectNotificationTo(notification, notificationSpec, preferBigText); notificationSpec.id = (int) sbn.getPostTime(); //FIMXE: a truly unique id would be better @@ -266,8 +259,9 @@ public class NotificationListener extends NotificationListenerService { NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender(notification); List actions = wearableExtender.getActions(); - if (actions.isEmpty() && notificationSpec.type == NotificationType.TELEGRAM) { - return; // workaround for duplicate telegram message + if (actions.isEmpty() && (notification.flags & Notification.FLAG_GROUP_SUMMARY) == Notification.FLAG_GROUP_SUMMARY) { //this could cause #395 to come back + LOG.info("Not forwarding notification, FLAG_GROUP_SUMMARY is set and no wearable action present. Notification flags: " + notification.flags); + return; } for (NotificationCompat.Action act : actions) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java index 6fa3d2c2..883cc13d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java @@ -10,6 +10,8 @@ import java.io.IOException; import java.io.PipedInputStream; import java.io.PipedOutputStream; +import nodomain.freeyourgadget.gadgetbridge.GBApplication; + public class PebbleLESupport { private static final Logger LOG = LoggerFactory.getLogger(PebbleLESupport.class); private final BluetoothDevice mBtDevice; @@ -19,6 +21,7 @@ public class PebbleLESupport { private PipedInputStream mPipedInputStream; private PipedOutputStream mPipedOutputStream; private int mMTU = 20; + private int mMTULimit = Integer.MAX_VALUE; boolean mIsConnected = false; public PebbleLESupport(Context context, final BluetoothDevice btDevice, PipedInputStream pipedInputStream, PipedOutputStream pipedOutputStream) throws IOException { @@ -31,6 +34,9 @@ public class PebbleLESupport { } catch (IOException e) { LOG.warn("could not connect input stream"); } + mMTULimit = GBApplication.getPrefs().getInt("pebble_mtu_limit", 512); + mMTULimit = Math.max(mMTULimit, 20); + mMTULimit = Math.min(mMTULimit, 512); mPebbleGATTServer = new PebbleGATTServer(this, context, mBtDevice); if (mPebbleGATTServer.initialize()) { @@ -99,7 +105,7 @@ public class PebbleLESupport { } void setMTU(int mtu) { - mMTU = mtu; + mMTU = Math.min(mtu, mMTULimit); } private class PipeReader extends Thread { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 09c215ed..a9d2e3e2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -120,6 +120,8 @@ Enable features that are untested. ENABLE ONLY IF YOU KNOW WHAT YOU ARE DOING! Always prefer BLE Use experimental Pebble LE support for all Pebbles instead of BT classic, requires paring a "Pebble LE" after non LE had been connected once + Pebble 2/LE GATT MTU limit + If your Pebble 2/Pebble LE does not work as expected, try this setting to limit the MTU (valid range 20–512) Enable Watch App Logging Will cause logs from watch apps to be logged by Gadgetbridge (requires reconnect) diff --git a/app/src/main/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index 4f1ec60e..5141cf20 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -1,5 +1,8 @@ + + * Improved handling of notifications for some apps + New device: Liveview Liveview: initial support (set the time and receive notifications) diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index efe3e4c7..b721a88f 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -341,6 +341,13 @@ android:key="pebble_force_le" android:summary="@string/pref_summary_pebble_forcele" android:title="@string/pref_title_pebble_forcele" /> +