Fix a bug in show surface updates

- fix a bug that caused the master switch to unintentionally turn on
 the show surface updates preference

Bug: 34203528
Test: make RunSettingsRoboTests -j40
Change-Id: I307a801aa1a7c1606b3f5d55a0d1f2dbf1d60416
This commit is contained in:
jeffreyhuang
2017-09-28 18:08:47 -07:00
parent ae6c29d10f
commit 6da6ea878f
2 changed files with 19 additions and 3 deletions

View File

@@ -86,8 +86,12 @@ public class ShowSurfaceUpdatesPreferenceController extends DeveloperOptionsPref
@Override
protected void onDeveloperOptionsSwitchDisabled() {
writeShowUpdatesSetting(false);
mPreference.setChecked(false);
if (mPreference.isChecked()) {
// Writing false to the preference when the setting is already off will have a
// side effect of turning on the preference that we wish to avoid
writeShowUpdatesSetting(false);
mPreference.setChecked(false);
}
mPreference.setEnabled(false);
}