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

Commit 1e305c23 authored by Roman Birg's avatar Roman Birg
Browse files

Contacts: place local contacts in a special local account



Local contacts should be stored in a special account (not the default
one, which has null values for the name, type, and dataset) so that they
are not being taken over by external contact sync services.

Change-Id: Ib7b18d09e32ad3fffaca5edb925602b27a209151
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent bdef2b1e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -666,6 +666,13 @@ public class ContactEditorFragment extends Fragment implements
     * @param account may be null to signal a device-local contact should be created.
     */
    private void createContact(AccountWithDataSet account) {
        if (account == null) {
            // local account!
            String localAccountName = mContext.getString(
                    com.android.contacts.common.R.string.local_storage_account);
            account = new AccountWithDataSet(localAccountName, AccountType.LOCAL_ACCOUNT, null);
        }

        final AccountTypeManager accountTypes = AccountTypeManager.getInstance(mContext);
        final AccountType accountType =
                accountTypes.getAccountType(account != null ? account.type : null,