Update VCardComposer getOwnerPhoneNumberVcard() to support empty vcard for 0.vcf

Add check in getOwnerPhoneNumberVcard(). If the incoming phonenumber is empty,
do not add "TEL" to vcard data.

Original Change by: Yue Lixin
DrNo: Eastham
Bug: 2247067
This commit is contained in:
Jaikumar Ganesh
2009-11-13 11:01:25 -08:00
parent 609bbf182e
commit 4c05ba1fcc

View File

@@ -414,8 +414,10 @@ public class VCardComposer {
appendVCardLine(builder, VCARD_PROPERTY_FULL_NAME, phoneName, needCharset, false);
appendVCardLine(builder, VCARD_PROPERTY_NAME, phoneName, needCharset, false);
String label = Integer.toString(phonetype);
appendVCardTelephoneLine(builder, phonetype, label, phoneNumber);
if (!TextUtils.isEmpty(phoneNumber)) {
String label = Integer.toString(phonetype);
appendVCardTelephoneLine(builder, phonetype, label, phoneNumber);
}
appendVCardLine(builder, VCARD_PROPERTY_END, VCARD_DATA_VCARD);