mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
Fixed Issue 140: Contact.displayName is not being set correctly
This commit is contained in:
parent
28b01fe494
commit
3895570edd
@ -264,16 +264,18 @@ public class ContactAccessorSdk5 extends ContactAccessor {
|
|||||||
newContact = false;
|
newContact = false;
|
||||||
contact.put("id", contactId);
|
contact.put("id", contactId);
|
||||||
contact.put("rawId", rawId);
|
contact.put("rawId", rawId);
|
||||||
contact.put("displayName", c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Grab the mimetype of the current row as it will be used in a lot of comparisons
|
// Grab the mimetype of the current row as it will be used in a lot of comparisons
|
||||||
mimetype = c.getString(c.getColumnIndex(ContactsContract.Data.MIMETYPE));
|
mimetype = c.getString(c.getColumnIndex(ContactsContract.Data.MIMETYPE));
|
||||||
|
|
||||||
if (mimetype.equals(ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
|
if (mimetype.equals(ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)) {
|
||||||
&& isRequired("name",populate)) {
|
contact.put("displayName", c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME)));
|
||||||
contact.put("name", nameQuery(c));
|
}
|
||||||
}
|
if (mimetype.equals(ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
|
||||||
|
&& isRequired("name",populate)) {
|
||||||
|
contact.put("name", nameQuery(c));
|
||||||
|
}
|
||||||
else if (mimetype.equals(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)
|
else if (mimetype.equals(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)
|
||||||
&& isRequired("phoneNumbers",populate)) {
|
&& isRequired("phoneNumbers",populate)) {
|
||||||
phones.put(phoneQuery(c));
|
phones.put(phoneQuery(c));
|
||||||
|
Loading…
Reference in New Issue
Block a user