am 577d32a5: am b55e60e1: Fix vCard code.

Merge commit '577d32a57d1b21b40015ac202147e00e8243db63'

* commit '577d32a57d1b21b40015ac202147e00e8243db63':
  Fix vCard code.
This commit is contained in:
Daisuke Miyakawa
2009-09-25 11:09:40 -07:00
committed by Android Git Automerger
2 changed files with 118 additions and 19 deletions

View File

@@ -477,44 +477,148 @@ public class ContactStruct {
mPhotoList = photoList;
mWebsiteList = websiteList;
}
// All getter methods should be used carefully, since they may change
// in the future as of 2009-09-24, on which I cannot be sure this structure
// is completely consolidated.
// When we are sure we will no longer change them, we'll be happy to
// make it complete public (withouth @hide tag)
//
// Also note that these getter methods should be used only after
// all properties being pushed into this object. If not, incorrect
// value will "be stored in the local cache and" be returned to you.
/**
* @hide only for testing.
* @hide
*/
public String getFamilyName() {
return mFamilyName;
}
/**
* @hide
*/
public String getGivenName() {
return mGivenName;
}
/**
* @hide
*/
public String getMiddleName() {
return mMiddleName;
}
/**
* @hide
*/
public String getPrefix() {
return mPrefix;
}
/**
* @hide
*/
public String getSuffix() {
return mSuffix;
}
/**
* @hide
*/
public String getFullName() {
return mFullName;
}
/**
* @hide
*/
public String getPhoneticFamilyName() {
return mPhoneticFamilyName;
}
/**
* @hide
*/
public String getPhoneticGivenName() {
return mPhoneticGivenName;
}
/**
* @hide
*/
public String getPhoneticMiddleName() {
return mPhoneticMiddleName;
}
/**
* @hide
*/
public String getPhoneticFullName() {
return mPhoneticFullName;
}
/**
* @hide
*/
public final List<String> getNickNameList() {
return mNickNameList;
}
/**
* @hide
*/
public String getDisplayName() {
if (mDisplayName == null) {
constructDisplayName();
}
return mDisplayName;
}
/**
* @hide
*/
public String getBirthday() {
return mBirthday;
}
/**
* @hide
*/
public final List<PhotoData> getPhotoList() {
return mPhotoList;
}
/**
* @hide only for testing.
* @hide
*/
public final List<String> getNotes() {
return mNoteList;
}
/**
* @hide only for testing.
* @hide
*/
public final List<PhoneData> getPhoneList() {
return mPhoneList;
}
/**
* @hide only for testing.
* @hide
*/
public final List<EmailData> getEmailList() {
return mEmailList;
}
/**
* @hide only for testing.
* @hide
*/
public final List<PostalData> getPostalList() {
return mPostalList;
}
/**
* @hide only for testing.
* @hide
*/
public final List<OrganizationData> getOrganizationList() {
return mOrganizationList;
@@ -938,13 +1042,6 @@ public class ContactStruct {
// Unknown X- words and IANA token.
}
}
public String getDisplayName() {
if (mDisplayName == null) {
constructDisplayName();
}
return mDisplayName;
}
/**
* Construct the display name. The constructed data must not be null.

View File

@@ -960,10 +960,12 @@ public class VCardComposer {
.get(Phone.CONTENT_ITEM_TYPE);
if (contentValuesList != null) {
for (ContentValues contentValues : contentValuesList) {
appendVCardTelephoneLine(builder, contentValues
.getAsInteger(Phone.TYPE), contentValues
.getAsString(Phone.LABEL), contentValues
.getAsString(Phone.NUMBER));
Integer phoneType = contentValues.getAsInteger(Phone.TYPE);
int phoneTypeAsPrimitive =
(phoneType == null ? Phone.TYPE_HOME : phoneType);
appendVCardTelephoneLine(builder, phoneTypeAsPrimitive,
contentValues.getAsString(Phone.LABEL),
contentValues.getAsString(Phone.NUMBER));
}
} else if (mIsDoCoMo) {
appendVCardTelephoneLine(builder, Phone.TYPE_HOME, "", "");
@@ -1090,7 +1092,7 @@ public class VCardComposer {
private void appendBirthday(final StringBuilder builder,
final Map<String, List<ContentValues>> contentValuesListMap) {
List<ContentValues> contentValuesList = contentValuesListMap
.get(Website.CONTENT_ITEM_TYPE);
.get(Miscellaneous.CONTENT_ITEM_TYPE);
if (contentValuesList != null && contentValuesList.size() > 0) {
// Theoretically, there must be only one birthday for each vCard data and
// we are afraid of some parse error occuring in some devices, so