From f0e140aec2f5832a517243084bea626011be9c39 Mon Sep 17 00:00:00 2001 From: Marcus Hagerott Date: Mon, 5 Dec 2016 16:59:48 -0800 Subject: Remove some methods from AccountTypeManager This will make it simpler to do additional refactoring. Test: built GoogleContacts app Bug: 32028702 Change-Id: I51939d1b841eaf250cb75e198ea561b944deff1f --- .../contacts/editor/ContactEditorUtilsTest.java | 31 ---------------------- .../test/mocks/MockAccountTypeManager.java | 19 ------------- 2 files changed, 50 deletions(-) (limited to 'tests/src/com') diff --git a/tests/src/com/android/contacts/editor/ContactEditorUtilsTest.java b/tests/src/com/android/contacts/editor/ContactEditorUtilsTest.java index f6c2d1b1c..9756a0c50 100644 --- a/tests/src/com/android/contacts/editor/ContactEditorUtilsTest.java +++ b/tests/src/com/android/contacts/editor/ContactEditorUtilsTest.java @@ -79,37 +79,6 @@ public class ContactEditorUtilsTest extends AndroidTestCase { mAccountTypes.mAccounts = accounts; } - public void testGetWritableAccountTypeStrings() { - String[] types; - - // 0 writable types - setAccountTypes(); - - types = mTarget.getWritableAccountTypeStrings(); - MoreAsserts.assertEquals(types, new String[0]); - - // 1 writable type - setAccountTypes(TYPE1); - - types = mTarget.getWritableAccountTypeStrings(); - MoreAsserts.assertEquals(Sets.newHashSet(TYPE1.accountType), Sets.newHashSet(types)); - - // 2 writable types - setAccountTypes(TYPE1, TYPE2EX); - - types = mTarget.getWritableAccountTypeStrings(); - MoreAsserts.assertEquals(Sets.newHashSet(TYPE1.accountType, TYPE2EX.accountType), - Sets.newHashSet(types)); - - // 3 writable types + 1 readonly type - setAccountTypes(TYPE1, TYPE2, TYPE2EX, TYPE3); - - types = mTarget.getWritableAccountTypeStrings(); - MoreAsserts.assertEquals( - Sets.newHashSet(TYPE1.accountType, TYPE2.accountType, TYPE2EX.accountType), - Sets.newHashSet(types)); - } - /** * Test for * - {@link ContactEditorUtils#saveDefaultAccount} diff --git a/tests/src/com/android/contacts/test/mocks/MockAccountTypeManager.java b/tests/src/com/android/contacts/test/mocks/MockAccountTypeManager.java index 00686aa15..16804c93d 100644 --- a/tests/src/com/android/contacts/test/mocks/MockAccountTypeManager.java +++ b/tests/src/com/android/contacts/test/mocks/MockAccountTypeManager.java @@ -75,12 +75,6 @@ public class MockAccountTypeManager extends AccountTypeManager { return Lists.newArrayList(Collections2.filter(Arrays.asList(mAccounts), filter)); } - @Override - public List getSortedAccounts(AccountWithDataSet account, - boolean writableOnly) { - return Arrays.asList(mAccounts); - } - @Override public List getGroupWritableAccounts() { return Arrays.asList(mAccounts); @@ -95,17 +89,4 @@ public class MockAccountTypeManager extends AccountTypeManager { public Map getUsableInvitableAccountTypes() { return Maps.newHashMap(); // Always returns empty } - - @Override - public List getAccountTypes(boolean writableOnly) { - final List ret = Lists.newArrayList(); - synchronized (this) { - for (AccountType type : mTypes) { - if (!writableOnly || type.areContactsWritable()) { - ret.add(type); - } - } - } - return ret; - } } -- cgit v1.2.3