Not possible to dismiss SMS and Element notifications #3261

Open
opened 2023-08-18 10:34:21 +00:00 by joserebelo · 0 comments
Member

Before reporting a bug, please confirm the following:

  • I have read the wiki, and I didn't find a solution to my problem / an answer to my question.
  • I have searched the issues, and I didn't find a solution to my problem / an answer to my question.
  • If you upload an image or other content, please make sure you have read and understood the Codeberg Terms of Use

Where did you get Gadgetbridge from:

  • F-Droid
  • Gadgetbridge Nightly F-Droid repository
  • Bangle.js Gadgetbridge from the Play Store
  • I built it myself from source code (3fae1accb1)
  • I previously used Gadgetbridge from other sources and then updated to F-Droid version

Your Gadgetbridge version is:

3fae1accb1

Your issue is:

It's currently not possible to dismiss SMS notifications:

  • Notifications are handled in the NotificationListener - this includes both sending and handling the dismissals. The NotificationListener keeps a lookup queue that maps notifications by ID.
  • However, SMS are sent by the SMSReceiver. This gets the SMS event directly, which does not map to a notification on the phone. When trying to dismiss it from NotificationListener, it will fail.

Reported on Espruino forums as well: https://forum.espruino.com/conversations/389054/

Aditionally, some notifications from apps like Element are not possible to dismiss, probably because we are not setting the notification IDs correctly:

06:14:42.890 [main] DEBUG n.f.g.e.NotificationListener - Notification 1 posted: im.vector.app: msg
06:14:42.891 [main] DEBUG n.f.g.e.NotificationListener - notificationAppListIsBlackList: true
06:14:42.922 [main] INFO  n.f.g.e.NotificationListener - Processing notification 1662077817 age: 27456 from source im.vector.app with flags: 1
06:14:42.926 [main] DEBUG n.f.g.e.NotificationListener - No Notification Filter found
06:14:42.931 [main] DEBUG n.f.g.e.NotificationListener - Notification 0 posted: im.vector.app: msg
06:14:42.932 [main] DEBUG n.f.g.e.NotificationListener - notificationAppListIsBlackList: true
06:14:42.933 [main] INFO  n.f.g.e.NotificationListener - NOT processing notification, already sent newer notifications from this source.

Creating the NotificationSpec in the NotificationListener, Gadgetbridge does not set the ID, so it's only incrementing on every notification. This makes it harder to match with the statusbar notification.

Your wearable device is:

Amazfit GTR 4 / Bangle.js 2

Your Android version/manufacturer flavor is:

Android 13

#### Before reporting a bug, please confirm the following: - [x] I have read the [wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki), and I didn't find a solution to my problem / an answer to my question. - [x] I have searched the [issues](https://codeberg.org/Freeyourgadget/Gadgetbridge/issues), and I didn't find a solution to my problem / an answer to my question. - [x] If you upload an image or other content, please make sure you have read and understood the [Codeberg Terms of Use](https://codeberg.org/Codeberg/org/src/branch/main/TermsOfUse.md) ### Where did you get Gadgetbridge from: * [ ] F-Droid * [ ] Gadgetbridge Nightly F-Droid repository * [ ] Bangle.js Gadgetbridge from the Play Store * [x] I built it myself from source code (3fae1accb1d7204fa9e56ecf95e9c30e2f7b1843) * [ ] I previously used Gadgetbridge from other sources and then updated to F-Droid version ### Your Gadgetbridge version is: 3fae1accb1d7204fa9e56ecf95e9c30e2f7b1843 #### Your issue is: It's currently not possible to dismiss SMS notifications: - Notifications are handled in the NotificationListener - this includes both sending and handling the dismissals. The NotificationListener keeps a lookup queue that maps notifications by ID. - However, SMS are sent by the SMSReceiver. This gets the SMS event directly, which does not map to a notification on the phone. When trying to dismiss it from NotificationListener, it will fail. Reported on Espruino forums as well: https://forum.espruino.com/conversations/389054/ Aditionally, some notifications from apps like Element are not possible to dismiss, probably because we are not setting the notification IDs correctly: ``` 06:14:42.890 [main] DEBUG n.f.g.e.NotificationListener - Notification 1 posted: im.vector.app: msg 06:14:42.891 [main] DEBUG n.f.g.e.NotificationListener - notificationAppListIsBlackList: true 06:14:42.922 [main] INFO n.f.g.e.NotificationListener - Processing notification 1662077817 age: 27456 from source im.vector.app with flags: 1 06:14:42.926 [main] DEBUG n.f.g.e.NotificationListener - No Notification Filter found 06:14:42.931 [main] DEBUG n.f.g.e.NotificationListener - Notification 0 posted: im.vector.app: msg 06:14:42.932 [main] DEBUG n.f.g.e.NotificationListener - notificationAppListIsBlackList: true 06:14:42.933 [main] INFO n.f.g.e.NotificationListener - NOT processing notification, already sent newer notifications from this source. ``` Creating the NotificationSpec in the NotificationListener, Gadgetbridge does not set the ID, so it's only incrementing on every notification. This makes it harder to match with the statusbar notification. #### Your wearable device is: Amazfit GTR 4 / Bangle.js 2 #### Your Android version/manufacturer flavor is: Android 13
joserebelo added the
notifications
label 2023-08-18 10:36:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Freeyourgadget/Gadgetbridge#3261
No description provided.