Remove duplicate strings.

"Yes" and "no" were redefined many times with no clear benefit, so this
consolidates them into one definition.

Bug: 243843096
Test: Build, install, and open the Settings app
Test: atest SettingsRoboTests
Change-Id: I5f84d09f223efd478461ded93aeac82bf7b128d8
This commit is contained in:
Kweku Adams
2022-08-25 21:23:50 +00:00
parent fb2090e643
commit 5949fccc7a
73 changed files with 118 additions and 246 deletions

View File

@@ -74,7 +74,7 @@ public class AdaptiveConnectivityPreferenceControllerTest {
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 1);
assertThat(mController.getSummary()).isEqualTo(mContext.getString(R.string.switch_on_text));
assertThat(mController.getSummary()).isEqualTo(mContext.getString(R.string.on));
}
@Test
@@ -83,6 +83,6 @@ public class AdaptiveConnectivityPreferenceControllerTest {
Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED, 0);
assertThat(mController.getSummary())
.isEqualTo(mContext.getString(R.string.switch_off_text));
.isEqualTo(mContext.getString(R.string.off));
}
}

View File

@@ -224,7 +224,7 @@ public class PrivateDnsPreferenceControllerTest {
when(lp.getValidatedPrivateDnsServers()).thenReturn(NON_EMPTY_ADDRESS_LIST);
updateLinkProperties(lp);
mController.updateState(mPreference);
verify(mPreference).setSummary(getResourceString(R.string.private_dns_mode_on));
verify(mPreference).setSummary(getResourceString(R.string.on));
reset(mPreference);
lp = mock(LinkProperties.class);

View File

@@ -139,7 +139,7 @@ public class TetherPreferenceControllerTest {
when(mTetheringManager.getTetherableWifiRegexs()).thenReturn(new String[]{"456"});
mController.updateSummary();
verify(mPreference).setSummary(R.string.switch_off_text);
verify(mPreference).setSummary(R.string.off);
}
@Test
@@ -169,7 +169,7 @@ public class TetherPreferenceControllerTest {
ReflectionHelpers.getField(mController, "mAirplaneModeObserver");
observer.onChange(true, Settings.Global.getUriFor(Settings.Global.AIRPLANE_MODE_ON));
verify(mPreference).setSummary(R.string.switch_off_text);
verify(mPreference).setSummary(R.string.off);
}
@Test