Enable controllers to use a custom key.

Test: atest SettingsUnitTests
Test: m -j45 RunSettingsRoboTests
Bug: 191763369
Change-Id: I48eea95613600580c80c8850f0a3fd543a7e0a43
This commit is contained in:
Jan Tomljanovic
2021-06-25 01:45:30 +01:00
parent 37b1831d0d
commit c6667337ca
18 changed files with 171 additions and 27 deletions

View File

@@ -89,4 +89,16 @@ public class ScreenPinningPreferenceControllerTest {
assertThat(mPreference.getSummary())
.isEqualTo(mContext.getString(R.string.switch_on_text));
}
@Test
public void getPreferenceKey_byDefault_returnsDefaultValue() {
assertThat(mController.getPreferenceKey()).isEqualTo("screen_pinning_settings");
}
@Test
public void getPreferenceKey_whenGivenValue_returnsGivenValue() {
mController = new ScreenPinningPreferenceController(mContext, "key");
assertThat(mController.getPreferenceKey()).isEqualTo("key");
}
}