feat: add opt-in starred-contact DND bypass with settings toggle - #3064
Open
blue-archon wants to merge 1 commit into
Open
blue-archon wants to merge 1 commit into
blue-archon wants to merge 1 commit into
Conversation
Contributor
Author
|
Rebased onto current development and simplified: settings are now natively readable and the sender |
Contributor
Author
|
Rebased onto current master. Two things worth flagging:
|
Contributor
Author
|
Rebased onto v2.1.0, applies cleanly. This is the fork's headline feature, and I'd like to land it upstream so the fork can shrink. It uses Android's native starred-contact DND exception instead of putting the whole channel on the override list. Happy to adjust the approach if you'd like changes. |
Adds an opt-in Override DND for Favorites toggle (default off) in Notification Settings. When enabled, a message from a starred/favorite Android contact breaks through Do Not Disturb while non-favorites follow normal DND. This replaces the previous global channel.setBypassDnd(true) on the New Messages channel and the per-conversation settings channel, which bypassed DND for every sender. Per notification, when the sender resolves to a starred contact the notification Person is built with setUri(lookupUri) plus setImportant so Android's own DND rules grant the exception contact by contact. A new ContactNotificationHelper resolves the lookup URI and starred status; nativeContactId is resolved in Dart from the sender's ContactV2 and passed with the toggle through the create-incoming-message-notification channel.
This branch has not been deployed
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.
What
Adds an opt-in "Override DND for Favorites" toggle (default off) in Notification Settings. When enabled, a message from a starred/favorite Android contact breaks through Do Not Disturb; non-favorites follow normal DND.
How
Replaces the global
channel.setBypassDnd(true)on the New Messages channel (and the per-conversation settings channel), which bypassed DND for every sender, with per-notification logic: when the sender resolves to a starred contact, the notificationPersonis built withsetUri(lookupUri)plussetImportantso Android's own DND rules grant the exception contact by contact.A new
ContactNotificationHelperresolves the lookup URI and starred status.nativeContactIdis resolved in Dart from the sender'sContactV2and passed with the toggle through thecreate-incoming-message-notificationchannel, so there is no extra native contacts query and no SharedPreferences dependency.Stacked on #3062.