Merge "Fix a bug in show surface updates"

This commit is contained in:
Jeffrey Huang
2017-09-29 20:48:57 +00:00
committed by Android (Google) Code Review
2 changed files with 19 additions and 3 deletions

View File

@@ -81,8 +81,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);
}