diff options
author | fuzz <fuzzzzzzzzzzzzzzzzzz@gmail.com> | 2013-06-09 12:56:45 +0900 |
---|---|---|
committer | fuzz <fuzzzzzzzzzzzzzzzzzz@gmail.com> | 2013-06-14 05:56:52 +0900 |
commit | 2c54e018b6d609563b174f78e9c7295f1869b70d (patch) | |
tree | e1e40c57f2eb563cc34d3b90d422b55618c81cd7 /src | |
parent | 7dae958adefd8f4a7594a74f8e05f1e3449e6cc6 (diff) | |
download | packages_apps_settings-2c54e018b6d609563b174f78e9c7295f1869b70d.zip packages_apps_settings-2c54e018b6d609563b174f78e9c7295f1869b70d.tar.gz packages_apps_settings-2c54e018b6d609563b174f78e9c7295f1869b70d.tar.bz2 |
Fix up remove Wakeup preferences
Follow the bug fix addressed in http://review.cyanogenmod.org/#/c/43544/
This fix the issue both Home key wake and Volume rocker wake preferences will be displayed
if either of them activated in device config.
If both of them are not activated it looks fine because eventually Wakeup category
itself removed,though.
Change-Id: I28b7b45d209c3beb9559ed9e7b89612bf8df8bab
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/DisplaySettings.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java index 986091d..2e9085a 100644 --- a/src/com/android/settings/DisplaySettings.java +++ b/src/com/android/settings/DisplaySettings.java @@ -148,12 +148,13 @@ public class DisplaySettings extends SettingsPreferenceFragment implements // Start the wake-up category handling boolean removeWakeupCategory = true; - + PreferenceCategory wakeupCategory = (PreferenceCategory) + findPreference(KEY_WAKEUP_CATEGORY); // Home button wake mHomeWake = (CheckBoxPreference) findPreference(KEY_HOME_WAKE); if (mHomeWake != null) { if (!getResources().getBoolean(R.bool.config_show_homeWake)) { - getPreferenceScreen().removePreference(mHomeWake); + wakeupCategory.removePreference(mHomeWake); } else { mHomeWake.setChecked(Settings.System.getInt(resolver, Settings.System.HOME_WAKE_SCREEN, 1) == 1); @@ -166,7 +167,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements if (mVolumeWake != null) { if (!getResources().getBoolean(R.bool.config_show_volumeRockerWake) || !Utils.hasVolumeRocker(getActivity())) { - getPreferenceScreen().removePreference(mVolumeWake); + wakeupCategory.removePreference(mVolumeWake); } else { mVolumeWake.setChecked(Settings.System.getInt(resolver, Settings.System.VOLUME_WAKE_SCREEN, 0) == 1); @@ -176,12 +177,11 @@ public class DisplaySettings extends SettingsPreferenceFragment implements // Remove the wake-up category if neither of the two items above are enabled if (removeWakeupCategory) { - getPreferenceScreen().removePreference( - (PreferenceCategory) findPreference(KEY_WAKEUP_CATEGORY)); + getPreferenceScreen().removePreference(wakeupCategory); } mScreenOffAnimation = (CheckBoxPreference) findPreference(KEY_SCREEN_OFF_ANIMATION); - if(getResources().getBoolean(com.android.internal.R.bool.config_screenOffAnimation)) { + if (getResources().getBoolean(com.android.internal.R.bool.config_screenOffAnimation)) { mScreenOffAnimation.setChecked(Settings.System.getInt(resolver, Settings.System.SCREEN_OFF_ANIMATION, 1) == 1); } else { |