From f304f7b836d88bd381a07c4995e4bf8f5949482b Mon Sep 17 00:00:00 2001 From: Venkateshwarlu Domakonda Date: Thu, 5 Sep 2013 18:49:33 +0530 Subject: 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 --- .../com/codeaurora/fmradio/FmSharedPreferences.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'fmapp') 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) { -- cgit v1.2.3