diff options
author | Robert Greenwalt <> | 2009-04-13 16:11:29 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-13 16:11:29 -0700 |
commit | 836054473c5329759cd298214516fe3648c58bd2 (patch) | |
tree | 6aecc8d9d68b1165f88e3dc759baeaf6485fd2d0 | |
parent | 5320e896e235564321daaa5d9f0a540cf2ca44c4 (diff) | |
download | frameworks_base-836054473c5329759cd298214516fe3648c58bd2.zip frameworks_base-836054473c5329759cd298214516fe3648c58bd2.tar.gz frameworks_base-836054473c5329759cd298214516fe3648c58bd2.tar.bz2 |
AI 145993: Fix Phone-oriented default-locale selection.
When several locales for a given language are available we were always
selecting the first.
BUG=1785986
Automated import of CL 145993
-rw-r--r-- | telephony/java/com/android/internal/telephony/PhoneBase.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/telephony/java/com/android/internal/telephony/PhoneBase.java b/telephony/java/com/android/internal/telephony/PhoneBase.java index 4fb5f61..3571f02 100644 --- a/telephony/java/com/android/internal/telephony/PhoneBase.java +++ b/telephony/java/com/android/internal/telephony/PhoneBase.java @@ -360,7 +360,7 @@ public abstract class PhoneBase implements Phone { return; // no match possible } language.toLowerCase(); - if (null != country) { + if (null == country) { country = ""; } country = country.toUpperCase(); @@ -374,10 +374,11 @@ public abstract class PhoneBase implements Phone { for(int i = 0; i < N; i++) { if (locales[i]!=null && locales[i].length() >= 2 && locales[i].substring(0,2).equals(language)) { - if (locales[i].length() >= 5 && - locales[i].substring(3,5).equals(country)) { - bestMatch = locales[i]; - break; + if (locales[i].length() >= 5) { + if (locales[i].substring(3,5).equals(country)) { + bestMatch = locales[i]; + break; + } } else if (null == bestMatch) { bestMatch = locales[i]; } @@ -386,7 +387,6 @@ public abstract class PhoneBase implements Phone { if (null != bestMatch) { IActivityManager am = ActivityManagerNative.getDefault(); Configuration config = am.getConfiguration(); - if (bestMatch.length() >= 5) { config.locale = new Locale(bestMatch.substring(0,2), bestMatch.substring(3,5)); |