Repository navigation
fix(critical): ask for Do Not Disturb access so critical alerts can ring in DND on every Android phone - #147
Merged
Conversation
…t the channel switch can ring in DND Samsung's One UI leaves the per-channel "Override Do Not Disturb" switch out of the channel's settings page, so critical setup sent people to a page with nothing to turn on and looped back to the same button. With Do Not Disturb access, Android honours the channel's bypassDnd when the app creates it, and still keeps a switch the person changed themselves.
Code review
Adds Android notification-policy access to the app and opens the system Do Not Disturb access page from critical-alert setup. Channel checks now recreate notification channels so Android can apply the critical channel's DND override after access is granted, and setup copy and README guidance are updated. Walkthrough (5)
Reviewed Tip Comment |
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.

Problem
A user's recording (Samsung One UI) showed Android critical-alerts setup looping. Override Do Not Disturb opened the critical channel's settings, but One UI leaves the per-channel "Override Do Not Disturb" switch out of that page. There was nothing to turn on,
bypassDndstayedfalse, and going back showed the same button again. The only way out was Not now, which left critical alerts silent in Do Not Disturb.Why it happens
The app creates the
criticalchannel withbypassDnd: true, but Android drops that unless the app has Do Not Disturb (notification policy) access. On the emulator the channel storesmBypassDnd=falseright after creation. Setup only moves on once the person turns the per-channel switch on, and some OEM builds don't show that switch.Fix
ACCESS_NOTIFICATION_POLICYand have the button open Android's Do Not Disturb access list (NOTIFICATION_POLICY_ACCESS_SETTINGS). This standard settings page exists on every OEM, and the new permission is what makes Beep appear in it.getCritical()callscreateChannels()again before it reads the channel. Once access is granted, Android appliesbypassDnd: trueto the existing channel, so setup moves on without the per-channel switch.createChannels()again leaves it off (mUserLockedFields=1, checked on the emulator).Verified on an Android 16 emulator (demo build)
mBypassDnd=false, every time.mBypassDnd=trueand setup shows Continue.format:check,lintandtypecheckpass.Before
After
Part of appwrite-labs/cloud#7206