Loading src/com/android/contacts/model/AccountTypeManager.java +4 −3 Original line number Diff line number Diff line Loading @@ -580,9 +580,9 @@ class AccountTypeManagerImpl extends AccountTypeManager if (account == null) { return null; } final AccountType type = mTypeProvider.getTypeForAccount(account); AccountType type = mTypeProvider.getTypeForAccount(account); if (type == null) { return null; type = mFallbackAccountType; } return type.wrapAccount(mContext, account); } Loading Loading @@ -703,7 +703,8 @@ class AccountTypeManagerImpl extends AccountTypeManager */ @Override public AccountType getAccountType(AccountTypeWithDataSet accountTypeWithDataSet) { return mTypeProvider.getType( final AccountType type = mTypeProvider.getType( accountTypeWithDataSet.accountType, accountTypeWithDataSet.dataSet); return type != null ? type : mFallbackAccountType; } } src/com/android/contacts/model/account/FallbackAccountType.java +14 −0 Original line number Diff line number Diff line Loading @@ -93,4 +93,18 @@ public class FallbackAccountType extends BaseAccountType { public boolean areContactsWritable() { return true; } /** * {@inheritDoc} * * <p>This is overriden because the base class validates that the account.type matches * {@link #accountType} but for the fallback case we want to be more permissive</p> */ @Override public AccountInfo wrapAccount(Context context, AccountWithDataSet account) { return new AccountInfo( new AccountDisplayInfo(account, account.name, getDisplayLabel(context), getDisplayIcon(context), false), this); } } Loading
src/com/android/contacts/model/AccountTypeManager.java +4 −3 Original line number Diff line number Diff line Loading @@ -580,9 +580,9 @@ class AccountTypeManagerImpl extends AccountTypeManager if (account == null) { return null; } final AccountType type = mTypeProvider.getTypeForAccount(account); AccountType type = mTypeProvider.getTypeForAccount(account); if (type == null) { return null; type = mFallbackAccountType; } return type.wrapAccount(mContext, account); } Loading Loading @@ -703,7 +703,8 @@ class AccountTypeManagerImpl extends AccountTypeManager */ @Override public AccountType getAccountType(AccountTypeWithDataSet accountTypeWithDataSet) { return mTypeProvider.getType( final AccountType type = mTypeProvider.getType( accountTypeWithDataSet.accountType, accountTypeWithDataSet.dataSet); return type != null ? type : mFallbackAccountType; } }
src/com/android/contacts/model/account/FallbackAccountType.java +14 −0 Original line number Diff line number Diff line Loading @@ -93,4 +93,18 @@ public class FallbackAccountType extends BaseAccountType { public boolean areContactsWritable() { return true; } /** * {@inheritDoc} * * <p>This is overriden because the base class validates that the account.type matches * {@link #accountType} but for the fallback case we want to be more permissive</p> */ @Override public AccountInfo wrapAccount(Context context, AccountWithDataSet account) { return new AccountInfo( new AccountDisplayInfo(account, account.name, getDisplayLabel(context), getDisplayIcon(context), false), this); } }