Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b320c749 authored by Walter Jang's avatar Walter Jang Committed by Android (Google) Code Review
Browse files

Merge "Don't prune read only contacts in SaveService for joins and splits" into nyc-dev

parents 3fd45f07 0ae4a933
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ import com.android.contacts.common.model.account.AccountType;
import com.android.contacts.common.model.account.AccountWithDataSet;
import com.android.contacts.common.util.PermissionsUtil;
import com.android.contacts.compat.PinnedPositionsCompat;
import com.android.contacts.activities.ContactEditorBaseActivity.ContactEditor.SaveMode;
import com.android.contacts.util.ContactPhotoUtils;

import com.google.common.collect.Lists;
@@ -374,10 +375,14 @@ public class ContactSaveService extends IntentService {
            String saveModeExtraKey, int saveMode, boolean isProfile,
            Class<? extends Activity> callbackActivity, String callbackAction,
            Bundle updatedPhotos, String joinContactIdExtraKey, Long joinContactId) {

        // Don't pass read-only RawContactDeltas in RawContactDeltaList to contact save service,
        // because 1. read-only RawContactDeltas are not writable anyway; 2. read-only
        // RawContactDeltas may be problematic, see b/23896510.
        // Except when we must create aggregation exceptions between the raw contacts
        if (!(saveMode == SaveMode.JOIN || saveMode == SaveMode.SPLIT)) {
            removeReadOnlyContacts(context, state);
        }

        Intent serviceIntent = new Intent(context, ContactSaveService.class);
        serviceIntent.setAction(ContactSaveService.ACTION_SAVE_CONTACT);