Skip to content

LED doesn't blink with encryption enabled #261

Bastien Le Querrec requested to merge github/fork/discworld/master into master

Created by: discworld

Hello,

I did some changes to the way notifications work in order to fix this issue and issue #203 (closed). The reason for so many changes is that there are some harder use-cases (for example the led was turned off when the pass-phrase timeout kicked in as well). The changes seem to work for me but it would be nice for someone else to test this as well.

Thanks!

git commit message:

Notifications in SMSSecure seem to rely mainly on two public methods:

MessageNotifier.updateNotification(Context, MasterSecret, long) and MessageNotifier.updateNotification(Context, MasterSecret)

The difference between them is that the first is also aware of in thread notifications and triggers visual and audible alarms. Since the second method doesn't call setLights, calling it after the first will cause the blinking lights to stop. This patch changes a number of things:

  • separate the alarms into visual and audio alarms.
  • so long as the notification is not canceled, make the second method also call setLights if the first method was previously called.
  • removed unnecessary calls to the first method to avoid duplicate sound alarms.

Merge request reports