diff options
author | Ayaz Ahmad <aahmad@codeaurora.org> | 2013-09-02 12:17:33 +0530 |
---|---|---|
committer | Ayaz Ahmad <aahmad@codeaurora.org> | 2013-09-02 17:49:58 +0530 |
commit | d97a0bba5b2b4f07c6cbc33aa644aa3d99e73339 (patch) | |
tree | f6a46800921d64a5581ac50c832d06a86638cbfd | |
parent | 15ddfeb22142016dceee6c71386e261902b545b7 (diff) | |
download | android_hardware_qcom_fm-d97a0bba5b2b4f07c6cbc33aa644aa3d99e73339.tar.gz android_hardware_qcom_fm-d97a0bba5b2b4f07c6cbc33aa644aa3d99e73339.tar.bz2 android_hardware_qcom_fm-d97a0bba5b2b4f07c6cbc33aa644aa3d99e73339.zip |
fm: Fix the issue FM app does not display audio mode
FM app does not display stereo or mono audio output mode
after tuning to a station as fm app does not set proper audio
preference mode. Save the audio output preference entered by
user and the set the saved mode.
CRs-Fixed: 525975
Change-Id: I4b71291a731578f217443d27d111ced93dd7ec90
-rw-r--r-- | fmapp2/src/com/caf/fmradio/FMRadio.java | 3 | ||||
-rw-r--r-- | fmapp2/src/com/caf/fmradio/FMRadioService.java | 2 | ||||
-rw-r--r-- | fmapp2/src/com/caf/fmradio/FmSharedPreferences.java | 11 | ||||
-rw-r--r-- | fmapp2/src/com/caf/fmradio/Settings.java | 1 |
4 files changed, 15 insertions, 2 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java index c33bbbd..335ce4f 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadio.java +++ b/fmapp2/src/com/caf/fmradio/FMRadio.java @@ -532,6 +532,7 @@ public class FMRadio extends Activity if (station != null) { mTunedStation.Copy(station); } + mStereo = FmSharedPreferences.getLastAudioMode(); mHandler.post(mUpdateProgramService); mHandler.post(mUpdateRadioText); mHandler.post(mOnStereo); @@ -2593,6 +2594,7 @@ public class FMRadio extends Activity }else { mStereoTV.setText(""); } + FmSharedPreferences.setLastAudioMode(mStereo); } }; @@ -2954,6 +2956,7 @@ public class FMRadio extends Activity } cleanupTimeoutHandler(); mHandler.post(mUpdateStationInfo); + mHandler.post(mOnStereo); } public void onProgramServiceChanged() { diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java index 5dfe72d..53423bd 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadioService.java +++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java @@ -2500,7 +2500,7 @@ public class FMRadioService extends Service } /* Update the frequency in the StatusBar's Notification */ startNotification(); - + enableStereo(FmSharedPreferences.getAudioOutputMode()); } catch (RemoteException e) { diff --git a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java index 53e43f7..bf8119a 100644 --- a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java +++ b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java @@ -137,7 +137,6 @@ public class FmSharedPreferences private static final String LAST_RECORD_DURATION = "last_record_duration"; private static String LAST_AF_JUMP_VALUE = "last_af_jump_value"; private static final String AUDIO_OUTPUT_MODE = "audio_output_mode"; - private static Map<String, String> mNameMap = new HashMap<String, String>(); private static List<PresetList> mListOfPlists = new ArrayList<PresetList>(); public static Set[] tagList = new TreeSet[FmSharedPreferences.MAX_NUM_TAG_TYPES]; @@ -166,6 +165,7 @@ public class FmSharedPreferences private static boolean mAudioOutputMode = true; private static boolean mAFAutoSwitch = true; private static int mRecordDuration = 0; + private static int mLastAudioMode = -1; FmSharedPreferences(Context context){ mContext = context.getApplicationContext(); @@ -449,6 +449,7 @@ public class FmSharedPreferences mTunedFrequency = sp.getInt(PREF_LAST_TUNED_FREQUENCY, DEFAULT_NO_FREQUENCY); mRecordDuration = sp.getInt(LAST_RECORD_DURATION, RECORD_DUR_INDEX_0_VAL); mAFAutoSwitch = sp.getBoolean(LAST_AF_JUMP_VALUE, true); + mAudioOutputMode = sp.getBoolean(AUDIO_OUTPUT_MODE, true); if(sp.getInt(FMCONFIG_COUNTRY, 0) == REGIONAL_BAND_USER_DEFINED) { mBandMinFreq = sp.getInt(FMCONFIG_MIN, mBandMinFreq); @@ -556,6 +557,7 @@ public class FmSharedPreferences } ed.putInt(LAST_RECORD_DURATION, mRecordDuration); ed.putBoolean(LAST_AF_JUMP_VALUE, mAFAutoSwitch); + ed.putBoolean(AUDIO_OUTPUT_MODE, mAudioOutputMode); ed.commit(); } @@ -1119,6 +1121,13 @@ public class FmSharedPreferences return mAudioOutputMode; } + public static int getLastAudioMode() { + return mLastAudioMode; + } + + public static void setLastAudioMode(int audiomode) { + mLastAudioMode = audiomode; + } public static void setRecordDuration(int durationIndex) { Log.d(LOGTAG, "setRecordDuration "+durationIndex); diff --git a/fmapp2/src/com/caf/fmradio/Settings.java b/fmapp2/src/com/caf/fmradio/Settings.java index c5683f1..5d35619 100644 --- a/fmapp2/src/com/caf/fmradio/Settings.java +++ b/fmapp2/src/com/caf/fmradio/Settings.java @@ -374,6 +374,7 @@ public class Settings extends PreferenceActivity implements // Mono FmSharedPreferences.setAudioOutputMode(false); } + mPrefs.Save(); FMRadio.fmAudioOutputMode(); } } |