Loading src/com/android/settings/accounts/AccountAddressBookHelper.java 0 → 100644 +18 −0 Original line number Diff line number Diff line package com.android.settings.accounts; class AccountAddressBookHelper { /* By convention all address book account types has "address_book" postfix e.g. "foundation.e.accountmanager.address_book" */ public static final String ADDRESS_BOOK_ACCOUNT_TYPE = "address_book"; public static boolean isAccountAddressBookType(String account_type) { if (account_type != null) { return account_type.contains(ADDRESS_BOOK_ACCOUNT_TYPE); } else { return false; } } } src/com/android/settings/accounts/AccountPreferenceController.java +1 −11 Original line number Diff line number Diff line Loading @@ -79,12 +79,6 @@ public class AccountPreferenceController extends AbstractPreferenceController private static final int ORDER_NEXT_TO_LAST = 1001; private static final int ORDER_NEXT_TO_NEXT_TO_LAST = 1000; /* by convention all address book account types has "address_book" postfix e.g. "foundation.e.accountmanager.address_book" */ private static final String ADDRESS_BOOK_ACCOUNT_TYPE = "address_book"; private UserManager mUm; private SparseArray<ProfileData> mProfiles = new SparseArray<ProfileData>(); private ManagedProfileBroadcastReceiver mManagedProfileBroadcastReceiver Loading Loading @@ -489,12 +483,8 @@ public class AccountPreferenceController extends AbstractPreferenceController for (int i = 0; i < accountTypes.length; i++) { final String accountType = accountTypes[i]; // Skip displaying address book accounts if (accountType.contains(ADDRESS_BOOK_ACCOUNT_TYPE)) if (AccountAddressBookHelper.isAccountAddressBookType(accountType)) continue; // Skip showing any account that does not have any of the requested authorities if (!accountTypeHasAnyRequestedAuthorities(helper, accountType)) { continue; } final CharSequence label = helper.getLabelForType(mContext, accountType); if (label == null) { continue; Loading src/com/android/settings/accounts/ChooseAccountPreferenceController.java +4 −2 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ public class ChooseAccountPreferenceController extends BasePreferenceController mProviderList = new ArrayList<>(); mTypeToAuthDescription = new HashMap<>(); } public void initialize(String[] authorities, String[] accountTypesFilter, UserHandle userHandle, Loading Loading @@ -150,8 +151,9 @@ public class ChooseAccountPreferenceController extends BasePreferenceController } } } if (addAccountPref && mAccountTypesFilter != null && !mAccountTypesFilter.contains(accountType)) { if (addAccountPref && ((mAccountTypesFilter != null && !mAccountTypesFilter.contains(accountType)) || AccountAddressBookHelper.isAccountAddressBookType(accountType))) { addAccountPref = false; } if (addAccountPref) { Loading Loading
src/com/android/settings/accounts/AccountAddressBookHelper.java 0 → 100644 +18 −0 Original line number Diff line number Diff line package com.android.settings.accounts; class AccountAddressBookHelper { /* By convention all address book account types has "address_book" postfix e.g. "foundation.e.accountmanager.address_book" */ public static final String ADDRESS_BOOK_ACCOUNT_TYPE = "address_book"; public static boolean isAccountAddressBookType(String account_type) { if (account_type != null) { return account_type.contains(ADDRESS_BOOK_ACCOUNT_TYPE); } else { return false; } } }
src/com/android/settings/accounts/AccountPreferenceController.java +1 −11 Original line number Diff line number Diff line Loading @@ -79,12 +79,6 @@ public class AccountPreferenceController extends AbstractPreferenceController private static final int ORDER_NEXT_TO_LAST = 1001; private static final int ORDER_NEXT_TO_NEXT_TO_LAST = 1000; /* by convention all address book account types has "address_book" postfix e.g. "foundation.e.accountmanager.address_book" */ private static final String ADDRESS_BOOK_ACCOUNT_TYPE = "address_book"; private UserManager mUm; private SparseArray<ProfileData> mProfiles = new SparseArray<ProfileData>(); private ManagedProfileBroadcastReceiver mManagedProfileBroadcastReceiver Loading Loading @@ -489,12 +483,8 @@ public class AccountPreferenceController extends AbstractPreferenceController for (int i = 0; i < accountTypes.length; i++) { final String accountType = accountTypes[i]; // Skip displaying address book accounts if (accountType.contains(ADDRESS_BOOK_ACCOUNT_TYPE)) if (AccountAddressBookHelper.isAccountAddressBookType(accountType)) continue; // Skip showing any account that does not have any of the requested authorities if (!accountTypeHasAnyRequestedAuthorities(helper, accountType)) { continue; } final CharSequence label = helper.getLabelForType(mContext, accountType); if (label == null) { continue; Loading
src/com/android/settings/accounts/ChooseAccountPreferenceController.java +4 −2 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ public class ChooseAccountPreferenceController extends BasePreferenceController mProviderList = new ArrayList<>(); mTypeToAuthDescription = new HashMap<>(); } public void initialize(String[] authorities, String[] accountTypesFilter, UserHandle userHandle, Loading Loading @@ -150,8 +151,9 @@ public class ChooseAccountPreferenceController extends BasePreferenceController } } } if (addAccountPref && mAccountTypesFilter != null && !mAccountTypesFilter.contains(accountType)) { if (addAccountPref && ((mAccountTypesFilter != null && !mAccountTypesFilter.contains(accountType)) || AccountAddressBookHelper.isAccountAddressBookType(accountType))) { addAccountPref = false; } if (addAccountPref) { Loading