public void readFromParcel(Parcel source) { final ClassLoader loader = getClass().getClassLoader(); final int size = source.readInt(); mValues = source.<ValuesDelta> readParcelable(loader); mContactsQueryUri = source.<Uri> readParcelable(loader); for (int i = 0; i < size; i++) { final ValuesDelta child = source.<ValuesDelta> readParcelable(loader); this.addEntry(child); } }
/** * Insert a new child of kind {@link DataKind} into the given * {@link RawContactDelta}, marked with the given {@link EditType}. */ public static ValuesDelta insertChild(RawContactDelta state, DataKind kind, EditType type) { // Bail early if invalid kind if (kind == null) return null; final ContentValues after = new ContentValues(); // Our parent CONTACT_ID is provided later after.put(Data.MIMETYPE, kind.mimeType); // Fill-in with any requested default values if (kind.defaultValues != null) { after.putAll(kind.defaultValues); } if (kind.typeColumn != null && type != null) { // Set type, if provided after.put(kind.typeColumn, type.rawValue); } final ValuesDelta child = ValuesDelta.fromAfter(after); state.addEntry(child); return child; }
newState.addEntry(ValuesDelta.fromAfter(values)); } else {
/** @hide Public only for testing. */ public static void migrateGenericWithoutTypeColumn( RawContactDelta oldState, RawContactDelta newState, DataKind newDataKind) { final ArrayList<ValuesDelta> mimeEntries = ensureEntryMaxSize(newState, newDataKind, oldState.getMimeEntries(newDataKind.mimeType)); if (mimeEntries == null || mimeEntries.isEmpty()) { return; } for (ValuesDelta entry : mimeEntries) { ContentValues values = entry.getAfter(); if (values != null) { newState.addEntry(ValuesDelta.fromAfter(values)); } } }
ContentValues values = entry.getAfter(); if (values != null) { newState.addEntry(ValuesDelta.fromAfter(values));
/** * 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; }
newState.addEntry(ValuesDelta.fromAfter(values)); totalCount++;
newState.addEntry(ValuesDelta.fromAfter(values));
local.addEntry(merged);
newState.addEntry(ValuesDelta.fromAfter(values));