Update DND people Settings pages

Settings > Sound > Do Not Disturb > People
- Redesign of messages + calls settings pages
- Redesign of conversations page
- Added strings for Apps page

Test: make RunSettingsRoboTests7
Bug: 151845457
Change-Id: I58d22a31c398418c053e06a4c6bf5ed8c482ee35
This commit is contained in:
Beverly
2020-03-19 16:58:20 -04:00
committed by Beverly Tai
parent 509273cc03
commit e65db314f1
20 changed files with 1081 additions and 827 deletions

View File

@@ -16,8 +16,6 @@
package com.android.settings.notification.zen;
import static android.app.NotificationManager.Policy.CONVERSATION_SENDERS_ANYONE;
import static android.app.NotificationManager.Policy.CONVERSATION_SENDERS_IMPORTANT;
import static android.app.NotificationManager.Policy.PRIORITY_CATEGORY_CONVERSATIONS;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_SCREEN_OFF;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_SCREEN_ON;
@@ -501,7 +499,7 @@ public class ZenModeBackend {
private List<String> getStarredContacts() {
Cursor cursor = null;
try {
cursor = queryData();
cursor = queryStarredContactsData();
return getStarredContacts(cursor);
} finally {
if (cursor != null) {
@@ -510,7 +508,7 @@ public class ZenModeBackend {
}
}
public String getStarredContactsSummary(Context context) {
String getStarredContactsSummary(Context context) {
List<String> starredContacts = getStarredContacts();
int numStarredContacts = starredContacts.size();
@@ -536,13 +534,24 @@ public class ZenModeBackend {
return ListFormatter.getInstance().format(displayContacts);
}
private Cursor queryData() {
String getContactsNumberSummary(Context context) {
return context.getResources().getString(R.string.zen_mode_contacts_senders_summary,
queryAllContactsData().getCount());
}
private Cursor queryStarredContactsData() {
return mContext.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,
new String[]{ContactsContract.Contacts.DISPLAY_NAME_PRIMARY},
ContactsContract.Data.STARRED + "=1", null,
ContactsContract.Data.TIMES_CONTACTED);
}
private Cursor queryAllContactsData() {
return mContext.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,
new String[]{ContactsContract.Contacts.DISPLAY_NAME_PRIMARY},
null, null, null);
}
@VisibleForTesting
public static final Comparator<Map.Entry<String, AutomaticZenRule>> RULE_COMPARATOR =
new Comparator<Map.Entry<String, AutomaticZenRule>>() {