Adds modes settings page for bypassing apps

Adds the settings page that a user will reach from a mode settings page
when they tap on "App," to allow  them to select whether all, none, or
priority modes can break through and send notifications.

Bug: 308819928
Bug: 331267485
Flag: android.app.modes_ui DEVELOPMENT
Test: build and test, controller unit tests
Change-Id: I5bcebfca0fc2882f839afdced8d2b817dad14e6c
This commit is contained in:
Alexander Roederer
2024-05-14 23:42:07 +00:00
parent aa6eb398fd
commit c512046eb9
11 changed files with 767 additions and 0 deletions

View File

@@ -395,4 +395,19 @@ class ZenModeSummaryHelper {
return mContext.getResources().getString(R.string.zen_mode_people_some);
}
}
/**
* Generates a summary to display under the top level "Apps" preference for a mode.
*/
public String getAppsSummary(ZenMode zenMode) {
// TODO: b/308819928 - Set summary using priority app list if Selected Apps Chosen.
if (zenMode.getPolicy().getAllowedChannels() == ZenPolicy.CHANNEL_POLICY_PRIORITY) {
return mContext.getResources().getString(R.string.zen_mode_apps_priority_apps);
} else if (zenMode.getPolicy().getAllowedChannels() == ZenPolicy.CHANNEL_POLICY_NONE) {
return mContext.getResources().getString(R.string.zen_mode_apps_none_apps);
} else if (zenMode.getPolicy().getAllowedChannels() == ZenMode.CHANNEL_POLICY_ALL) {
return mContext.getResources().getString(R.string.zen_mode_apps_all_apps);
}
return "";
}
}