diff options
author | Libin Tang <Libin.Tang@motorola.com> | 2009-08-18 13:22:47 -0500 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2009-08-21 10:26:58 -0700 |
commit | 7850cdde66705152b859aafda875833acdda9653 (patch) | |
tree | 0a6d7b850cfd1ff8c92bb09e9737a3605eec0234 /tests/CoreTests | |
parent | 41ceb907b5d13ee58759022ac8d830b04686baba (diff) | |
download | frameworks_base-7850cdde66705152b859aafda875833acdda9653.zip frameworks_base-7850cdde66705152b859aafda875833acdda9653.tar.gz frameworks_base-7850cdde66705152b859aafda875833acdda9653.tar.bz2 |
Fix +NANP issue and cleanup plus code conversion.
This patch includes the plus code conversion clean up.
1. change the plus code conversion based on the current and default
number systems retrieved from MCC.
2. for format such as +NANP, replace the '+' with the current IDP (011).
3. comments changes.
Diffstat (limited to 'tests/CoreTests')
-rw-r--r-- | tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java b/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java index 466b555..7426d33 100644 --- a/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java +++ b/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java @@ -338,7 +338,7 @@ public class PhoneNumberUtilsTest extends TestCase { @SmallTest public void testCheckAndProcessPlusCode() { - assertEquals("8475797000", + assertEquals("0118475797000", PhoneNumberUtils.cdmaCheckAndProcessPlusCode("+8475797000")); assertEquals("18475797000", PhoneNumberUtils.cdmaCheckAndProcessPlusCode("+18475797000")); @@ -350,18 +350,18 @@ public class PhoneNumberUtilsTest extends TestCase { PhoneNumberUtils.cdmaCheckAndProcessPlusCode("+11875767800")); assertEquals("8475797000,18475231753", PhoneNumberUtils.cdmaCheckAndProcessPlusCode("8475797000,+18475231753")); - assertEquals("8475797000,18475231753", + assertEquals("0118475797000,18475231753", PhoneNumberUtils.cdmaCheckAndProcessPlusCode("+8475797000,+18475231753")); - assertEquals("8475797000;8475231753", - PhoneNumberUtils.cdmaCheckAndProcessPlusCode("8475797000;+8475231753")); + assertEquals("8475797000;0118469312345", + PhoneNumberUtils.cdmaCheckAndProcessPlusCode("8475797000;+8469312345")); assertEquals("8475797000,0111234567", PhoneNumberUtils.cdmaCheckAndProcessPlusCode("8475797000,+1234567")); assertEquals("847597000;01111875767000", PhoneNumberUtils.cdmaCheckAndProcessPlusCode("847597000;+11875767000")); - assertEquals("8475797000,,8475231753", - PhoneNumberUtils.cdmaCheckAndProcessPlusCode("8475797000,,+8475231753")); - assertEquals("8475797000;,8475231753", - PhoneNumberUtils.cdmaCheckAndProcessPlusCode("8475797000;,+8475231753")); + assertEquals("8475797000,,0118469312345", + PhoneNumberUtils.cdmaCheckAndProcessPlusCode("8475797000,,+8469312345")); + assertEquals("8475797000;,0118469312345", + PhoneNumberUtils.cdmaCheckAndProcessPlusCode("8475797000;,+8469312345")); assertEquals("8475797000,;18475231753", PhoneNumberUtils.cdmaCheckAndProcessPlusCode("8475797000,;+18475231753")); assertEquals("8475797000;,01111875767000", @@ -391,17 +391,20 @@ public class PhoneNumberUtilsTest extends TestCase { @SmallTest public void testCheckAndProcessPlusCodeByNumberFormat() { - assertEquals("+8475797000", - PhoneNumberUtils.cdmaCheckAndProcessPlusCodeByNumberFormat("+8475797000", - PhoneNumberUtils.FORMAT_JAPAN)); - assertEquals("+0384756700", - PhoneNumberUtils.cdmaCheckAndProcessPlusCodeByNumberFormat("+0384756700", - PhoneNumberUtils.FORMAT_JAPAN)); - assertEquals("+1234567", - PhoneNumberUtils.cdmaCheckAndProcessPlusCodeByNumberFormat("+1234567", - PhoneNumberUtils.FORMAT_UNKNOWN)); - assertEquals("+23456700000", - PhoneNumberUtils.cdmaCheckAndProcessPlusCodeByNumberFormat("+23456700000", - PhoneNumberUtils.FORMAT_UNKNOWN)); + assertEquals("18475797000", + PhoneNumberUtils.cdmaCheckAndProcessPlusCodeByNumberFormat("+18475797000", + PhoneNumberUtils.FORMAT_NANP,PhoneNumberUtils.FORMAT_NANP)); + assertEquals("+18475797000", + PhoneNumberUtils.cdmaCheckAndProcessPlusCodeByNumberFormat("+18475797000", + PhoneNumberUtils.FORMAT_NANP,PhoneNumberUtils.FORMAT_JAPAN)); + assertEquals("+18475797000", + PhoneNumberUtils.cdmaCheckAndProcessPlusCodeByNumberFormat("+18475797000", + PhoneNumberUtils.FORMAT_NANP,PhoneNumberUtils.FORMAT_UNKNOWN)); + assertEquals("+18475797000", + PhoneNumberUtils.cdmaCheckAndProcessPlusCodeByNumberFormat("+18475797000", + PhoneNumberUtils.FORMAT_JAPAN,PhoneNumberUtils.FORMAT_JAPAN)); + assertEquals("+18475797000", + PhoneNumberUtils.cdmaCheckAndProcessPlusCodeByNumberFormat("+18475797000", + PhoneNumberUtils.FORMAT_UNKNOWN,PhoneNumberUtils.FORMAT_UNKNOWN)); } } |