Update DND strings

Fixes: 120497233
Bug: 111475013
Test: manually flash and check strings
Test: make RunSettingsRoboTests -j40
Change-Id: I0a8971226a485f8ec41d83c167e51dac1a9c8107
This commit is contained in:
Beverly
2018-12-05 12:33:02 -05:00
parent c4be214f47
commit fdebb9632b
16 changed files with 131 additions and 141 deletions

View File

@@ -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());
}

View File

@@ -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

View File

@@ -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

View File

@@ -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