summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDaisuke Miyakawa <dmiyakawa@google.com>2009-10-28 23:33:07 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-10-28 23:33:07 -0700
commit33728557540d9033ff396f7a2ddd4fb304fdedcd (patch)
tree57e5f2d5c209c159e316d23f2fcf02c236bf74d1 /core
parentaa06a0e086d57ad3a0d063dfb5ab2cfb7936e4b4 (diff)
parentd95a02c2a652ffe35dcc0336a3e35d91b1027d54 (diff)
downloadframeworks_base-33728557540d9033ff396f7a2ddd4fb304fdedcd.zip
frameworks_base-33728557540d9033ff396f7a2ddd4fb304fdedcd.tar.gz
frameworks_base-33728557540d9033ff396f7a2ddd4fb304fdedcd.tar.bz2
am d95a02c2: Fix test breakage in Zaku. Modification to PhoneNumberUtils included.
Merge commit 'd95a02c2a652ffe35dcc0336a3e35d91b1027d54' into eclair-mr2-plus-aosp * commit 'd95a02c2a652ffe35dcc0336a3e35d91b1027d54': Fix test breakage in Zaku. Modification to PhoneNumberUtils included.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/pim/vcard/ContactStruct.java22
1 files changed, 5 insertions, 17 deletions
diff --git a/core/java/android/pim/vcard/ContactStruct.java b/core/java/android/pim/vcard/ContactStruct.java
index 9d40db6..4069729 100644
--- a/core/java/android/pim/vcard/ContactStruct.java
+++ b/core/java/android/pim/vcard/ContactStruct.java
@@ -480,23 +480,11 @@ public class ContactStruct {
}
}
- final String formattedPhoneNumber;
- {
- final String rawPhoneNumber = builder.toString();
- if (VCardConfig.isJapaneseDevice(mVCardType)) {
- // As of 2009-10-07, there's no formatNumber() which accepts
- // the second argument and returns String directly.
- final SpannableStringBuilder tmpBuilder =
- new SpannableStringBuilder(rawPhoneNumber);
- PhoneNumberUtils.formatNumber(tmpBuilder, PhoneNumberUtils.FORMAT_JAPAN);
- formattedPhoneNumber = tmpBuilder.toString();
- } else {
- // There's no information available on vCard side. Depend on the default
- // behavior, which may cause problem in the future when the additional format
- // rule is supported (e.g. PhoneNumberUtils.FORMAT_KLINGON)
- formattedPhoneNumber = PhoneNumberUtils.formatNumber(rawPhoneNumber);
- }
- }
+ // Use NANP in default when there's no information about locale.
+ final int formattingType = (VCardConfig.isJapaneseDevice(mVCardType) ?
+ PhoneNumberUtils.FORMAT_JAPAN : PhoneNumberUtils.FORMAT_NANP);
+ final String formattedPhoneNumber =
+ PhoneNumberUtils.formatNumber(builder.toString(), formattingType);
PhoneData phoneData = new PhoneData(type, formattedPhoneNumber, label, isPrimary);
mPhoneList.add(phoneData);
}