summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2010-05-13 14:56:02 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-05-13 14:56:02 -0700
commite28776bbd72397eea0dd24f5c28273fb2bf1a2f0 (patch)
treeb89399e174fa0d02011f98def0cb612d8c1dcc0b /telephony
parent5a9cbb291fa7505a6c51eba6f600009dfc17366d (diff)
parentb1110149cccc3b99e59ead34ca46e5ac026f6db9 (diff)
downloadframeworks_base-e28776bbd72397eea0dd24f5c28273fb2bf1a2f0.zip
frameworks_base-e28776bbd72397eea0dd24f5c28273fb2bf1a2f0.tar.gz
frameworks_base-e28776bbd72397eea0dd24f5c28273fb2bf1a2f0.tar.bz2
am b1110149: merge from open-source master
Merge commit 'b1110149cccc3b99e59ead34ca46e5ac026f6db9' into kraken * commit 'b1110149cccc3b99e59ead34ca46e5ac026f6db9': Use integer for loop counter instead of float New test in FrameworkTest for the VelocityTracker class Preserve '+' in phone numbers imported from SIM.
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/PhoneNumberUtils.java3
-rw-r--r--telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java10
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 b456a03..a74c5c2 100644
--- a/telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java
+++ b/telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java
@@ -85,6 +85,16 @@ public class PhoneNumberUtilsTest extends AndroidTestCase {
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",