From 8edc118366badac67985d55e0eaf5fe8b48fd331 Mon Sep 17 00:00:00 2001 From: sbrissen Date: Tue, 25 Jun 2013 14:48:59 -0400 Subject: DeviceSettings: fix enable/disable options that can be overlaid Change-Id: Id2e1c11b6337bfbb26dc31ca0eb067a89b131a19 --- .../settings/device/AudioFragmentActivity.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'DeviceSettings/src/com/cyanogenmod/settings/device/AudioFragmentActivity.java') 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 -- cgit v1.2.3