public ArrayList<ContentValues> getContentValues() { if (mRawContacts.size() != 1) { throw new IllegalStateException( "Cannot extract content values from an aggregated contact"); } RawContact rawContact = mRawContacts.get(0); ArrayList<ContentValues> result = rawContact.getContentValues(); // If the photo was loaded using the URI, create an entry for the photo // binary data. if (mPhotoId == 0 && mPhotoBinaryData != null) { ContentValues photo = new ContentValues(); photo.put(Data.MIMETYPE, Photo.CONTENT_ITEM_TYPE); photo.put(Photo.PHOTO, mPhotoBinaryData); result.add(photo); } return result; }
/** * Build an {@link RawContactDelta} using the given {@link RawContact} as a * starting point; the "before" snapshot. */ public static RawContactDelta fromBefore(RawContact before) { final RawContactDelta rawContactDelta = new RawContactDelta(); rawContactDelta.mValues = ValuesDelta.fromBefore(before.getValues()); rawContactDelta.mValues.setIdColumn(RawContacts._ID); for (final ContentValues values : before.getContentValues()) { rawContactDelta.addEntry(ValuesDelta.fromBefore(values)); } return rawContactDelta; }