summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Greenwalt <>2009-04-13 18:35:04 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-13 18:35:04 -0700
commit0e1c45fd8ba86e295c1b118fd3d4a1bc4b143dec (patch)
tree0accb9ba1392d04a99bdfb551ad2448ed4c41ec0
parente4b6b7e2f65fdc5c09f70704625fd08f3c05a7e5 (diff)
downloadframeworks_base-0e1c45fd8ba86e295c1b118fd3d4a1bc4b143dec.zip
frameworks_base-0e1c45fd8ba86e295c1b118fd3d4a1bc4b143dec.tar.gz
frameworks_base-0e1c45fd8ba86e295c1b118fd3d4a1bc4b143dec.tar.bz2
AI 145995: am: CL 145993 Fix Phone-oriented default-locale selection.
When several locales for a given language are available we were always selecting the first. Original author: rgreenwalt Merged from: //branches/cupcake/... Automated import of CL 145995
-rw-r--r--telephony/java/com/android/internal/telephony/PhoneBase.java12
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 259de62..20c54fb 100644
--- a/telephony/java/com/android/internal/telephony/PhoneBase.java
+++ b/telephony/java/com/android/internal/telephony/PhoneBase.java
@@ -491,7 +491,7 @@ public abstract class PhoneBase implements Phone {
return; // no match possible
}
language.toLowerCase();
- if (null != country) {
+ if (null == country) {
country = "";
}
country = country.toUpperCase();
@@ -505,10 +505,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];
}
@@ -517,7 +518,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));