Skip to content

Don't let a notification cancel a ringing alarm - #2484

Open
DustinHab wants to merge 1 commit into
InfiniTimeOrg:mainfrom
DustinHab:fix-notification-cancels-alarm
Open

Don't let a notification cancel a ringing alarm#2484
DustinHab wants to merge 1 commit into
InfiniTimeOrg:mainfrom
DustinHab:fix-notification-cancels-alarm

Conversation

@DustinHab

Copy link
Copy Markdown

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() calls StopAlerting(), ~Timer() calls StopRinging() and ResetExpiredTime() — 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 LoadNewScreen path.

Fixes #1223

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
@github-actions

Copy link
Copy Markdown

Build size and comparison to main:

Section Size Difference
text 388032B 48B
data 936B 0B
bss 22936B 0B

Run in InfiniEmu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alarm gets dismissed by Notification

1 participant