DND Bypassing Apps redesign
- Add link in DND Conversations Page to the overall conversations list Settings page - Add custom_rule xml pages for custom schedule rule settings for messages and calls (so the UI is the same as before the message/calls redesign) - Change app exceptions to display apps with subtext indicating which notitfication channels are allowed to bypass dnd (previously, would display each channel individually) - Add individual AppBypassDnd channel pages where users can decide which channels will bypass DND for an app on a single page (AppChannelsBypassingDndSettings) - Only remove dnd bypassing apps preferences from the preference list if the list changed, else just update the preference itself to avoid the list from flashing Test: make RunSettingsRoboTests7 Bug: 151845457 Change-Id: If12d8921e1405aefb1066acc2ef5c55d216fe47a
This commit is contained in:
@@ -287,44 +287,15 @@ public class ZenModeBackend {
|
||||
|
||||
protected int getAlarmsTotalSilencePeopleSummary(int category) {
|
||||
if (category == NotificationManager.Policy.PRIORITY_CATEGORY_MESSAGES) {
|
||||
return R.string.zen_mode_from_none_messages;
|
||||
return R.string.zen_mode_from_none;
|
||||
} else if (category == NotificationManager.Policy.PRIORITY_CATEGORY_CALLS){
|
||||
return R.string.zen_mode_from_none_calls;
|
||||
return R.string.zen_mode_from_none;
|
||||
} else if (category == NotificationManager.Policy.PRIORITY_CATEGORY_CONVERSATIONS) {
|
||||
return R.string.zen_mode_from_no_conversations;
|
||||
}
|
||||
return R.string.zen_mode_from_none;
|
||||
}
|
||||
|
||||
protected int getContactsSummary(int category) {
|
||||
int contactType = -1;
|
||||
if (category == NotificationManager.Policy.PRIORITY_CATEGORY_MESSAGES) {
|
||||
if (isPriorityCategoryEnabled(category)) {
|
||||
contactType = getPriorityMessageSenders();
|
||||
}
|
||||
} else if (category == NotificationManager.Policy.PRIORITY_CATEGORY_CALLS) {
|
||||
if (isPriorityCategoryEnabled(category)) {
|
||||
contactType = getPriorityCallSenders();
|
||||
}
|
||||
}
|
||||
|
||||
switch (contactType) {
|
||||
case NotificationManager.Policy.PRIORITY_SENDERS_ANY:
|
||||
return R.string.zen_mode_from_anyone;
|
||||
case NotificationManager.Policy.PRIORITY_SENDERS_CONTACTS:
|
||||
return R.string.zen_mode_from_contacts;
|
||||
case NotificationManager.Policy.PRIORITY_SENDERS_STARRED:
|
||||
return R.string.zen_mode_from_starred;
|
||||
case SOURCE_NONE:
|
||||
default:
|
||||
if (category == NotificationManager.Policy.PRIORITY_CATEGORY_MESSAGES) {
|
||||
return R.string.zen_mode_from_none_messages;
|
||||
} else {
|
||||
return R.string.zen_mode_from_none_calls;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected int getConversationSummary() {
|
||||
int conversationType = getPriorityConversationSenders();
|
||||
|
||||
@@ -366,7 +337,7 @@ public class ZenModeBackend {
|
||||
return R.string.zen_mode_from_starred;
|
||||
case ZenPolicy.PEOPLE_TYPE_NONE:
|
||||
default:
|
||||
return R.string.zen_mode_from_none_messages;
|
||||
return R.string.zen_mode_from_none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,20 +355,6 @@ public class ZenModeBackend {
|
||||
}
|
||||
}
|
||||
|
||||
protected static int getSettingFromPrefKey(String key) {
|
||||
switch (key) {
|
||||
case ZEN_MODE_FROM_ANYONE:
|
||||
return NotificationManager.Policy.PRIORITY_SENDERS_ANY;
|
||||
case ZEN_MODE_FROM_CONTACTS:
|
||||
return NotificationManager.Policy.PRIORITY_SENDERS_CONTACTS;
|
||||
case ZEN_MODE_FROM_STARRED:
|
||||
return NotificationManager.Policy.PRIORITY_SENDERS_STARRED;
|
||||
case ZEN_MODE_FROM_NONE:
|
||||
default:
|
||||
return SOURCE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean removeZenRule(String ruleId) {
|
||||
return NotificationManager.from(mContext).removeAutomaticZenRule(ruleId);
|
||||
}
|
||||
|
Reference in New Issue
Block a user