public void buildOwnershipUpdate( CapsuleOwnership ownership, boolean withYield, CapsuleContract.SyncStateAction syncAction) { // Build the URI Uri uri = CapsuleOperations.appendDirtyQueryParam( syncAction, ContentUris.withAppendedId( CapsuleContract.Ownerships.CONTENT_URI, ownership.getOwnershipId())); // Build the UPDATE operation ContentProviderOperation.Builder builder = ContentProviderOperation.newUpdate(uri); builder.withValues(Ownerships.buildContentValues(ownership)); builder.withYieldAllowed(withYield); // Add it to the collection this.mOperations.add(builder.build()); }
public void buildOwnershipUpdate( CapsuleOwnership ownership, boolean withYield, int capsuleIdBackRefIndex, CapsuleContract.SyncStateAction syncAction) { // Build the URI Uri uri = CapsuleOperations.appendDirtyQueryParam( syncAction, ContentUris.withAppendedId( CapsuleContract.Ownerships.CONTENT_URI, ownership.getOwnershipId())); // Build the UPDATE operation ContentProviderOperation.Builder builder = ContentProviderOperation.newUpdate(uri); builder.withValues(Ownerships.buildContentValues(ownership)); builder.withYieldAllowed(withYield); // Add the back value reference index for the Capsule ID if (capsuleIdBackRefIndex >= 0) { builder.withValueBackReference(CapsuleContract.Ownerships.CAPSULE_ID, capsuleIdBackRefIndex); } // Add it to the collection this.mOperations.add(builder.build()); }