diff options
author | Edward Wang <ewang@cyngn.com> | 2015-04-09 17:22:50 -0700 |
---|---|---|
committer | Matt Wagantall <mwagantall@cyngn.com> | 2016-02-19 14:07:44 -0800 |
commit | ae7d8f71276ad27319efe9030c0a1f381802cd13 (patch) | |
tree | 8552595630c6149b61db3d884ebfdb535528c138 | |
parent | 755c888c46e72bd7f41da5085be9a9699283bcf5 (diff) | |
download | android_hardware_qcom_fm-ae7d8f71276ad27319efe9030c0a1f381802cd13.tar.gz android_hardware_qcom_fm-ae7d8f71276ad27319efe9030c0a1f381802cd13.tar.bz2 android_hardware_qcom_fm-ae7d8f71276ad27319efe9030c0a1f381802cd13.zip |
FM: always use overlay default country
Change-Id: I2acbbde684e7581124577f6e929397279d97cb41
(cherry picked from commit 087fb5a9128f8a9d96289815b1ae4be2ea98981a)
-rw-r--r-- | fmapp2/src/com/caf/fmradio/FmSharedPreferences.java | 8 | ||||
-rw-r--r-- | fmapp2/src/com/caf/fmradio/Settings.java | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java index e581a81..cc5ccbf 100644 --- a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java +++ b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java @@ -171,6 +171,8 @@ public class FmSharedPreferences private static int mLastAudioMode = -1; private static boolean mSpecialCarrierFlag = false; + public static int mDefaultCountryIndex = REGIONAL_BAND_NORTH_AMERICA; + FmSharedPreferences(Context context){ mContext = context.getApplicationContext(); mFMConfiguration = new FmConfig(); @@ -507,8 +509,8 @@ public class FmSharedPreferences .getBoolean(R.bool.def_fm_country_location_enabled)) { setCountry(sp.getInt(FMCONFIG_COUNTRY, REGIONAL_BAND_INDIA)); } else { - int defaultIndex = mContext.getResources().getInteger(R.integer.default_country_index); - setCountry(sp.getInt(FMCONFIG_COUNTRY, defaultIndex)); + mDefaultCountryIndex = mContext.getResources().getInteger(R.integer.default_country_index); + setCountry(sp.getInt(FMCONFIG_COUNTRY, mDefaultCountryIndex)); } /* Last list the user was navigating */ mListIndex = sp.getInt(LAST_LIST_INDEX, 0); @@ -582,7 +584,7 @@ public class FmSharedPreferences setCountry(REGIONAL_BAND_CHINA); //Others set north America. } else { - setCountry(REGIONAL_BAND_NORTH_AMERICA); + setCountry(mDefaultCountryIndex); } } diff --git a/fmapp2/src/com/caf/fmradio/Settings.java b/fmapp2/src/com/caf/fmradio/Settings.java index 36d6985..0897ad4 100644 --- a/fmapp2/src/com/caf/fmradio/Settings.java +++ b/fmapp2/src/com/caf/fmradio/Settings.java @@ -494,8 +494,7 @@ public class Settings extends PreferenceActivity implements mBandPreference .setValueIndex(FmSharedPreferences.REGIONAL_BAND_CHINA); }else { - mBandPreference - .setValueIndex(FmSharedPreferences.REGIONAL_BAND_NORTH_AMERICA); + mBandPreference.setValueIndex(FmSharedPreferences.mDefaultCountryIndex); } if (mRxMode) { mAudioPreference.setValueIndex(0); @@ -509,8 +508,7 @@ public class Settings extends PreferenceActivity implements FmSharedPreferences .setCountry(FmSharedPreferences.REGIONAL_BAND_CHINA); }else{ - FmSharedPreferences - .setCountry(FmSharedPreferences.REGIONAL_BAND_NORTH_AMERICA); + FmSharedPreferences.setCountry(FmSharedPreferences.mDefaultCountryIndex); } } mPrefs.Save(); |