summaryrefslogtreecommitdiffstats
path: root/telephony/tests
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 /telephony/tests
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 'telephony/tests')
-rw-r--r--telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
index c4a6f53..6e9d0f9d 100644
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
+++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
@@ -502,16 +502,17 @@ public class PhoneNumberUtilsTest extends AndroidTestCase {
@SmallTest
public void testFormatNumberToE164() {
- assertEquals("+16502910000", PhoneNumberUtils.formatNumberToE164("650 2910000", "us"));
- assertNull(PhoneNumberUtils.formatNumberToE164("1234567", "us"));
- assertEquals("+18004664114", PhoneNumberUtils.formatNumberToE164("800-GOOG-114", "us"));
+ // Note: ISO 3166-1 only allows upper case country codes.
+ assertEquals("+16502910000", PhoneNumberUtils.formatNumberToE164("650 2910000", "US"));
+ assertNull(PhoneNumberUtils.formatNumberToE164("1234567", "US"));
+ assertEquals("+18004664114", PhoneNumberUtils.formatNumberToE164("800-GOOG-114", "US"));
}
@SmallTest
public void testFormatNumber() {
- assertEquals("(650) 291-0000", PhoneNumberUtils.formatNumber("650 2910000", "us"));
- assertEquals("123-4567", PhoneNumberUtils.formatNumber("1234567", "us"));
- assertEquals("(800) 466-4114", PhoneNumberUtils.formatNumber("800-GOOG-114", "us"));
+ assertEquals("(650) 291-0000", PhoneNumberUtils.formatNumber("650 2910000", "US"));
+ assertEquals("123-4567", PhoneNumberUtils.formatNumber("1234567", "US"));
+ assertEquals("(800) 466-4114", PhoneNumberUtils.formatNumber("800-GOOG-114", "US"));
}