InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.71k stars 926 forks source link

Due alarm on connected smartphone leads to "null" notification #376

Closed christianfl closed 3 years ago

christianfl commented 3 years ago

Hey! I just saw that an alarm set on my Android device (connected with Gadgetbridge 0.56.2 and Android standard clock app) causes a one time notification on the PineTime (InfiniTime 1.0) when its due - but that has no title and just the content "null" and gets dismissed like usual messages.

How cool would it be to show some interaction possibility (like with calls) that vibrates until its dismissed on the phone or watch? :-) Useful e.g. when the phone is in another room.

JF002 commented 3 years ago

Notifications are sent by the companion app (gadgetbridge in this case). InfiniTime just displays the content of the notification without trying to interpret the content. InfiniTime only ignore notifications that contains no data at all. In this case, Gadgetbridge probably sent a valid notification with "null" as message... I think this is something that should be handed in gadgetbridge.

Current implementation and protocole of notification does not provide any way to dismiss notifications after they were sent, but that's probably something that can be improved.

Avamander commented 3 years ago

It would require a log of Gadgetbridge to find out what's creating these "null" notifications. Probably shouldn't be filtered out in the sense of forbidding "null" but instead it should be figured out what creates the "null".

christianfl commented 3 years ago

Thanks for the quick answers. I will look a little bit into Gadgetbridge to see why there are null messages and how that could be improved.

Edit: Log is really verbose... Made an alarm to 13:18 which again lead to message "null". No clue so far.

2021-05-21 13:17:39.509 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Notification posted: nodomain.freeyourgadget.gadgetbridge: null
2021-05-21 13:17:39.511 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Not forwarding notification, screen seems to be on and settings do not allow this
2021-05-21 13:17:39.511 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Ignore notification: nodomain.freeyourgadget.gadgetbridge
2021-05-21 13:17:39.641 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Notification posted: nodomain.freeyourgadget.gadgetbridge: null
2021-05-21 13:17:39.645 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Not forwarding notification, screen seems to be on and settings do not allow this
2021-05-21 13:17:39.646 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Ignore notification: nodomain.freeyourgadget.gadgetbridge
2021-05-21 13:17:49.396 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Notification posted: com.android.deskclock: event
2021-05-21 13:17:49.399 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: local only
2021-05-21 13:17:49.399 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Ignore notification: com.android.deskclock
2021-05-21 13:17:49.400 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Notification posted: com.android.deskclock: event
2021-05-21 13:17:49.402 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: local only
2021-05-21 13:17:49.403 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Ignore notification: com.android.deskclock
2021-05-21 13:18:00.098 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Notification removed: com.android.deskclock: event
2021-05-21 13:18:00.100 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: local only
2021-05-21 13:18:00.102 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Notification removed: com.android.deskclock: event
2021-05-21 13:18:00.103 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: local only
2021-05-21 13:18:00.127 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService: Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.notification
2021-05-21 13:18:00.131 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEQueue: about to add: 13:18:00: Transaction task: notification with 1 actions
2021-05-21 13:18:00.134 30717-30796/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEQueue: About to run action: 21. Mai, 13:18: WriteAction on characteristic: 00002a46-0000-1000-8000-00805f9b34fb
2021-05-21 13:18:00.138 30717-30796/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.service.btle.actions.WriteAction: writing to characteristic: 00002a46-0000-1000-8000-00805f9b34fb: 0xfa 0x01 0xff 0x00 0x6e 0x75 0x6c 0x6c
2021-05-21 13:18:00.194 30717-30749/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEQueue: characteristic write: 00002a46-0000-1000-8000-00805f9b34fb (success)
2021-05-21 13:18:00.343 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Notification posted: com.android.deskclock: alarm
2021-05-21 13:18:00.349 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: local only
2021-05-21 13:18:00.349 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Ignore notification: com.android.deskclock
2021-05-21 13:18:06.393 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService: Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.delete_notification
2021-05-21 13:18:06.398 30717-30717/nodomain.freeyourgadget.gadgetbridge D/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Notification removed: com.android.deskclock: alarm
2021-05-21 13:18:06.399 30717-30717/nodomain.freeyourgadget.gadgetbridge I/nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: local only
JF002 commented 3 years ago

I'm closing this issue as it seems to be related to the companion app. Feel free to reopen it if needed.