/packages/apps/Contacts/tests/src/com/android/contacts/model/ |
D | AccountWithDataSetTest.java | 24 import com.android.contacts.model.account.AccountWithDataSet; 39 AccountWithDataSet a1 = new AccountWithDataSet("name1", "typeA", null); in testStringifyAndUnstringify() 40 AccountWithDataSet a2 = new AccountWithDataSet("name2", "typeB", null); in testStringifyAndUnstringify() 41 AccountWithDataSet a3 = new AccountWithDataSet("name3", "typeB", "dataset"); in testStringifyAndUnstringify() 44 AccountWithDataSet a1r = AccountWithDataSet.unstringify(a1.stringify()); in testStringifyAndUnstringify() 45 AccountWithDataSet a2r = AccountWithDataSet.unstringify(a2.stringify()); in testStringifyAndUnstringify() 46 AccountWithDataSet a3r = AccountWithDataSet.unstringify(a3.stringify()); in testStringifyAndUnstringify() 63 final String stringified = AccountWithDataSet.getNullAccount().stringify(); in testStringifyAndUnstringifyLocalAccount() 65 final AccountWithDataSet restored = AccountWithDataSet.unstringify(stringified); in testStringifyAndUnstringifyLocalAccount() 67 assertEquals(AccountWithDataSet.getNullAccount(), restored); in testStringifyAndUnstringifyLocalAccount() [all …]
|
D | AccountTypeManagerTest.java | 27 import com.android.contacts.model.account.AccountWithDataSet; 68 private static AccountWithDataSet createAccountWithDataSet(String name, AccountType type) { in createAccountWithDataSet() 69 return new AccountWithDataSet(name, type.accountType, type.dataSet); in createAccountWithDataSet() 86 private static Collection<AccountWithDataSet> buildAccounts(AccountWithDataSet... accounts) { in buildAccounts() 87 final List<AccountWithDataSet> result = Lists.newArrayList(); in buildAccounts() 88 for (AccountWithDataSet account : accounts) { in buildAccounts() 138 return new AccountWithDataSet(name, type, /* dataSet */ null).stringify(); in getDefaultAccountPreference()
|
/packages/apps/Contacts/src/com/android/contacts/model/ |
D | AccountTypeManager.java | 47 import com.android.contacts.model.account.AccountWithDataSet; 151 public AccountInfo getAccountInfoForAccount(AccountWithDataSet account) { 174 public List<AccountWithDataSet> getAccounts(boolean contactWritableOnly) { in getAccounts() 188 public List<AccountWithDataSet> blockForWritableAccounts() { in blockForWritableAccounts() 204 public abstract AccountInfo getAccountInfoForAccount(AccountWithDataSet account); in getAccountInfoForAccount() 233 final List<AccountWithDataSet> allAccounts = 255 final AccountWithDataSet accountWithDataSet = defaultAccount == null ? null : 256 AccountWithDataSet.unstringify(defaultAccount); 278 public final AccountType getAccountTypeForAccount(AccountWithDataSet account) { 297 public boolean exists(AccountWithDataSet account) { [all …]
|
D | DeviceLocalAccountLocator.java | 23 import com.android.contacts.model.account.AccountWithDataSet; 41 public abstract List<AccountWithDataSet> getDeviceLocalAccounts(); in getDeviceLocalAccounts() 47 public List<AccountWithDataSet> getDeviceLocalAccounts() { 48 return Collections.singletonList(AccountWithDataSet.getNullAccount()); 93 public List<AccountWithDataSet> getDeviceLocalAccounts() { in getDeviceLocalAccounts() 101 return Collections.singletonList(AccountWithDataSet.getNullAccount()); in getDeviceLocalAccounts()
|
D | Cp2DeviceLocalAccountLocator.java | 25 import com.android.contacts.model.account.AccountWithDataSet; 72 public List<AccountWithDataSet> getDeviceLocalAccounts() { in getDeviceLocalAccounts() 74 final Set<AccountWithDataSet> localAccounts = new HashSet<>(); in getDeviceLocalAccounts() 84 private void addAccountsFromQuery(Uri uri, Set<AccountWithDataSet> accounts) { in addAccountsFromQuery() 96 private void addAccountsFromCursor(Cursor cursor, Set<AccountWithDataSet> accounts) { in addAccountsFromCursor() 104 accounts.add(new AccountWithDataSet(name, type, dataSet)); in addAccountsFromCursor()
|
/packages/apps/Contacts/tests/src/com/android/contacts/editor/ |
D | ContactEditorUtilsTest.java | 30 import com.android.contacts.model.account.AccountWithDataSet; 60 private static final AccountWithDataSet ACCOUNT_1_A = new AccountWithDataSet("a", TYPE1, null); 61 private static final AccountWithDataSet ACCOUNT_1_B = new AccountWithDataSet("b", TYPE1, null); 63 private static final AccountWithDataSet ACCOUNT_2_A = new AccountWithDataSet("a", TYPE2, null); 64 private static final AccountWithDataSet ACCOUNT_2EX_A = new AccountWithDataSet( 83 assertNull(mTarget.getOnlyOrDefaultAccount(Collections.<AccountWithDataSet>emptyList())); in testSaveDefaultAccount() 87 <AccountWithDataSet>emptyList())); in testSaveDefaultAccount() 97 List<AccountWithDataSet> currentAccounts = new ArrayList<>(); in testShouldShowAccountChangedNotification_0Accounts() 187 <AccountWithDataSet>emptyList())); in testShouldShowAccountChangedNotification_0Account_localOnly() 190 mTarget.saveDefaultAccount(AccountWithDataSet.getNullAccount()); in testShouldShowAccountChangedNotification_0Account_localOnly() [all …]
|
D | EditorUiUtilsTest.java | 31 import com.android.contacts.model.account.AccountWithDataSet; 49 private static final AccountWithDataSet ACCOUNT = 50 new AccountWithDataSet(ACCOUNT_NAME, "some.account.type", null); 51 private static final AccountWithDataSet GOOGLE_ACCOUNT = 52 new AccountWithDataSet(ACCOUNT_NAME, "com.google", null); 129 final AccountWithDataSet deviceAccount = AccountWithDataSet.getNullAccount(); in testGetAccountInfo_AccountType_DeviceAccount()
|
/packages/apps/Contacts/src/com/android/contacts/model/account/ |
D | AccountWithDataSet.java | 43 public class AccountWithDataSet implements Parcelable { class 65 public AccountWithDataSet(String name, String type, String dataSet) { in AccountWithDataSet() method in AccountWithDataSet 76 public AccountWithDataSet(Parcel in) { in AccountWithDataSet() method in AccountWithDataSet 87 public static AccountWithDataSet getNullAccount() { in getNullAccount() 88 return new AccountWithDataSet(null, null, null); in getNullAccount() 109 public static final Creator<AccountWithDataSet> CREATOR = new Creator<AccountWithDataSet>() { 110 public AccountWithDataSet createFromParcel(Parcel source) { 111 return new AccountWithDataSet(source); 114 public AccountWithDataSet[] newArray(int size) { 115 return new AccountWithDataSet[size]; [all …]
|
D | AccountInfo.java | 46 public AccountWithDataSet getAccount() { in getAccount() 87 public boolean sameAccount(AccountWithDataSet other) { in sameAccount() 107 public static boolean contains(List<AccountInfo> accounts, AccountWithDataSet account) { in contains() 114 public static AccountInfo getAccount(List<AccountInfo> accounts, AccountWithDataSet account) { in getAccount() 128 public static void sortAccounts(AccountWithDataSet defaultAccount, List<AccountInfo> accounts) { in sortAccounts() 135 public static List<AccountWithDataSet> extractAccounts(List<AccountInfo> accounts) { in extractAccounts() 139 private static Comparator<AccountInfo> sourceComparator(AccountWithDataSet defaultAccount) { in sourceComparator() 149 public static final Function<AccountInfo, AccountWithDataSet> ACCOUNT_EXTRACTOR = 150 new Function<AccountInfo, AccountWithDataSet>() { 152 public AccountWithDataSet apply(AccountInfo from) {
|
D | AccountDisplayInfoFactory.java | 46 public AccountDisplayInfoFactory(Context context, List<AccountWithDataSet> accounts) { in AccountDisplayInfoFactory() 53 List<AccountWithDataSet> accounts) { in AccountDisplayInfoFactory() 62 public AccountDisplayInfo getAccountDisplayInfo(AccountWithDataSet account) { in getAccountDisplayInfo() 78 final AccountWithDataSet account = new AccountWithDataSet(delta.getAccountName(), in getAccountDisplayInfoFor() 85 final List<AccountWithDataSet> accounts = new ArrayList<>(filters.size()); in fromListFilters() 92 private boolean shouldUseTypeLabelForName(AccountWithDataSet account) { in shouldUseTypeLabelForName() 101 List<AccountWithDataSet> accounts) { in countOfType() 103 for (AccountWithDataSet account : accounts) { in countOfType()
|
D | AccountComparator.java | 25 public class AccountComparator implements Comparator<AccountWithDataSet> { 26 private AccountWithDataSet mDefaultAccount; 28 public AccountComparator(AccountWithDataSet defaultAccount) { in AccountComparator() 33 public int compare(AccountWithDataSet a, AccountWithDataSet b) { in compare() 68 private static boolean isWritableGoogleAccount(AccountWithDataSet account) { in isWritableGoogleAccount()
|
/packages/apps/Dialer/java/com/android/contacts/common/model/account/ |
D | AccountWithDataSet.java | 35 public class AccountWithDataSet implements Parcelable { class 38 public static final Creator<AccountWithDataSet> CREATOR = 39 new Creator<AccountWithDataSet>() { 40 public AccountWithDataSet createFromParcel(Parcel source) { 41 return new AccountWithDataSet(source); 44 public AccountWithDataSet[] newArray(int size) { 45 return new AccountWithDataSet[size]; 65 public AccountWithDataSet(String name, String type, String dataSet) { in AccountWithDataSet() method in AccountWithDataSet 72 public AccountWithDataSet(Parcel in) { in AccountWithDataSet() method in AccountWithDataSet 83 private static StringBuilder addStringified(StringBuilder sb, AccountWithDataSet account) { in addStringified() [all …]
|
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ |
D | AccountWithDataSet.java | 27 public class AccountWithDataSet { class 28 public static final AccountWithDataSet LOCAL = new AccountWithDataSet(null, null, null); 34 public AccountWithDataSet(String accountName, String accountType, String dataSet) { in AccountWithDataSet() method in AccountWithDataSet 44 public static AccountWithDataSet get(String accountName, String accountType, String dataSet) { in get() 45 return new AccountWithDataSet(accountName, accountType, dataSet); in get() 48 public static AccountWithDataSet get(Account account, String dataSet) { in get() 49 return new AccountWithDataSet(account.name, account.type, null); in get() 70 if (obj instanceof AccountWithDataSet) { in equals() 71 AccountWithDataSet other = (AccountWithDataSet) obj; in equals()
|
/packages/apps/Dialer/java/com/android/contacts/common/model/ |
D | AccountTypeManager.java | 49 import com.android.contacts.common.model.account.AccountWithDataSet; 113 public abstract List<AccountWithDataSet> getAccounts(boolean contactWritableOnly); in getAccounts() 116 public abstract List<AccountWithDataSet> getGroupWritableAccounts(); in getGroupWritableAccounts() 124 public final AccountType getAccountTypeForAccount(AccountWithDataSet account) { in getAccountTypeForAccount() 164 public boolean contains(AccountWithDataSet account, boolean contactWritableOnly) { in contains() 165 for (AccountWithDataSet account_2 : getAccounts(false)) { in contains() 190 private static final Comparator<AccountWithDataSet> ACCOUNT_COMPARATOR = 191 new Comparator<AccountWithDataSet>() { 193 public int compare(AccountWithDataSet a, AccountWithDataSet b) { 244 private List<AccountWithDataSet> mAccounts = new ArrayList<>(); [all …]
|
/packages/apps/Contacts/tests/src/com/android/contacts/preference/ |
D | ContactsPreferencesTest.java | 27 import com.android.contacts.model.account.AccountWithDataSet; 188 .thenReturn(new AccountWithDataSet("name1", "type1", "dataset1").stringify(), in testRefreshDefaultAccount() 189 new AccountWithDataSet("name2", "type2", "dataset2").stringify()); in testRefreshDefaultAccount() 191 Assert.assertEquals(new AccountWithDataSet("name1", "type1", "dataset1"), in testRefreshDefaultAccount() 195 Assert.assertEquals(new AccountWithDataSet("name2", "type2", "dataset2"), in testRefreshDefaultAccount() 207 new AccountWithDataSet("name1", "type1", "dataset1"), in testShouldShowAccountChangedNotificationIfAccountNotSaved() 208 new AccountWithDataSet("name2", "type2", "dataset2")))); in testShouldShowAccountChangedNotificationIfAccountNotSaved() 215 .thenReturn(new AccountWithDataSet("name", "type", "dataset").stringify()); in testShouldShowAccountChangedNotification() 219 new AccountWithDataSet("name", "type", "dataset"), in testShouldShowAccountChangedNotification() 220 new AccountWithDataSet("name1", "type1", "dataset1")))); in testShouldShowAccountChangedNotification() [all …]
|
/packages/apps/Contacts/src/com/android/contacts/editor/ |
D | ContactEditorUtils.java | 30 import com.android.contacts.model.account.AccountWithDataSet; 90 public void saveDefaultAccount(AccountWithDataSet defaultAccount) { in saveDefaultAccount() 106 public AccountWithDataSet getOnlyOrDefaultAccount( in getOnlyOrDefaultAccount() 107 List<AccountWithDataSet> currentWritableAccounts) { in getOnlyOrDefaultAccount() 115 public boolean shouldShowAccountChangedNotification(List<AccountWithDataSet> writableAccounts) { in shouldShowAccountChangedNotification() 122 public void maybeUpdateDefaultAccount(List<AccountWithDataSet> currentWritableAccounts) { in maybeUpdateDefaultAccount() 124 final AccountWithDataSet onlyAccount = currentWritableAccounts.get(0); in maybeUpdateDefaultAccount() 147 public AccountWithDataSet getCreatedAccount(int resultCode, Intent resultData) { in getCreatedAccount() 158 return new AccountWithDataSet(accountName, accountType, null); in getCreatedAccount()
|
/packages/apps/Contacts/src/com/android/contacts/util/ |
D | AccountSelectionUtil.java | 38 import com.android.contacts.model.account.AccountWithDataSet; 61 final protected List<AccountWithDataSet> mAccountList; 63 public AccountSelectedListener(Activity activity, List<AccountWithDataSet> accountList, in AccountSelectedListener() 74 public AccountSelectedListener(Activity activity, List<AccountWithDataSet> accountList, in AccountSelectedListener() 95 final List<AccountWithDataSet> writableAccountList = in getSelectAccountDialog() 107 final ArrayAdapter<AccountWithDataSet> accountAdapter = in getSelectAccountDialog() 108 new ArrayAdapter<AccountWithDataSet>( in getSelectAccountDialog() 122 final AccountWithDataSet account = this.getItem(position); in getSelectAccountDialog() 157 public static void doImport(Activity activity, int resId, AccountWithDataSet account, in doImport() 166 public static void doImportFromSim(Context context, AccountWithDataSet account, in doImportFromSim() [all …]
|
/packages/apps/Contacts/tests/src/com/android/contacts/tests/ |
D | AccountsTestHelper.java | 31 import com.android.contacts.model.account.AccountWithDataSet; 62 public void addTestAccount(AccountWithDataSet account) { in addTestAccount() 68 public AccountWithDataSet addTestAccount() { in addTestAccount() 72 public AccountWithDataSet addTestAccount(@NonNull String name) { in addTestAccount() 75 final AccountWithDataSet account = new AccountWithDataSet(name, TEST_ACCOUNT_TYPE, null); in addTestAccount() 89 public void removeTestAccount(AccountWithDataSet account) { in removeTestAccount() 97 removeTestAccount(new AccountWithDataSet(accountName, TEST_ACCOUNT_TYPE, null)); in removeTestAccount() 106 public void removeContactsForAccount(AccountWithDataSet account) { in removeContactsForAccount()
|
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/ |
D | ContactsDatabaseHelperTest.java | 60 final AccountWithDataSet a1 = null; in testGetOrCreateAccountId() 61 final AccountWithDataSet a2 = new AccountWithDataSet("a", null, null); in testGetOrCreateAccountId() 62 final AccountWithDataSet a3 = new AccountWithDataSet(null, "b", null); in testGetOrCreateAccountId() 63 final AccountWithDataSet a4 = new AccountWithDataSet(null, null, "c"); in testGetOrCreateAccountId() 64 final AccountWithDataSet a5 = new AccountWithDataSet("a", "b", "c"); in testGetOrCreateAccountId() 110 assertEquals(a1id, mDbHelper.getOrCreateAccountIdInTransaction(AccountWithDataSet.LOCAL)); in testGetOrCreateAccountId() 111 assertEquals((Long) a1id, mDbHelper.getAccountIdOrNull(AccountWithDataSet.LOCAL)); in testGetOrCreateAccountId() 116 assertNull(mDbHelper.getAccountIdOrNull(AccountWithDataSet.LOCAL)); in testGetOrCreateAccountId() 124 final AccountWithDataSet a5b = new AccountWithDataSet("a", "b", "c"); in testGetOrCreateAccountId() 276 AccountWithDataSet.LOCAL); in testUpgradeHashId() [all …]
|
/packages/apps/Contacts/tests/src/com/android/contacts/database/ |
D | SimContactDaoTests.java | 61 import com.android.contacts.model.account.AccountWithDataSet; 111 private AccountWithDataSet mAccount; 289 private List<AccountWithDataSet> mAccounts; 294 private static AccountWithDataSet sSeedAccount; 325 for (AccountWithDataSet account : mAccounts) { in tearDown() 342 final Map<AccountWithDataSet, Set<SimContact>> existing = sut in returnsEmptyMapWhenNoMatchingContactsExist() 353 final AccountWithDataSet account = mAccountHelper.addTestAccount( in hasAccountWithMatchingContactsWhenSingleMatchingContactExists() 374 final Map<AccountWithDataSet, Set<SimContact>> existing = sut in hasAccountWithMatchingContactsWhenSingleMatchingContactExists() 386 final AccountWithDataSet account1 = mAccountHelper.addTestAccount( in hasMultipleAccountsWhenMultipleMatchingContactsExist() 389 final AccountWithDataSet account2 = mAccountHelper.addTestAccount( in hasMultipleAccountsWhenMultipleMatchingContactsExist() [all …]
|
/packages/apps/Contacts/src/com/android/contacts/preference/ |
D | ContactsPreferences.java | 35 import com.android.contacts.model.account.AccountWithDataSet; 84 private AccountWithDataSet mDefaultAccount = null; 212 public AccountWithDataSet getDefaultAccount() { in getDefaultAccount() 220 mDefaultAccount = AccountWithDataSet.unstringify(accountString); in getDefaultAccount() 231 public void setDefaultAccount(@NonNull AccountWithDataSet accountWithDataSet) { in setDefaultAccount() 255 public boolean shouldShowAccountChangedNotification(List<AccountWithDataSet> in shouldShowAccountChangedNotification() 257 final AccountWithDataSet defaultAccount = getDefaultAccount(); in shouldShowAccountChangedNotification() 388 final AccountWithDataSet accountWithDataSet = AccountWithDataSet.unstringify( in maybeMigrateSystemSettings()
|
/packages/apps/Contacts/tests/src/com/android/contacts/util/ |
D | AccountDisplayInfoFactoryTests.java | 29 import com.android.contacts.model.account.AccountWithDataSet; 41 private Map<AccountWithDataSet, AccountType> mKnownTypes; 169 private AccountWithDataSet account(String name, String type) { in account() 170 return new AccountWithDataSet(name, type, /* dataSet */ null); in account() 173 private void addTypeMapping(AccountWithDataSet account, String label, Drawable icon) { in addTypeMapping() 178 final Map<AccountWithDataSet, AccountType> mapping) { in createFakeAccountTypeManager() argument 180 mapping.keySet().toArray(new AccountWithDataSet[mapping.size()])); in createFakeAccountTypeManager()
|
/packages/apps/Contacts/src/com/android/contacts/database/ |
D | SimContactDaoImpl.java | 47 import com.android.contacts.model.account.AccountWithDataSet; 147 AccountWithDataSet targetAccount) in importContacts() 188 public Map<AccountWithDataSet, Set<SimContact>> findAccountsOfExistingSimContacts( in findAccountsOfExistingSimContacts() 190 final Map<AccountWithDataSet, Set<SimContact>> result = new ArrayMap<>(); in findAccountsOfExistingSimContacts() 200 Map<AccountWithDataSet, Set<SimContact>> result) { in findAccountsOfExistingSimContacts() argument 229 final AccountWithDataSet account = AccountQuery.getAccount(accountsCursor); in findAccountsOfExistingSimContacts() 245 AccountWithDataSet targetAccount) in importBatch() 387 AccountWithDataSet targetAccount) { in createImportOperations() 480 public static AccountWithDataSet getAccount(Cursor cursor) { in getAccount() 481 return new AccountWithDataSet(cursor.getString(1), cursor.getString(2), in getAccount()
|
/packages/apps/Contacts/tests/src/com/android/contacts/test/mocks/ |
D | MockAccountTypeManager.java | 24 import com.android.contacts.model.account.AccountWithDataSet; 39 public AccountWithDataSet[] mAccounts; 41 public MockAccountTypeManager(AccountType[] types, AccountWithDataSet[] accounts) { in MockAccountTypeManager() 66 public List<AccountWithDataSet> blockForWritableAccounts() { in blockForWritableAccounts() 81 public AccountInfo getAccountInfoForAccount(AccountWithDataSet account) { in getAccountInfoForAccount()
|
/packages/apps/Contacts/src/com/android/contacts/list/ |
D | ContactListFilter.java | 29 import com.android.contacts.model.account.AccountWithDataSet; 102 AccountWithDataSet account) { in createDeviceContactsFilter() 349 public AccountWithDataSet toAccountWithDataSet() { in toAccountWithDataSet() 351 return new AccountWithDataSet(accountName, accountType, dataSet); in toAccountWithDataSet() 403 public boolean isSyncable(List<AccountWithDataSet> accounts) { in isSyncable() 416 for (AccountWithDataSet account : accounts) { in isSyncable() 437 public List<Account> getSyncableAccounts(List<AccountWithDataSet> accounts) { in getSyncableAccounts() 446 for (AccountWithDataSet account : accounts) { in getSyncableAccounts()
|