diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 33976a6b86b..f95809ea3d2 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -1077,11 +1077,18 @@
- never
-
+
- @string/zen_mode_from_anyone
- @string/zen_mode_from_contacts
- @string/zen_mode_from_starred
- - @string/zen_mode_from_none
+ - @string/zen_mode_from_none_calls
+
+
+
+ - @string/zen_mode_from_anyone
+ - @string/zen_mode_from_contacts
+ - @string/zen_mode_from_starred
+ - @string/zen_mode_from_none_messages
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4aa09515ca0..44d43c3b9c5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -670,7 +670,7 @@
Mobile data
- Calls
+ Allow calls
SMS messages
@@ -7083,8 +7083,8 @@
- - 1 rule
- - %d rules
+ - 1 enabled
+ - %d enabled
@@ -7124,10 +7124,10 @@
Delete
- Do Not Disturb
+ Schedules
- Automatic rule
+ Schedule
Schedule
@@ -7142,7 +7142,7 @@
Schedule
- Use rule
+ Use schedule
Priority only
@@ -7166,7 +7166,7 @@
When Do Not Disturb is on
- Notification restrictions
+ Restrict notifications
No sound from notifications
@@ -7272,7 +7272,7 @@
On / %1$s
- Off / %1$s
+ Off / %1$s
Off
@@ -7297,12 +7297,12 @@
- - 1 rule can turn on automatically
- - %d rules can turn on automatically
+ - 1 schedule can turn on automatically
+ - %d schedules can turn on automatically
- Mute phone, but allow exceptions
+ Mute device but allow exceptions
Exceptions
@@ -7753,28 +7753,28 @@
Rename
- Rule name
+ Schedule name
- Enter rule name
+ Enter schedule name
- Rule name already in use
+ Schedule name already in use
Add more
- Add event rule
+ Add event schedule
- Add time rule
+ Add time schedule
- Delete rule
+ Delete schedule
- Choose rule type
+ Choose schedule type
Delete \u201c%1$s\u201d rule?
@@ -7855,7 +7855,7 @@
Alarm can override end time
- Stop at the end time or next alarm, whichever comes first
+ Schedule turns off when an alarm rings
Do Not Disturb behavior
@@ -7876,10 +7876,10 @@
%1$s to %2$s
- Calls
+ Allow calls
- Allow calls
+ Calls
When Do Not Disturb is on, incoming calls are blocked. You can adjust settings to allow your friends, family, or other contacts to reach you.
@@ -7894,25 +7894,13 @@
- Messages
+ Allow text messages
When Do Not Disturb is on, incoming text messages are blocked. You can adjust settings to allow your friends, family, or other contacts to reach you.
-
- Allow messages
-
-
- Messages
-
-
- messages
-
-
- Some messages
-
-
- some messages
+
+ Text messages
From anyone
@@ -7932,9 +7920,15 @@
From repeat callers only
-
+
None
+
+ Don\u2019t allow any calls
+
+
+ Don\u2019t allow any messages
+
Allow alarms
@@ -7942,7 +7936,7 @@
alarms
- Allow media
+ Allow media sounds
media
@@ -7966,7 +7960,7 @@
Allow apps to override
- Overrides Do Not Disturb
+ App exceptions
@@ -7997,10 +7991,10 @@
Allow repeat callers
- From %1$s
+ Allow from %1$s
- From %1$s and %2$s
+ Allow from %1$s and %2$s
If the same person calls a second time within a %d minute period
diff --git a/res/xml/zen_mode_calls_settings.xml b/res/xml/zen_mode_calls_settings.xml
index 74b6986f3cc..4616cf8c61d 100644
--- a/res/xml/zen_mode_calls_settings.xml
+++ b/res/xml/zen_mode_calls_settings.xml
@@ -19,7 +19,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="zen_mode_calls_settings_page"
- android:title="@string/zen_mode_calls" >
+ android:title="@string/zen_mode_calls_title" >
+ android:title="@string/zen_mode_messages_title" >
diff --git a/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceController.java b/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceController.java
index 615b26c35d9..7da90c8de9d 100644
--- a/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceController.java
@@ -73,8 +73,7 @@ public class ZenModeAutomaticRulesPreferenceController extends
// 2. rule was added or deleted, so reload the entire list
if (Objects.equals(pref.mId, sortedRules[i].getKey())) {
AutomaticZenRule rule = sortedRules[i].getValue();
- pref.setName(rule.getName());
- pref.setChecked(rule.isEnabled());
+ pref.updatePreference(rule);
} else {
reloadAllRules(sortedRules);
break;
diff --git a/src/com/android/settings/notification/ZenModeBackend.java b/src/com/android/settings/notification/ZenModeBackend.java
index 4824825aa91..a75f51c423d 100644
--- a/src/com/android/settings/notification/ZenModeBackend.java
+++ b/src/com/android/settings/notification/ZenModeBackend.java
@@ -250,15 +250,17 @@ public class ZenModeBackend {
}
}
+ protected int getAlarmsTotalSilenceCallsMessagesSummary(int category) {
+ if (category == NotificationManager.Policy.PRIORITY_CATEGORY_MESSAGES) {
+ return R.string.zen_mode_from_none_messages;
+ } else if (category == NotificationManager.Policy.PRIORITY_CATEGORY_CALLS){
+ return R.string.zen_mode_from_none_calls;
+ }
+ return 0;
+ }
+
protected int getContactsSummary(int category) {
int contactType = -1;
-
- // SOURCE_NONE can be used when in total silence or alarms only
- // (policy is based on user's preferences but the UI displayed is based on zenMode)
- if (category == SOURCE_NONE) {
- return R.string.zen_mode_from_none;
- }
-
if (category == NotificationManager.Policy.PRIORITY_CATEGORY_MESSAGES) {
if (isPriorityCategoryEnabled(category)) {
contactType = getPriorityMessageSenders();
@@ -273,12 +275,16 @@ public class ZenModeBackend {
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;
+ return R.string.zen_mode_from_contacts;
case NotificationManager.Policy.PRIORITY_SENDERS_STARRED:
- return R.string.zen_mode_from_starred;
+ return R.string.zen_mode_from_starred;
case SOURCE_NONE:
default:
- return R.string.zen_mode_from_none;
+ if (category == NotificationManager.Policy.PRIORITY_CATEGORY_MESSAGES) {
+ return R.string.zen_mode_from_none_messages;
+ } else {
+ return R.string.zen_mode_from_none_calls;
+ }
}
}
diff --git a/src/com/android/settings/notification/ZenModeMessagesPreferenceController.java b/src/com/android/settings/notification/ZenModeMessagesPreferenceController.java
index 19ee809732b..2e41f205f58 100644
--- a/src/com/android/settings/notification/ZenModeMessagesPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeMessagesPreferenceController.java
@@ -18,11 +18,11 @@ package com.android.settings.notification;
import android.content.Context;
+import androidx.preference.Preference;
+
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.lifecycle.Lifecycle;
-import androidx.preference.Preference;
-
public class ZenModeMessagesPreferenceController extends
AbstractZenModePreferenceController implements PreferenceControllerMixin {
@@ -48,6 +48,7 @@ public class ZenModeMessagesPreferenceController extends
@Override
public void updateState(Preference preference) {
super.updateState(preference);
- // TODO: (b/111475013 - beverlyt) set messages summary
+
+ preference.setSummary(mSummaryBuilder.getMessagesSettingSummary(getPolicy()));
}
}
diff --git a/src/com/android/settings/notification/ZenModePriorityCallsPreferenceController.java b/src/com/android/settings/notification/ZenModePriorityCallsPreferenceController.java
index 44b6c2474f8..9872188744f 100644
--- a/src/com/android/settings/notification/ZenModePriorityCallsPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModePriorityCallsPreferenceController.java
@@ -21,14 +21,14 @@ import android.content.Context;
import android.provider.Settings;
import android.text.TextUtils;
-import com.android.settings.R;
-import com.android.settingslib.core.lifecycle.Lifecycle;
-
import androidx.annotation.VisibleForTesting;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
+import com.android.settings.R;
+import com.android.settingslib.core.lifecycle.Lifecycle;
+
public class ZenModePriorityCallsPreferenceController extends AbstractZenModePreferenceController
implements Preference.OnPreferenceChangeListener {
@@ -80,7 +80,8 @@ public class ZenModePriorityCallsPreferenceController extends AbstractZenModePre
case Settings.Global.ZEN_MODE_ALARMS:
mPreference.setEnabled(false);
mPreference.setValue(ZenModeBackend.ZEN_MODE_FROM_NONE);
- mPreference.setSummary(mBackend.getContactsSummary(ZenModeBackend.SOURCE_NONE));
+ mPreference.setSummary(mBackend.getAlarmsTotalSilenceCallsMessagesSummary(
+ NotificationManager.Policy.PRIORITY_CATEGORY_CALLS));
break;
default:
preference.setEnabled(true);
diff --git a/src/com/android/settings/notification/ZenModePriorityMessagesPreferenceController.java b/src/com/android/settings/notification/ZenModePriorityMessagesPreferenceController.java
index 56829a74acb..cfda367f617 100644
--- a/src/com/android/settings/notification/ZenModePriorityMessagesPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModePriorityMessagesPreferenceController.java
@@ -21,14 +21,14 @@ import android.content.Context;
import android.provider.Settings;
import android.text.TextUtils;
-import com.android.settings.R;
-import com.android.settingslib.core.lifecycle.Lifecycle;
-
import androidx.annotation.VisibleForTesting;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
+import com.android.settings.R;
+import com.android.settingslib.core.lifecycle.Lifecycle;
+
public class ZenModePriorityMessagesPreferenceController extends AbstractZenModePreferenceController
implements Preference.OnPreferenceChangeListener {
@@ -80,7 +80,8 @@ public class ZenModePriorityMessagesPreferenceController extends AbstractZenMode
case Settings.Global.ZEN_MODE_ALARMS:
mPreference.setEnabled(false);
mPreference.setValue(ZenModeBackend.ZEN_MODE_FROM_NONE);
- mPreference.setSummary(mBackend.getContactsSummary(ZenModeBackend.SOURCE_NONE));
+ mPreference.setSummary(mBackend.getAlarmsTotalSilenceCallsMessagesSummary(
+ NotificationManager.Policy.PRIORITY_CATEGORY_MESSAGES));
break;
default:
preference.setEnabled(true);
diff --git a/src/com/android/settings/notification/ZenModeSettings.java b/src/com/android/settings/notification/ZenModeSettings.java
index 293c429b17a..a3f59c680d5 100644
--- a/src/com/android/settings/notification/ZenModeSettings.java
+++ b/src/com/android/settings/notification/ZenModeSettings.java
@@ -145,7 +145,7 @@ public class ZenModeSettings extends ZenModeSettingsBase {
|| PRIORITY_CATEGORY_REPEAT_CALLERS == category, false);
int numCategories = enabledCategories.size();
if (numCategories == 0) {
- return mContext.getString(R.string.zen_mode_no_exceptions);
+ return mContext.getString(R.string.zen_mode_from_none_calls);
} else if (numCategories == 1) {
return mContext.getString(R.string.zen_mode_calls_summary_one,
enabledCategories.get(0));
@@ -156,34 +156,14 @@ public class ZenModeSettings extends ZenModeSettingsBase {
}
}
- String getMsgEventReminderSettingSummary(Policy policy) {
+ String getMessagesSettingSummary(Policy policy) {
List enabledCategories = getEnabledCategories(policy,
- category -> PRIORITY_CATEGORY_EVENTS == category
- || PRIORITY_CATEGORY_REMINDERS == category
- || PRIORITY_CATEGORY_MESSAGES == category, true);
+ category -> PRIORITY_CATEGORY_MESSAGES == category, false);
int numCategories = enabledCategories.size();
if (numCategories == 0) {
- return mContext.getString(R.string.zen_mode_no_exceptions);
- } else if (numCategories == 1) {
- return enabledCategories.get(0);
- } else if (numCategories == 2) {
- return mContext.getString(R.string.join_two_items, enabledCategories.get(0),
- enabledCategories.get(1));
- } else if (numCategories == 3){
- final List summaries = new ArrayList<>();
- summaries.add(enabledCategories.get(0));
- summaries.add(enabledCategories.get(1));
- summaries.add(enabledCategories.get(2));
-
- return ListFormatter.getInstance().format(summaries);
+ return mContext.getString(R.string.zen_mode_from_none_messages);
} else {
- final List summaries = new ArrayList<>();
- summaries.add(enabledCategories.get(0));
- summaries.add(enabledCategories.get(1));
- summaries.add(enabledCategories.get(2));
- summaries.add(mContext.getString(R.string.zen_mode_other_options));
-
- return ListFormatter.getInstance().format(summaries);
+ return enabledCategories.get(0);
}
}
@@ -292,17 +272,11 @@ public class ZenModeSettings extends ZenModeSettingsBase {
}
} else if (category == Policy.PRIORITY_CATEGORY_MESSAGES) {
if (policy.priorityMessageSenders == Policy.PRIORITY_SENDERS_ANY) {
- if (isFirst) {
- return mContext.getString(R.string.zen_mode_all_messages);
- } else {
- return mContext.getString(R.string.zen_mode_all_messages_list);
- }
+ return mContext.getString(R.string.zen_mode_from_anyone);
+ } else if (policy.priorityMessageSenders == Policy.PRIORITY_SENDERS_CONTACTS){
+ return mContext.getString(R.string.zen_mode_from_contacts);
} else {
- if (isFirst) {
- return mContext.getString(R.string.zen_mode_selected_messages);
- } else {
- return mContext.getString(R.string.zen_mode_selected_messages_list);
- }
+ return mContext.getString(R.string.zen_mode_from_starred);
}
} else if (category == Policy.PRIORITY_CATEGORY_EVENTS) {
if (isFirst) {
diff --git a/src/com/android/settings/notification/ZenRulePreference.java b/src/com/android/settings/notification/ZenRulePreference.java
index 48a879b6dfa..10b49eb73dd 100644
--- a/src/com/android/settings/notification/ZenRulePreference.java
+++ b/src/com/android/settings/notification/ZenRulePreference.java
@@ -31,6 +31,7 @@ import androidx.fragment.app.Fragment;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.utils.ManagedServiceSettings;
import com.android.settings.utils.ZenServiceListing;
@@ -122,17 +123,17 @@ public class ZenRulePreference extends TwoTargetPreference {
return mChecked;
}
- public void setChecked(boolean checked) {
- mChecked = checked;
- if (mCheckBox != null) {
- mCheckBox.setChecked(checked);
- }
- }
-
- public void setName(String name) {
- if (!Objects.equals(mName, name)) {
- mName = name;
+ public void updatePreference(AutomaticZenRule rule) {
+ if (!mRule.getName().equals(rule.getName())) {
+ mName = rule.getName();
setTitle(mName);
+ mRule.setName(mName.toString());
+ }
+
+ if (mRule.isEnabled() != rule.isEnabled()) {
+ mRule.setEnabled(rule.isEnabled());
+ setChecked(mRule.isEnabled());
+ setSummary(computeRuleSummary(mRule));
}
}
@@ -141,6 +142,13 @@ public class ZenRulePreference extends TwoTargetPreference {
mOnCheckBoxClickListener.onClick(null);
}
+ private void setChecked(boolean checked) {
+ mChecked = checked;
+ if (mCheckBox != null) {
+ mCheckBox.setChecked(checked);
+ }
+ }
+
private View.OnClickListener mOnCheckBoxClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -159,7 +167,7 @@ public class ZenRulePreference extends TwoTargetPreference {
try {
ApplicationInfo info = mPm.getApplicationInfo(rule.getOwner().getPackageName(), 0);
- setSummary(computeRuleSummary(rule, mIsSystemRule, info.loadLabel(mPm)));
+ setSummary(computeRuleSummary(rule));
} catch (PackageManager.NameNotFoundException e) {
appExists = false;
return;
@@ -179,8 +187,7 @@ public class ZenRulePreference extends TwoTargetPreference {
setKey(mId);
}
- private String computeRuleSummary(AutomaticZenRule rule, boolean isSystemRule,
- CharSequence providerLabel) {
+ private String computeRuleSummary(AutomaticZenRule rule) {
return (rule == null || !rule.isEnabled())
? mContext.getResources().getString(R.string.switch_off_text)
: mContext.getResources().getString(R.string.switch_on_text);
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceControllerTest.java
index 3eae2667973..b431c0a65f2 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeAutomaticRulesPreferenceControllerTest.java
@@ -144,7 +144,7 @@ public class ZenModeAutomaticRulesPreferenceControllerTest {
mockGetAutomaticZenRules(NUM_RULES, rMap);
FieldSetter.setField(mZenRulePreference, ZenRulePreference.class.getDeclaredField("mId"), testId);
mController.updateState(mockPref);
- verify(mZenRulePreference, times(1)).setChecked(false);
+ verify(mZenRulePreference, times(1)).updatePreference(any());
verify(mController, never()).reloadAllRules(any());
}
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModePriorityCallsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModePriorityCallsPreferenceControllerTest.java
index 36a1382d7c6..7131250442e 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModePriorityCallsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModePriorityCallsPreferenceControllerTest.java
@@ -30,6 +30,9 @@ import android.content.ContentResolver;
import android.content.Context;
import android.provider.Settings;
+import androidx.preference.ListPreference;
+import androidx.preference.PreferenceScreen;
+
import com.android.settings.R;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -43,9 +46,6 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.shadows.ShadowApplication;
import org.robolectric.util.ReflectionHelpers;
-import androidx.preference.ListPreference;
-import androidx.preference.PreferenceScreen;
-
@RunWith(SettingsRobolectricTestRunner.class)
public class ZenModePriorityCallsPreferenceControllerTest {
@@ -86,8 +86,8 @@ public class ZenModePriorityCallsPreferenceControllerTest {
when(mBackend.getPriorityCallSenders())
.thenReturn(NotificationManager.Policy.PRIORITY_SENDERS_STARRED);
- when(mBackend.getContactsSummary(ZenModeBackend.SOURCE_NONE))
- .thenCallRealMethod();
+ when(mBackend.getAlarmsTotalSilenceCallsMessagesSummary(
+ NotificationManager.Policy.PRIORITY_CATEGORY_CALLS)).thenCallRealMethod();
when(mBackend.getContactsSummary(NotificationManager.Policy.PRIORITY_CATEGORY_CALLS))
.thenCallRealMethod();
@@ -110,7 +110,7 @@ public class ZenModePriorityCallsPreferenceControllerTest {
mController.updateState(mockPref);
verify(mockPref).setEnabled(false);
- verify(mockPref).setSummary(R.string.zen_mode_from_none);
+ verify(mockPref).setSummary(R.string.zen_mode_from_none_calls);
}
@Test
@@ -121,7 +121,7 @@ public class ZenModePriorityCallsPreferenceControllerTest {
mController.updateState(mockPref);
verify(mockPref).setEnabled(false);
- verify(mockPref).setSummary(R.string.zen_mode_from_none);
+ verify(mockPref).setSummary(R.string.zen_mode_from_none_calls);
}
@Test
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModePriorityMessagesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ZenModePriorityMessagesPreferenceControllerTest.java
index 75605a4d2f0..7b6698dc693 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModePriorityMessagesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModePriorityMessagesPreferenceControllerTest.java
@@ -30,6 +30,9 @@ import android.content.ContentResolver;
import android.content.Context;
import android.provider.Settings;
+import androidx.preference.ListPreference;
+import androidx.preference.PreferenceScreen;
+
import com.android.settings.R;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -43,9 +46,6 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.shadows.ShadowApplication;
import org.robolectric.util.ReflectionHelpers;
-import androidx.preference.ListPreference;
-import androidx.preference.PreferenceScreen;
-
@RunWith(SettingsRobolectricTestRunner.class)
public class ZenModePriorityMessagesPreferenceControllerTest {
@@ -86,8 +86,8 @@ public class ZenModePriorityMessagesPreferenceControllerTest {
when(mBackend.getPriorityMessageSenders())
.thenReturn(NotificationManager.Policy.PRIORITY_SENDERS_STARRED);
- when(mBackend.getContactsSummary(ZenModeBackend.SOURCE_NONE))
- .thenCallRealMethod();
+ when(mBackend.getAlarmsTotalSilenceCallsMessagesSummary(
+ NotificationManager.Policy.PRIORITY_CATEGORY_MESSAGES)).thenCallRealMethod();
when(mBackend.getContactsSummary(NotificationManager.Policy.PRIORITY_CATEGORY_MESSAGES))
.thenCallRealMethod();
@@ -110,7 +110,7 @@ public class ZenModePriorityMessagesPreferenceControllerTest {
mController.updateState(mockPref);
verify(mockPref).setEnabled(false);
- verify(mockPref).setSummary(R.string.zen_mode_from_none);
+ verify(mockPref).setSummary(R.string.zen_mode_from_none_messages);
}
@Test
@@ -121,7 +121,7 @@ public class ZenModePriorityMessagesPreferenceControllerTest {
mController.updateState(mockPref);
verify(mockPref).setEnabled(false);
- verify(mockPref).setSummary(R.string.zen_mode_from_none);
+ verify(mockPref).setSummary(R.string.zen_mode_from_none_messages);
}
@Test
diff --git a/tests/robotests/src/com/android/settings/notification/ZenModeSettingsTest.java b/tests/robotests/src/com/android/settings/notification/ZenModeSettingsTest.java
index 4fc7d57f5fb..53032ac789c 100644
--- a/tests/robotests/src/com/android/settings/notification/ZenModeSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ZenModeSettingsTest.java
@@ -71,20 +71,20 @@ public class ZenModeSettingsTest {
@Test
public void testGetCallsSettingSummary_none() {
Policy policy = new Policy(0, 0, 0, 0);
- assertThat(mBuilder.getCallsSettingSummary(policy)).isEqualTo("None");
+ assertThat(mBuilder.getCallsSettingSummary(policy)).isEqualTo("Don\u2019t allow any calls");
}
@Test
public void testGetCallsSettingSummary_contacts() {
Policy policy = new Policy(Policy.PRIORITY_CATEGORY_ALARMS | Policy.PRIORITY_CATEGORY_CALLS,
Policy.PRIORITY_SENDERS_CONTACTS, 0, 0);
- assertThat(mBuilder.getCallsSettingSummary(policy)).isEqualTo("From contacts");
+ assertThat(mBuilder.getCallsSettingSummary(policy)).isEqualTo("Allow from contacts");
}
@Test
public void testGetCallsSettingSummary_repeatCallers() {
Policy policy = new Policy(Policy.PRIORITY_CATEGORY_REPEAT_CALLERS, 0, 0, 0);
- assertThat(mBuilder.getCallsSettingSummary(policy)).isEqualTo("From repeat callers");
+ assertThat(mBuilder.getCallsSettingSummary(policy)).isEqualTo("Allow from repeat callers");
}
@Test
@@ -93,7 +93,7 @@ public class ZenModeSettingsTest {
Policy.PRIORITY_CATEGORY_REPEAT_CALLERS | Policy.PRIORITY_CATEGORY_CALLS,
Policy.PRIORITY_SENDERS_STARRED, 0, 0);
assertThat(mBuilder.getCallsSettingSummary(policy))
- .isEqualTo("From starred contacts and repeat callers");
+ .isEqualTo("Allow from starred contacts and repeat callers");
}
@Test