diff options
author | Matt Garnes <matt@cyngn.com> | 2015-06-15 15:15:14 -0700 |
---|---|---|
committer | Rohit Yengisetty <rohit@cyngn.com> | 2015-11-17 22:27:12 -0800 |
commit | 89ce716e5d4aecc26a8f96b756643f171d0a518e (patch) | |
tree | 52934feff150f19e186bd339c30c7f434fb6aa8b /src | |
parent | d07aa8ac37dab56bf5042f731e16f5acbc14ea8b (diff) | |
download | packages_apps_ContactsCommon-89ce716e5d4aecc26a8f96b756643f171d0a518e.tar.gz packages_apps_ContactsCommon-89ce716e5d4aecc26a8f96b756643f171d0a518e.tar.bz2 packages_apps_ContactsCommon-89ce716e5d4aecc26a8f96b756643f171d0a518e.zip |
Add local phone account as a writable AccountTypes.
Previously, the local account can be used to create contacts but not groups. Fix this by ensuring
that the local account is added as a contact writable account as well as a group writable account.
Change-Id: Ia4e0a8abca42d12a708a9e56a181fd3677e56aba
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/contacts/common/model/AccountTypeManager.java | 6 | ||||
-rw-r--r-- | src/com/android/contacts/common/util/AccountsListAdapter.java | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/contacts/common/model/AccountTypeManager.java b/src/com/android/contacts/common/model/AccountTypeManager.java index 64af2102..1b1eb038 100644 --- a/src/com/android/contacts/common/model/AccountTypeManager.java +++ b/src/com/android/contacts/common/model/AccountTypeManager.java @@ -465,6 +465,12 @@ class AccountTypeManagerImpl extends AccountTypeManager AccountType localAccountType = new PhoneAccountType(mContext, mContext.getPackageName()); addAccountType(localAccountType, accountTypesByTypeAndDataSet, accountTypesByType); + AccountWithDataSet localAccountWithDataSet = new AccountWithDataSet( + PhoneAccountType.ACCOUNT_NAME, PhoneAccountType.ACCOUNT_TYPE, null); + allAccounts.add(localAccountWithDataSet); + contactWritableAccounts.add(localAccountWithDataSet); + groupWritableAccounts.add(localAccountWithDataSet); + // If any extension packages were specified, process them as well. if (!extensionPackages.isEmpty()) { Log.d(TAG, "Registering " + extensionPackages.size() + " extension packages"); diff --git a/src/com/android/contacts/common/util/AccountsListAdapter.java b/src/com/android/contacts/common/util/AccountsListAdapter.java index e3ff36c9..e4f551b7 100644 --- a/src/com/android/contacts/common/util/AccountsListAdapter.java +++ b/src/com/android/contacts/common/util/AccountsListAdapter.java @@ -68,10 +68,6 @@ public final class AccountsListAdapter extends BaseAdapter { mAccountTypes = AccountTypeManager.getInstance(context); mAccounts = getAccounts(accountListFilter); - // Add the virtual local storage account to allow user to store its contacts in the phone - mAccounts.add(0, new AccountWithDataSet(PhoneAccountType.ACCOUNT_NAME, - PhoneAccountType.ACCOUNT_TYPE, - null)); if (currentAccount != null && !mAccounts.isEmpty() && !mAccounts.get(0).equals(currentAccount) |