Update new string for One-Handed feature

According One-handed mode string review doc to change strings.

Bug: 151993111

Test: manual
Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings
.gestures.OneHandedTimeoutPreferenceControllerTest"

Change-Id: I7dc961387c1e14b25438e051ce6b1cc70fb59417
This commit is contained in:
Jason Chang
2020-05-15 19:27:44 +08:00
parent 123bcc41c9
commit cc35ece032
3 changed files with 31 additions and 18 deletions

View File

@@ -83,7 +83,7 @@ public class OneHandedTimeoutPreferenceControllerTest {
}
@Test
public void getSummary_setTimeout_shouldReturnSummary() {
public void getSummary_setTimeoutNever_shouldReturnNeverSummary() {
final String[] timeoutTitles = mContext.getResources().getStringArray(
R.array.one_handed_timeout_title);
@@ -92,11 +92,18 @@ public class OneHandedTimeoutPreferenceControllerTest {
assertThat(mController.getSummary()).isEqualTo(
timeoutTitles[OneHandedSettingsUtils.OneHandedTimeout.NEVER.ordinal()]);
}
@Test
public void getSummary_setTimeoutShort_shouldReturnShortSummary() {
final String[] timeoutTitles = mContext.getResources().getStringArray(
R.array.one_handed_timeout_title);
OneHandedSettingsUtils.setSettingsOneHandedModeTimeout(mContext,
OneHandedSettingsUtils.OneHandedTimeout.SHORT.getValue());
assertThat(mController.getSummary()).isEqualTo(
timeoutTitles[OneHandedSettingsUtils.OneHandedTimeout.SHORT.ordinal()]);
assertThat(mController.getSummary()).isEqualTo(String.format(
mContext.getResources().getString(R.string.one_handed_timeout_summary),
timeoutTitles[OneHandedSettingsUtils.OneHandedTimeout.SHORT.ordinal()]));
}
}