summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/DevelopmentSettings.java
diff options
context:
space:
mode:
authorRuchi Kandoi <kandoiruchi@google.com>2014-04-17 17:54:35 -0700
committerRuchi Kandoi <kandoiruchi@google.com>2014-04-22 20:55:19 +0000
commit0b1f3fb2c9e7f15a1c28544c42e4a83e24a38515 (patch)
tree14df0b4d272bdad4841138b5303f102a62e181e6 /src/com/android/settings/DevelopmentSettings.java
parent6f3a760dad34ca7a8078c7596ea5148f6e307514 (diff)
downloadpackages_apps_Settings-0b1f3fb2c9e7f15a1c28544c42e4a83e24a38515.tar.gz
packages_apps_Settings-0b1f3fb2c9e7f15a1c28544c42e4a83e24a38515.tar.bz2
packages_apps_Settings-0b1f3fb2c9e7f15a1c28544c42e4a83e24a38515.zip
Setting: Developer Option: Adds a low power mode checkbox
Change-Id: I489f74bd3822f64acb8becd6e5eda716d8bd722c Signed-off-by: Ruchi Kandoi<kandoiruchi@google.com>
Diffstat (limited to 'src/com/android/settings/DevelopmentSettings.java')
-rw-r--r--src/com/android/settings/DevelopmentSettings.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index 76776cd12..bbee5e92e 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -118,6 +118,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
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";
@@ -184,6 +185,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
private CheckBoxPreference mShowScreenUpdates;
private CheckBoxPreference mDisableOverlays;
private CheckBoxPreference mShowCpuUsage;
+ private CheckBoxPreference mLowPowerMode;
private CheckBoxPreference mForceHardwareUi;
private CheckBoxPreference mForceMsaa;
private CheckBoxPreference mShowHwScreenUpdates;
@@ -293,6 +295,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
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);
@@ -497,6 +500,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
updateShowTouchesOptions();
updateFlingerOptions();
updateCpuUsageOptions();
+ updateLowPowerModeOptions();
updateHardwareUiOptions();
updateMsaaOptions();
updateTrackFrameTimeOptions();
@@ -1021,11 +1025,22 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mWifiDisplayCertification.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(),
@@ -1286,6 +1301,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
writeShowUpdatesOption();
} else if (preference == mDisableOverlays) {
writeDisableOverlaysOption();
+ } else if (preference == mLowPowerMode) {
+ writeLowPowerModeOptions();
} else if (preference == mShowCpuUsage) {
writeCpuUsageOptions();
} else if (preference == mImmediatelyDestroyActivities) {