Settings: Battery saver settings sub-page.
New battery saver settings page, accessed via the power usage settings overflow menu. The settings page has a master switch to toggle battery saver mode, feature disclosure text, and a preference to configure the automatic trigger level. Remove developer checkbox now that this option has a real home. NO_SQ: multi project change Bug:13329308 Change-Id: Iac54238f3406439711b44a3c17f220ac5e370a37
This commit is contained in:
@@ -122,7 +122,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
private static final String USE_NUPLAYER_KEY = "use_nuplayer";
|
||||
private static final String USE_NUPLAYER_PROPERTY = "persist.sys.media.use-nuplayer";
|
||||
private static final String SHOW_CPU_USAGE_KEY = "show_cpu_usage";
|
||||
private static final String LOW_POWER_MODE_KEY = "low_power_mode";
|
||||
private static final String FORCE_HARDWARE_UI_KEY = "force_hw_ui";
|
||||
private static final String FORCE_MSAA_KEY = "force_msaa";
|
||||
private static final String TRACK_FRAME_TIME_KEY = "track_frame_time";
|
||||
@@ -196,7 +195,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
private CheckBoxPreference mShowScreenUpdates;
|
||||
private CheckBoxPreference mDisableOverlays;
|
||||
private CheckBoxPreference mShowCpuUsage;
|
||||
private CheckBoxPreference mLowPowerMode;
|
||||
private CheckBoxPreference mForceHardwareUi;
|
||||
private CheckBoxPreference mForceMsaa;
|
||||
private CheckBoxPreference mShowHwScreenUpdates;
|
||||
@@ -308,7 +306,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
mShowScreenUpdates = findAndInitCheckboxPref(SHOW_SCREEN_UPDATES_KEY);
|
||||
mDisableOverlays = findAndInitCheckboxPref(DISABLE_OVERLAYS_KEY);
|
||||
mShowCpuUsage = findAndInitCheckboxPref(SHOW_CPU_USAGE_KEY);
|
||||
mLowPowerMode = findAndInitCheckboxPref(LOW_POWER_MODE_KEY);
|
||||
mForceHardwareUi = findAndInitCheckboxPref(FORCE_HARDWARE_UI_KEY);
|
||||
mForceMsaa = findAndInitCheckboxPref(FORCE_MSAA_KEY);
|
||||
mTrackFrameTime = addListPreference(TRACK_FRAME_TIME_KEY);
|
||||
@@ -504,7 +501,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
updateShowTouchesOptions();
|
||||
updateFlingerOptions();
|
||||
updateCpuUsageOptions();
|
||||
updateLowPowerModeOptions();
|
||||
updateHardwareUiOptions();
|
||||
updateMsaaOptions();
|
||||
updateTrackFrameTimeOptions();
|
||||
@@ -1040,22 +1036,11 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
mWifiManager.enableVerboseLogging(mWifiVerboseLogging.isChecked() ? 1 : 0);
|
||||
}
|
||||
|
||||
private void updateLowPowerModeOptions() {
|
||||
updateCheckBox(mLowPowerMode, Settings.Global.getInt(getActivity().getContentResolver(),
|
||||
Settings.Global.LOW_POWER_MODE, 0) != 0);
|
||||
}
|
||||
|
||||
private void updateCpuUsageOptions() {
|
||||
updateCheckBox(mShowCpuUsage, Settings.Global.getInt(getActivity().getContentResolver(),
|
||||
Settings.Global.SHOW_PROCESSES, 0) != 0);
|
||||
}
|
||||
|
||||
private void writeLowPowerModeOptions() {
|
||||
boolean value = mLowPowerMode.isChecked();
|
||||
Settings.Global.putInt(getActivity().getContentResolver(),
|
||||
Settings.Global.LOW_POWER_MODE, value ? 1 : 0);
|
||||
}
|
||||
|
||||
private void writeCpuUsageOptions() {
|
||||
boolean value = mShowCpuUsage.isChecked();
|
||||
Settings.Global.putInt(getActivity().getContentResolver(),
|
||||
@@ -1332,8 +1317,6 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
writeShowUpdatesOption();
|
||||
} else if (preference == mDisableOverlays) {
|
||||
writeDisableOverlaysOption();
|
||||
} else if (preference == mLowPowerMode) {
|
||||
writeLowPowerModeOptions();
|
||||
} else if (preference == mShowCpuUsage) {
|
||||
writeCpuUsageOptions();
|
||||
} else if (preference == mImmediatelyDestroyActivities) {
|
||||
|
Reference in New Issue
Block a user