diff options
author | sbrissen <sbrissen@hotmail.com> | 2013-06-25 14:48:59 -0400 |
---|---|---|
committer | sbrissen <sbrissen@hotmail.com> | 2013-06-25 14:51:39 -0400 |
commit | 8edc118366badac67985d55e0eaf5fe8b48fd331 (patch) | |
tree | 68655f0383f399f912d9dd5a6f0e08490490a417 | |
parent | 4ad86e37acfce52796fc682db19b7def0d3f70f2 (diff) | |
download | device_samsung_smdk4412-common-8edc118366badac67985d55e0eaf5fe8b48fd331.zip device_samsung_smdk4412-common-8edc118366badac67985d55e0eaf5fe8b48fd331.tar.gz device_samsung_smdk4412-common-8edc118366badac67985d55e0eaf5fe8b48fd331.tar.bz2 |
DeviceSettings: fix enable/disable options that can be overlaid
Change-Id: Id2e1c11b6337bfbb26dc31ca0eb067a89b131a19
3 files changed, 19 insertions, 11 deletions
diff --git a/DeviceSettings/res/values/config.xml b/DeviceSettings/res/values/config.xml index b1bb7fc..a42c049 100644 --- a/DeviceSettings/res/values/config.xml +++ b/DeviceSettings/res/values/config.xml @@ -40,7 +40,7 @@ <string name="incall_min_value" translatable="false">1</string> <string name="audioout_max_value" translatable="false">63</string> <string name="audioout_warning_threshold" translatable="false">60</string> - <string name="audioout_default_value" translatable="false">0</string> + <string name="audioout_default_value" translatable="false">50</string> <string name="audioout_min_value" translatable="false">0</string> </resources> diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/AudioFragmentActivity.java b/DeviceSettings/src/com/cyanogenmod/settings/device/AudioFragmentActivity.java index 807a3b0..f02f53a 100644 --- a/DeviceSettings/src/com/cyanogenmod/settings/device/AudioFragmentActivity.java +++ b/DeviceSettings/src/com/cyanogenmod/settings/device/AudioFragmentActivity.java @@ -42,6 +42,8 @@ public class AudioFragmentActivity extends PreferenceFragment { private static boolean sIncallTuning; private static boolean sAudioOutTuning; + private static boolean mEnableIncall = false; + private static boolean mEnableAudioOut = false; private IncallAudio mIncallTuning; private AudioOut mAudioOutTuning; @@ -56,22 +58,22 @@ public class AudioFragmentActivity extends PreferenceFragment { sIncallTuning = res.getBoolean(R.bool.has_incall_audio_tuning); sAudioOutTuning = res.getBoolean(R.bool.has_output_audio_tuning); + mIncallTuning = (IncallAudio) findPreference(KEY_INCALL_TUNING); + mAudioOutTuning = (AudioOut) findPreference(KEY_AUDIOOUT_TUNING); + if(sIncallTuning){ - mIncallTuning = (IncallAudio) findPreference(KEY_INCALL_TUNING); if(mIncallTuning.isSupported("earpiece") || mIncallTuning.isSupported("headphone") || mIncallTuning.isSupported("speaker") || mIncallTuning.isSupported("bt")) - mIncallTuning.setEnabled(true); - else - mIncallTuning.setEnabled(false); + mEnableIncall = true; } if(sAudioOutTuning){ - mAudioOutTuning = (AudioOut) findPreference(KEY_AUDIOOUT_TUNING); if(mAudioOutTuning.isSupported("headphone") || mAudioOutTuning.isSupported("speaker")) - mAudioOutTuning.setEnabled(true); - else - mAudioOutTuning.setEnabled(false); + mEnableAudioOut = true; } + + mIncallTuning.setEnabled(mEnableIncall); + mAudioOutTuning.setEnabled(mEnableAudioOut); } @Override diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/HapticFragmentActivity.java b/DeviceSettings/src/com/cyanogenmod/settings/device/HapticFragmentActivity.java index f55b59e..039817e 100644 --- a/DeviceSettings/src/com/cyanogenmod/settings/device/HapticFragmentActivity.java +++ b/DeviceSettings/src/com/cyanogenmod/settings/device/HapticFragmentActivity.java @@ -36,6 +36,7 @@ public class HapticFragmentActivity extends PreferenceFragment { public static final String KEY_VIBRATOR_TUNING = "vibrator_tuning"; private static boolean sVibratorTuning; + private static boolean mEnableVibratorTuning = false; private VibratorTuningPreference mVibratorTuning; @Override @@ -47,11 +48,16 @@ public class HapticFragmentActivity extends PreferenceFragment { addPreferencesFromResource(R.xml.haptic_preferences); + mVibratorTuning = (VibratorTuningPreference) findPreference(KEY_VIBRATOR_TUNING); + if (sVibratorTuning) { String vibratorFilePath = res.getString(R.string.vibrator_sysfs_file); - mVibratorTuning = (VibratorTuningPreference) findPreference(KEY_VIBRATOR_TUNING); - mVibratorTuning.setEnabled(VibratorTuningPreference.isSupported(vibratorFilePath)); + if(VibratorTuningPreference.isSupported(vibratorFilePath)){ + mEnableVibratorTuning = true; + } } + + mVibratorTuning.setEnabled(mEnableVibratorTuning); } @Override |