summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Kessler <activethrasher00@gmail.com>2015-02-18 10:24:25 +0200
committerMichael Bestas <mikeioannina@gmail.com>2015-12-19 04:49:37 +0200
commitc7c9553dc9f535bf947ac676b618dd5ec81cd8a2 (patch)
tree4e6dd045f777df7b285e46cfd0e2b8d6e5c921e8
parent429a4e6a0f1cb4f703af476737743d9e138f1ae0 (diff)
downloadpackages_apps_Settings-c7c9553dc9f535bf947ac676b618dd5ec81cd8a2.tar.gz
packages_apps_Settings-c7c9553dc9f535bf947ac676b618dd5ec81cd8a2.tar.bz2
packages_apps_Settings-c7c9553dc9f535bf947ac676b618dd5ec81cd8a2.zip
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
-rw-r--r--res/values/cm_strings.xml1
-rw-r--r--res/xml/power_menu_settings.xml5
-rw-r--r--src/com/android/settings/cyanogenmod/PowerMenuActions.java15
3 files changed, 2 insertions, 19 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 364295c2e..e38cf9c8e 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -430,7 +430,6 @@
<!-- Power menu -->
<string name="power_menu_title">Power menu</string>
- <string name="power_menu_power_title">Power off</string>
<string name="power_menu_reboot_title">Reboot menu</string>
<string name="power_menu_screenshot_title">Screenshot</string>
<string name="power_menu_profiles_title">Profile switcher</string>
diff --git a/res/xml/power_menu_settings.xml b/res/xml/power_menu_settings.xml
index e29d9e1cf..ae707d104 100644
--- a/res/xml/power_menu_settings.xml
+++ b/res/xml/power_menu_settings.xml
@@ -20,11 +20,6 @@
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<CheckBoxPreference
- android:key="power"
- android:title="@string/power_menu_power_title"
- android:defaultValue="true" />
-
- <CheckBoxPreference
android:key="reboot"
android:title="@string/power_menu_reboot_title"
android:defaultValue="true" />
diff --git a/src/com/android/settings/cyanogenmod/PowerMenuActions.java b/src/com/android/settings/cyanogenmod/PowerMenuActions.java
index 527929dc7..50f98ccd6 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);