summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/ButtonSettings.java
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2015-02-24 14:53:32 -0800
committerAdnan Begovic <adnan@cyngn.com>2015-10-29 17:36:28 -0700
commit45c206d2846e52d4a8c39e5328daf8130ae30445 (patch)
tree96712843fbfb9a3988e9155baccf91bb77a109b6 /src/com/android/settings/ButtonSettings.java
parentc978a553897f8525754fc11cfefbca3196a608dc (diff)
downloadpackages_apps_Settings-45c206d2846e52d4a8c39e5328daf8130ae30445.zip
packages_apps_Settings-45c206d2846e52d4a8c39e5328daf8130ae30445.tar.gz
packages_apps_Settings-45c206d2846e52d4a8c39e5328daf8130ae30445.tar.bz2
Settings: set volume wake dependency in code
It is possible for volume_wake_screen to be removed from the preference list, but volbtn_music_controls has a hard dependency on volume_wake_screen. Let's setup this depenency only if both exist. Signed-off-by: Roman Birg <roman@cyngn.com> Change-Id: I18b2ecc0de36779ebdea3a0d20c1971ce85549cb
Diffstat (limited to 'src/com/android/settings/ButtonSettings.java')
-rw-r--r--src/com/android/settings/ButtonSettings.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/settings/ButtonSettings.java b/src/com/android/settings/ButtonSettings.java
index ee81bcd..d682dc3 100644
--- a/src/com/android/settings/ButtonSettings.java
+++ b/src/com/android/settings/ButtonSettings.java
@@ -70,7 +70,11 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
private static final String KEY_NAVIGATION_RECENTS_LONG_PRESS = "navigation_recents_long_press";
private static final String KEY_POWER_END_CALL = "power_end_call";
private static final String KEY_HOME_ANSWER_CALL = "home_answer_call";
+<<<<<<< HEAD
private static final String KEY_BLUETOOTH_INPUT_SETTINGS = "bluetooth_input_settings";
+=======
+ private static final String KEY_VOLUME_MUSIC_CONTROLS = "volbtn_music_controls";
+>>>>>>> e9fe965... Settings: set volume wake dependency in code
private static final String CATEGORY_POWER = "power_key";
private static final String CATEGORY_HOME = "home_key";
@@ -115,6 +119,8 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
private ListPreference mAppSwitchPressAction;
private ListPreference mAppSwitchLongPressAction;
private ListPreference mVolumeKeyCursorControl;
+ private SwitchPreference mVolumeWakeScreen;
+ private SwitchPreference mVolumeMusicControls;
private SwitchPreference mSwapVolumeButtons;
private SwitchPreference mDisableNavigationKeys;
private SwitchPreference mNavigationBarLeftPref;
@@ -376,6 +382,16 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
Utils.updatePreferenceToSpecificActivityFromMetaDataOrRemove(getActivity(),
getPreferenceScreen(), KEY_BLUETOOTH_INPUT_SETTINGS);
+
+ mVolumeWakeScreen = (SwitchPreference) findPreference(Settings.System.VOLUME_WAKE_SCREEN);
+ mVolumeMusicControls = (SwitchPreference) findPreference(KEY_VOLUME_MUSIC_CONTROLS);
+
+ if (mVolumeWakeScreen != null) {
+ if (mVolumeMusicControls != null) {
+ mVolumeMusicControls.setDependency(Settings.System.VOLUME_WAKE_SCREEN);
+ mVolumeWakeScreen.setDisableDependentsState(true);
+ }
+ }
}
@Override