Invert STYLUS_BUTTONS_DISABLED to avoid double negatives.

Test: StylusDevicesControllerTest
Bug: 267595764
Change-Id: I9f74aaf064eb08d4abb6800d59ee3c224f9793b8
This commit is contained in:
Vania Januar
2023-02-02 12:13:39 +00:00
parent 59c8e2f89c
commit 7584bbc015
2 changed files with 7 additions and 7 deletions

View File

@@ -140,7 +140,7 @@ public class StylusDevicesController extends AbstractPreferenceController implem
pref.setIcon(R.drawable.ic_block);
pref.setOnPreferenceClickListener(this);
pref.setChecked(Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.STYLUS_BUTTONS_DISABLED, 0) == 1);
Settings.Secure.STYLUS_BUTTONS_ENABLED, 1) == 0);
return pref;
}
@@ -175,8 +175,8 @@ public class StylusDevicesController extends AbstractPreferenceController implem
break;
case KEY_IGNORE_BUTTON:
Settings.Secure.putInt(mContext.getContentResolver(),
Secure.STYLUS_BUTTONS_DISABLED,
((SwitchPreference) preference).isChecked() ? 1 : 0);
Secure.STYLUS_BUTTONS_ENABLED,
((SwitchPreference) preference).isChecked() ? 0 : 1);
break;
}
return true;