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

Commit 9fe469b3 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Promotion of android_ui.lnx.2.1-00037.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1088151   I2460fda29a339437c539c73b635ec4bba34e2df2   Fix contact name disappear when update

Change-Id: I0d009a5c0433f90036f86b4afbd437481cb70032
CRs-Fixed: 1088151
parents 91b7aecf d26a7b4a
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ import com.android.contacts.activities.ContactEditorBaseActivity;
import com.android.contacts.common.MoreContactUtils;
import com.android.contacts.common.SimContactsConstants;
import com.android.contacts.common.SimContactsOperation;
import com.android.contacts.common.model.ValuesDelta;
import com.android.contacts.common.model.account.ExchangeAccountType;
import com.android.contacts.common.compat.CompatUtils;
import com.android.contacts.common.database.ContactUpdateUtils;
import com.android.contacts.common.model.AccountTypeManager;
@@ -469,7 +471,9 @@ public class ContactSaveService extends IntentService {
            final String accountType = entity.getValues().getAsString(RawContacts.ACCOUNT_TYPE);
            final String accountName = entity.getValues().getAsString(RawContacts.ACCOUNT_NAME);
            rawContactsList.add(entity.getRawContactId());

            if (accountType != null
                    && ExchangeAccountType.isExchangeType(accountType))
                removeDisplayName(entity);
            final int subscription = MoreContactUtils.getSubscription(
                accountType, accountName);
            isCardOperation = (subscription != SubscriptionManager.INVALID_SUBSCRIPTION_ID) ?
@@ -641,6 +645,14 @@ public class ContactSaveService extends IntentService {
        }
    }

    private void removeDisplayName(RawContactDelta entity) {
        ArrayList<ValuesDelta> names = entity
                .getMimeEntries(StructuredName.CONTENT_ITEM_TYPE);
        if (names != null
                && names.get(0).containsKey(StructuredName.DISPLAY_NAME))
            names.get(0).putNull(StructuredName.DISPLAY_NAME);
    }

    private Integer doSaveToSimCard(RawContactDelta entity, ContentResolver resolver,
            int subscription) {