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

Commit 0ae4a933 authored by Walter Jang's avatar Walter Jang
Browse files

Don't prune read only contacts in SaveService for joins and splits

Bug 27108237

Change-Id: I717717a3c8b55315dcf3dde026af4c267f62e709
parent cf0734b5
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);