summaryrefslogtreecommitdiffstats
path: root/location
diff options
context:
space:
mode:
authorDaisuke Miyakawa <dmiyakawa@google.com>2011-06-24 15:42:43 -0700
committerDaisuke Miyakawa <dmiyakawa@google.com>2011-06-27 15:20:46 -0700
commit3746f2d91425e24b23ddf34f2b9afef3f3efc3e2 (patch)
treeeb95e9f894bc409229986da734db0df178e9cc6e /location
parentda1fa1e42fc7fb07d532f464b45d266801c20e73 (diff)
downloadframeworks_base-3746f2d91425e24b23ddf34f2b9afef3f3efc3e2.zip
frameworks_base-3746f2d91425e24b23ddf34f2b9afef3f3efc3e2.tar.gz
frameworks_base-3746f2d91425e24b23ddf34f2b9afef3f3efc3e2.tar.bz2
Use upper case country codes in Country.java
Previously external/libphonenumber accepted lower case country codes (e.g. "us") but now it doesn't for performance reason. Actually ISO 3166-1 doesn't allow lower cases, so we should not rely on them. Need to fix unit tests for PhoneNumberUtils, as it implicitly relies on the previous behavior. See also I3a3e6db84ed0d24290b1be19651fa9a82de4cc39 Bug: 4941319 Change-Id: If16f6531f274a0faf5e28724854409ca9b00a669
Diffstat (limited to 'location')
-rwxr-xr-xlocation/java/android/location/Country.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/location/java/android/location/Country.java b/location/java/android/location/Country.java
index 3c05403..939bd4a 100755
--- a/location/java/android/location/Country.java
+++ b/location/java/android/location/Country.java
@@ -19,6 +19,8 @@ package android.location;
import android.os.Parcel;
import android.os.Parcelable;
+import java.util.Locale;
+
/**
* This class wraps the country information.
*
@@ -74,7 +76,7 @@ public class Country implements Parcelable {
|| source > COUNTRY_SOURCE_LOCALE) {
throw new IllegalArgumentException();
}
- mCountryIso = countryIso.toLowerCase();
+ mCountryIso = countryIso.toUpperCase(Locale.US);
mSource = source;
}