Don't let a notification cancel a ringing alarm - #2484
Open
DustinHab wants to merge 1 commit into
Open
Conversation
A new notification unconditionally loads the notification preview, which destroys the currently loaded screen. If the alarm or an expired timer is ringing at that moment, ~Alarm() and ~Timer() stop the ringing as part of that teardown, so the alert is cancelled rather than hidden behind the preview. Skip the preview while the watch itself is alerting. The notification is still stored and can be read from the notification list. Fixes InfiniTimeOrg#1223
|
Build size and comparison to main:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new notification loads the preview screen unconditionally, which destroys whatever screen is currently loaded. When the alarm or an expired timer is ringing, that teardown also stops the ringing —
~Alarm()callsStopAlerting(),~Timer()callsStopRinging()andResetExpiredTime()— so the alert is cancelled rather than hidden behind the preview. The alarm does not come back afterwards.This skips the preview while the watch itself is alerting. Nothing is lost: the notification is still stored and can be read from the notification list.
Tested in the simulator with the timer, since that is the quicker of the two to reproduce: set a one second timer, let it expire, then send a notification while it rings. Before the change the timer screen is replaced by the preview and the ringing stops; with the change the timer keeps ringing. The alarm reaches the same
LoadNewScreenpath.Fixes #1223