diff options
author | Dave Kessler <activethrasher00@gmail.com> | 2015-02-18 10:24:25 +0200 |
---|---|---|
committer | Michael Bestas <mikeioannina@gmail.com> | 2015-12-19 04:49:37 +0200 |
commit | c7c9553dc9f535bf947ac676b618dd5ec81cd8a2 (patch) | |
tree | 4e6dd045f777df7b285e46cfd0e2b8d6e5c921e8 /src/com/android/settings/cyanogenmod | |
parent | 429a4e6a0f1cb4f703af476737743d9e138f1ae0 (diff) | |
download | packages_apps_Settings-c7c9553dc9f535bf947ac676b618dd5ec81cd8a2.zip packages_apps_Settings-c7c9553dc9f535bf947ac676b618dd5ec81cd8a2.tar.gz packages_apps_Settings-c7c9553dc9f535bf947ac676b618dd5ec81cd8a2.tar.bz2 |
Power Menu: remove power as an option
This is the only way to power the device off. Also, if the user
toggles all the options off an empty dialog will open. Lets make
this feature a little more user-friendly and remove power as an
optional entry.
Change-Id: I10b2d7c844fa40ae9583d3114ec99b0825c21cd9
Diffstat (limited to 'src/com/android/settings/cyanogenmod')
-rw-r--r-- | src/com/android/settings/cyanogenmod/PowerMenuActions.java | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/com/android/settings/cyanogenmod/PowerMenuActions.java b/src/com/android/settings/cyanogenmod/PowerMenuActions.java index 527929d..50f98cc 100644 --- a/src/com/android/settings/cyanogenmod/PowerMenuActions.java +++ b/src/com/android/settings/cyanogenmod/PowerMenuActions.java @@ -46,7 +46,6 @@ import java.util.List; public class PowerMenuActions extends SettingsPreferenceFragment { final static String TAG = "PowerMenuActions"; - private CheckBoxPreference mPowerPref; private CheckBoxPreference mRebootPref; private CheckBoxPreference mScreenshotPref; private CheckBoxPreference mProfilePref; @@ -82,9 +81,7 @@ public class PowerMenuActions extends SettingsPreferenceFragment { continue; } - if (action.equals(GLOBAL_ACTION_KEY_POWER)) { - mPowerPref = (CheckBoxPreference) findPreference(GLOBAL_ACTION_KEY_POWER); - } else if (action.equals(GLOBAL_ACTION_KEY_REBOOT)) { + if (action.equals(GLOBAL_ACTION_KEY_REBOOT)) { mRebootPref = (CheckBoxPreference) findPreference(GLOBAL_ACTION_KEY_REBOOT); } else if (action.equals(GLOBAL_ACTION_KEY_SCREENSHOT)) { mScreenshotPref = (CheckBoxPreference) findPreference(GLOBAL_ACTION_KEY_SCREENSHOT); @@ -119,10 +116,6 @@ public class PowerMenuActions extends SettingsPreferenceFragment { public void onStart() { super.onStart(); - if (mPowerPref != null) { - mPowerPref.setChecked(settingsArrayContains(GLOBAL_ACTION_KEY_POWER)); - } - if (mRebootPref != null) { mRebootPref.setChecked(settingsArrayContains(GLOBAL_ACTION_KEY_REBOOT)); } @@ -184,11 +177,7 @@ public class PowerMenuActions extends SettingsPreferenceFragment { public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { boolean value; - if (preference == mPowerPref) { - value = mPowerPref.isChecked(); - updateUserConfig(value, GLOBAL_ACTION_KEY_POWER); - - } else if (preference == mRebootPref) { + if (preference == mRebootPref) { value = mRebootPref.isChecked(); updateUserConfig(value, GLOBAL_ACTION_KEY_REBOOT); |