diff options
author | Zheng Fu <zhengfu@google.com> | 2014-08-29 16:02:44 -0700 |
---|---|---|
committer | Zheng Fu <zhengfu@google.com> | 2014-09-02 13:49:14 -0700 |
commit | cd9993ef634735bb595c14b8d218ffe95df0fc74 (patch) | |
tree | 346257e7acbaca1b4807ca1094ff1e66986bb8b3 /TestCommon/src/com/android/contacts/common | |
parent | 54140f73445acb7f2c36b5ced72fb185a3f99f0a (diff) | |
download | packages_apps_ContactsCommon-cd9993ef634735bb595c14b8d218ffe95df0fc74.tar.gz packages_apps_ContactsCommon-cd9993ef634735bb595c14b8d218ffe95df0fc74.tar.bz2 packages_apps_ContactsCommon-cd9993ef634735bb595c14b8d218ffe95df0fc74.zip |
Making display name optional for directory contacts.
Bug: 17034954
Change-Id: I0ebec04ddad3cc1c8d979b02f834e5d544e8d6f3
Diffstat (limited to 'TestCommon/src/com/android/contacts/common')
-rw-r--r-- | TestCommon/src/com/android/contacts/common/test/mocks/MockAccountTypeManager.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/TestCommon/src/com/android/contacts/common/test/mocks/MockAccountTypeManager.java b/TestCommon/src/com/android/contacts/common/test/mocks/MockAccountTypeManager.java index 8aed9891..ab2d3954 100644 --- a/TestCommon/src/com/android/contacts/common/test/mocks/MockAccountTypeManager.java +++ b/TestCommon/src/com/android/contacts/common/test/mocks/MockAccountTypeManager.java @@ -19,6 +19,7 @@ import com.android.contacts.common.model.AccountTypeManager; import com.android.contacts.common.model.account.AccountType; import com.android.contacts.common.model.account.AccountTypeWithDataSet; import com.android.contacts.common.model.account.AccountWithDataSet; +import com.android.contacts.common.model.account.BaseAccountType; import com.google.common.base.Objects; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -42,13 +43,21 @@ public class MockAccountTypeManager extends AccountTypeManager { @Override public AccountType getAccountType(AccountTypeWithDataSet accountTypeWithDataSet) { + // Add fallback accountType to mimic the behavior of AccountTypeManagerImpl + AccountType mFallbackAccountType = new BaseAccountType() { + @Override + public boolean areContactsWritable() { + return false; + } + }; + mFallbackAccountType.accountType = "fallback"; for (AccountType type : mTypes) { if (Objects.equal(accountTypeWithDataSet.accountType, type.accountType) && Objects.equal(accountTypeWithDataSet.dataSet, type.dataSet)) { return type; } } - return null; + return mFallbackAccountType; } @Override |