Merge "FM: Fix default band is incorrect when language is chinese"
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.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 @@
          }
       }
       /* 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 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) {
diff --git a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
index bf8119a..1bed45c 100644
--- a/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
+++ b/fmapp2/src/com/caf/fmradio/FmSharedPreferences.java
@@ -32,6 +32,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.ListIterator;
+import java.util.Locale;
 import java.util.Map;
 
 import android.content.Context;
@@ -495,7 +496,11 @@
          }
       }
       /* 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)
@@ -564,13 +569,12 @@
    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) {