Merge "Refactor power menu bug reporting flow to work for multiple admins"

This commit is contained in:
Nikhil Kumar
2023-01-18 07:56:03 +00:00
committed by Android (Google) Code Review
3 changed files with 25 additions and 23 deletions

View File

@@ -59,7 +59,7 @@ public class BugReportInPowerPreferenceController extends
public boolean onPreferenceChange(Preference preference, Object newValue) {
final boolean isEnabled = (Boolean) newValue;
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Global.BUGREPORT_IN_POWER_MENU,
Settings.Secure.BUGREPORT_IN_POWER_MENU,
isEnabled ? SETTING_VALUE_ON : SETTING_VALUE_OFF);
return true;
}
@@ -67,7 +67,7 @@ public class BugReportInPowerPreferenceController extends
@Override
public void updateState(Preference preference) {
final int mode = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Global.BUGREPORT_IN_POWER_MENU, SETTING_VALUE_OFF);
Settings.Secure.BUGREPORT_IN_POWER_MENU, SETTING_VALUE_OFF);
((SwitchPreference) mPreference).setChecked(mode != SETTING_VALUE_OFF);
}
@@ -75,7 +75,7 @@ public class BugReportInPowerPreferenceController extends
protected void onDeveloperOptionsSwitchDisabled() {
super.onDeveloperOptionsSwitchDisabled();
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Global.BUGREPORT_IN_POWER_MENU, SETTING_VALUE_OFF);
Settings.Secure.BUGREPORT_IN_POWER_MENU, SETTING_VALUE_OFF);
((SwitchPreference) mPreference).setChecked(false);
}
}