Loading src/com/android/contacts/common/model/AccountTypeManager.java +8 −6 Original line number Diff line number Diff line Loading @@ -595,7 +595,7 @@ class AccountTypeManagerImpl extends AccountTypeManager && accountWithDataSet.dataSet == null) { foundWritableGoogleAccount = true; } } if (accountType.isGroupMembershipEditable()) { groupWritableAccounts.add(accountWithDataSet); } Loading @@ -603,6 +603,7 @@ class AccountTypeManagerImpl extends AccountTypeManager } } } } final DeviceLocalAccountLocator deviceAccounts = new DeviceLocalAccountLocator(mContext.getContentResolver(), Loading Loading @@ -632,11 +633,12 @@ class AccountTypeManagerImpl extends AccountTypeManager } if (localAccountType.areContactsWritable()) { contactWritableAccounts.add(localAccount); } if (localAccountType.isGroupMembershipEditable()) { groupWritableAccounts.add(localAccount); } } } final AccountComparator accountComparator = new AccountComparator(null); Collections.sort(allAccounts, accountComparator); Loading src/com/android/contacts/common/model/account/ExternalAccountType.java +10 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.pm.ServiceInfo; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.provider.ContactsContract.CommonDataKinds.GroupMembership; import android.provider.ContactsContract.CommonDataKinds.Photo; import android.provider.ContactsContract.CommonDataKinds.StructuredName; import android.text.TextUtils; Loading Loading @@ -101,6 +102,7 @@ public class ExternalAccountType extends BaseAccountType { private String mAccountTypeIconAttribute; private boolean mHasContactsMetadata; private boolean mHasEditSchema; private boolean mGroupMembershipEditable; public ExternalAccountType(Context context, String resPackageName, boolean isExtension) { this(context, resPackageName, isExtension, null); Loading Loading @@ -172,6 +174,9 @@ public class ExternalAccountType extends BaseAccountType { iconRes = resolveExternalResId(context, mAccountTypeIconAttribute, syncAdapterPackageName, ATTR_ACCOUNT_ICON); final DataKind dataKind = getKindForMimetype(GroupMembership.CONTENT_ITEM_TYPE); mGroupMembershipEditable = dataKind != null && dataKind.editable; // If we reach this point, the account type has been successfully initialized. mIsInitialized = true; } Loading Loading @@ -293,6 +298,11 @@ public class ExternalAccountType extends BaseAccountType { return mExtensionPackageNames; } @Override public boolean isGroupMembershipEditable() { return mGroupMembershipEditable; } /** * Inflate this {@link AccountType} from the given parser. This may only * load details matching the publicly-defined schema. Loading Loading
src/com/android/contacts/common/model/AccountTypeManager.java +8 −6 Original line number Diff line number Diff line Loading @@ -595,7 +595,7 @@ class AccountTypeManagerImpl extends AccountTypeManager && accountWithDataSet.dataSet == null) { foundWritableGoogleAccount = true; } } if (accountType.isGroupMembershipEditable()) { groupWritableAccounts.add(accountWithDataSet); } Loading @@ -603,6 +603,7 @@ class AccountTypeManagerImpl extends AccountTypeManager } } } } final DeviceLocalAccountLocator deviceAccounts = new DeviceLocalAccountLocator(mContext.getContentResolver(), Loading Loading @@ -632,11 +633,12 @@ class AccountTypeManagerImpl extends AccountTypeManager } if (localAccountType.areContactsWritable()) { contactWritableAccounts.add(localAccount); } if (localAccountType.isGroupMembershipEditable()) { groupWritableAccounts.add(localAccount); } } } final AccountComparator accountComparator = new AccountComparator(null); Collections.sort(allAccounts, accountComparator); Loading
src/com/android/contacts/common/model/account/ExternalAccountType.java +10 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.pm.ServiceInfo; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.provider.ContactsContract.CommonDataKinds.GroupMembership; import android.provider.ContactsContract.CommonDataKinds.Photo; import android.provider.ContactsContract.CommonDataKinds.StructuredName; import android.text.TextUtils; Loading Loading @@ -101,6 +102,7 @@ public class ExternalAccountType extends BaseAccountType { private String mAccountTypeIconAttribute; private boolean mHasContactsMetadata; private boolean mHasEditSchema; private boolean mGroupMembershipEditable; public ExternalAccountType(Context context, String resPackageName, boolean isExtension) { this(context, resPackageName, isExtension, null); Loading Loading @@ -172,6 +174,9 @@ public class ExternalAccountType extends BaseAccountType { iconRes = resolveExternalResId(context, mAccountTypeIconAttribute, syncAdapterPackageName, ATTR_ACCOUNT_ICON); final DataKind dataKind = getKindForMimetype(GroupMembership.CONTENT_ITEM_TYPE); mGroupMembershipEditable = dataKind != null && dataKind.editable; // If we reach this point, the account type has been successfully initialized. mIsInitialized = true; } Loading Loading @@ -293,6 +298,11 @@ public class ExternalAccountType extends BaseAccountType { return mExtensionPackageNames; } @Override public boolean isGroupMembershipEditable() { return mGroupMembershipEditable; } /** * Inflate this {@link AccountType} from the given parser. This may only * load details matching the publicly-defined schema. Loading