summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Wang <ewang@cyngn.com>2015-04-09 17:22:50 -0700
committerHoward Harte <hharte@cyngn.com>2015-04-10 22:19:45 +0000
commitd71550fd2deaba38ad3a030166f8086af7f6d5a3 (patch)
tree2ed553ba08411f605d0f92bac0d91577237e70a5
parentd40fbaaa73dab092ed2191b7bf61ccbf0f257b57 (diff)
downloadandroid_hardware_qcom_fm-d71550fd2deaba38ad3a030166f8086af7f6d5a3.tar.gz
android_hardware_qcom_fm-d71550fd2deaba38ad3a030166f8086af7f6d5a3.tar.bz2
android_hardware_qcom_fm-d71550fd2deaba38ad3a030166f8086af7f6d5a3.zip
FM: always use overlay default country
Change-Id: I2acbbde684e7581124577f6e929397279d97cb41
-rw-r--r--fmapp2/src/com/caf/fmradio/FmSharedPreferences.java8
-rw-r--r--fmapp2/src/com/caf/fmradio/Settings.java6
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 3302daf..4028455 100644
--- a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
+++ b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
@@ -169,6 +169,8 @@ public class FmSharedPreferences
private static int mRecordDuration = 0;
private static int mLastAudioMode = -1;
+ public static int mDefaultCountryIndex = REGIONAL_BAND_NORTH_AMERICA;
+
FmSharedPreferences(Context context){
mContext = context.getApplicationContext();
mFMConfiguration = new FmConfig();
@@ -500,8 +502,8 @@ public class FmSharedPreferences
if (Locale.getDefault().equals(Locale.CHINA)) {
setCountry(sp.getInt(FMCONFIG_COUNTRY, REGIONAL_BAND_CHINA));
} 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);
@@ -575,7 +577,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 dbea490..08f9ea7 100644
--- a/fmapp2/src/com/caf/fmradio/Settings.java
+++ b/fmapp2/src/com/caf/fmradio/Settings.java
@@ -479,8 +479,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);
@@ -494,8 +493,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();