summaryrefslogtreecommitdiffstats
path: root/fmapp
diff options
context:
space:
mode:
authorVenkateshwarlu Domakonda <Venkateshwarlu@codeaurora.org>2013-09-05 18:49:33 +0530
committerVenkateshwarlu Domakonda <Venkateshwarlu@codeaurora.org>2013-09-06 14:51:07 +0530
commitf304f7b836d88bd381a07c4995e4bf8f5949482b (patch)
treea0bb90df42c69252ea76fd9bc453278fe1499e47 /fmapp
parentb0880e7472611a74c9f5df1a9e8176d2b76f984c (diff)
downloadandroid_hardware_qcom_fm-f304f7b836d88bd381a07c4995e4bf8f5949482b.tar.gz
android_hardware_qcom_fm-f304f7b836d88bd381a07c4995e4bf8f5949482b.tar.bz2
android_hardware_qcom_fm-f304f7b836d88bd381a07c4995e4bf8f5949482b.zip
FM: Fix default band is incorrect when language is chinese
- The default regional band shows north America not Chinese when reset. - If locale is China, set the default regional band to Chinese. Change-Id: I0f152c88df8a7748b95c4b0d0ea63a44496d6f6a CRs-Fixed: 496817
Diffstat (limited to 'fmapp')
-rw-r--r--fmapp/src/com/codeaurora/fmradio/FmSharedPreferences.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/fmapp/src/com/codeaurora/fmradio/FmSharedPreferences.java b/fmapp/src/com/codeaurora/fmradio/FmSharedPreferences.java
index 247969c..7fcb6a5 100644
--- a/fmapp/src/com/codeaurora/fmradio/FmSharedPreferences.java
+++ b/fmapp/src/com/codeaurora/fmradio/FmSharedPreferences.java
@@ -32,6 +32,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.ListIterator;
+import java.util.Locale;
import java.util.Map;
import android.content.Context;
@@ -497,7 +498,11 @@ public class FmSharedPreferences
}
}
/* Load Configuration */
- setCountry(sp.getInt(FMCONFIG_COUNTRY, 0));
+ if (Locale.getDefault().equals(Locale.CHINA)) {
+ setCountry(sp.getInt(FMCONFIG_COUNTRY, REGIONAL_BAND_CHINA));
+ } else {
+ setCountry(sp.getInt(FMCONFIG_COUNTRY, REGIONAL_BAND_NORTH_AMERICA));
+ }
/* Last list the user was navigating */
mListIndex = sp.getInt(LAST_LIST_INDEX, 0);
if(mListIndex >= num_lists)
@@ -565,13 +570,12 @@ public class FmSharedPreferences
public static void SetDefaults() {
mListIndex=0;
mListOfPlists.clear();
- setCountry(REGIONAL_BAND_NORTH_AMERICA);
- setRadioBand(0);
- setChSpacing(0);
- setEmphasis(0);
- setRdsStd(0);
- mFMConfiguration.setLowerLimit(87500);
- mFMConfiguration.setUpperLimit(107900);
+ if (Locale.getDefault().equals(Locale.CHINA)){
+ setCountry(REGIONAL_BAND_CHINA);
+ //Others set north America.
+ } else {
+ setCountry(REGIONAL_BAND_NORTH_AMERICA);
+ }
}
public static void removeStationList(int listIndex) {