Invert STYLUS_BUTTONS_DISABLED to avoid double negatives.
Test: StylusDevicesControllerTest Bug: 267595764 Change-Id: I9f74aaf064eb08d4abb6800d59ee3c224f9793b8
This commit is contained in:
@@ -364,7 +364,7 @@ public class StylusDevicesControllerTest {
|
||||
@Test
|
||||
public void buttonsPreference_checkedWhenFlagTrue() {
|
||||
Settings.Secure.putInt(mContext.getContentResolver(),
|
||||
Settings.Secure.STYLUS_BUTTONS_DISABLED, 1);
|
||||
Settings.Secure.STYLUS_BUTTONS_ENABLED, 0);
|
||||
|
||||
showScreen(mController);
|
||||
SwitchPreference buttonsPref = (SwitchPreference) mPreferenceContainer.getPreference(2);
|
||||
@@ -375,7 +375,7 @@ public class StylusDevicesControllerTest {
|
||||
@Test
|
||||
public void buttonsPreference_uncheckedWhenFlagFalse() {
|
||||
Settings.Secure.putInt(mContext.getContentResolver(),
|
||||
Settings.Secure.STYLUS_BUTTONS_DISABLED, 0);
|
||||
Settings.Secure.STYLUS_BUTTONS_ENABLED, 1);
|
||||
|
||||
showScreen(mController);
|
||||
SwitchPreference buttonsPref = (SwitchPreference) mPreferenceContainer.getPreference(2);
|
||||
@@ -386,7 +386,7 @@ public class StylusDevicesControllerTest {
|
||||
@Test
|
||||
public void buttonsPreference_updatesFlagOnClick() {
|
||||
Settings.Secure.putInt(mContext.getContentResolver(),
|
||||
Settings.Secure.STYLUS_BUTTONS_DISABLED, 1);
|
||||
Settings.Secure.STYLUS_BUTTONS_ENABLED, 0);
|
||||
showScreen(mController);
|
||||
SwitchPreference buttonsPref = (SwitchPreference) mPreferenceContainer.getPreference(2);
|
||||
|
||||
@@ -394,7 +394,7 @@ public class StylusDevicesControllerTest {
|
||||
|
||||
assertThat(buttonsPref.isChecked()).isEqualTo(false);
|
||||
assertThat(Settings.Secure.getInt(mContext.getContentResolver(),
|
||||
Secure.STYLUS_BUTTONS_DISABLED, -1)).isEqualTo(0);
|
||||
Secure.STYLUS_BUTTONS_ENABLED, -1)).isEqualTo(0);
|
||||
}
|
||||
|
||||
private void showScreen(StylusDevicesController controller) {
|
||||
|
Reference in New Issue
Block a user