diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2010-05-13 14:50:16 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2010-05-13 14:50:16 -0700 |
commit | b1110149cccc3b99e59ead34ca46e5ac026f6db9 (patch) | |
tree | 53f282b539ba34e787cc11eeab7b7b829c0145a5 /telephony | |
parent | a3d5549c802bc4fbf1e1ca05bc3552db17212036 (diff) | |
parent | b79781af1ebc68dbaa1b44da43fd391de067a201 (diff) | |
download | frameworks_base-b1110149cccc3b99e59ead34ca46e5ac026f6db9.zip frameworks_base-b1110149cccc3b99e59ead34ca46e5ac026f6db9.tar.gz frameworks_base-b1110149cccc3b99e59ead34ca46e5ac026f6db9.tar.bz2 |
merge from open-source master
Change-Id: I88a580162b34a80d1e3e7987b7a301c253afa0e8
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/PhoneNumberUtils.java | 3 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index 32e7176..a60d2be 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -732,7 +732,8 @@ public class PhoneNumberUtils return ""; } - if ((bytes[offset] & 0xff) == TOA_International) { + //Only TON field should be taken in consideration + if ((bytes[offset] & 0xf0) == (TOA_International & 0xf0)) { prependPlus = true; } diff --git a/telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java b/telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java index 02590d3..dd2cb08 100644 --- a/telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java +++ b/telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java @@ -82,6 +82,16 @@ public class PhoneNumberUtilsTest extends TestCase { assertEquals("17005550020", PhoneNumberUtils.calledPartyBCDToString(b, 0, 7)); + b[0] = (byte) 0x80; b[1] = (byte) 0x71; b[2] = (byte) 0x00; b[3] = (byte) 0x55; + b[4] = (byte) 0x05; b[5] = (byte) 0x20; b[6] = (byte) 0xF0; + assertEquals("17005550020", + PhoneNumberUtils.calledPartyBCDToString(b, 0, 7)); + + b[0] = (byte) 0x90; b[1] = (byte) 0x71; b[2] = (byte) 0x00; b[3] = (byte) 0x55; + b[4] = (byte) 0x05; b[5] = (byte) 0x20; b[6] = (byte) 0xF0; + assertEquals("+17005550020", + PhoneNumberUtils.calledPartyBCDToString(b, 0, 7)); + b[0] = (byte) 0x91; b[1] = (byte) 0x71; b[2] = (byte) 0x00; b[3] = (byte) 0x55; b[4] = (byte) 0x05; b[5] = (byte) 0x20; b[6] = (byte) 0xF0; assertEquals("+17005550020", |