/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 | 45 import com.android.contacts.model.account.AccountWithDataSet; 158 public AccountInfo getAccountInfoForAccount(AccountWithDataSet account) { 181 public List<AccountWithDataSet> getAccounts(boolean contactWritableOnly) { in getAccounts() 195 public List<AccountWithDataSet> blockForWritableAccounts() { in blockForWritableAccounts() 211 public abstract AccountInfo getAccountInfoForAccount(AccountWithDataSet account); in getAccountInfoForAccount() 240 final List<AccountWithDataSet> allAccounts = 262 final AccountWithDataSet accountWithDataSet = defaultAccount == null ? null : 263 AccountWithDataSet.unstringify(defaultAccount); 285 public final AccountType getAccountTypeForAccount(AccountWithDataSet account) { 304 public boolean exists(AccountWithDataSet account) { [all …]
|
D | DeviceLocalAccountLocator.java | 23 import com.android.contacts.model.account.AccountWithDataSet; 36 private final List<AccountWithDataSet> mLocalAccount; 41 mLocalAccount = Collections.singletonList(AccountWithDataSet.getLocalAccount(context)); in DeviceLocalAccountLocator() 47 public List<AccountWithDataSet> getDeviceLocalAccounts() { in getDeviceLocalAccounts()
|
/packages/apps/Contacts/src/com/android/contacts/model/account/ |
D | AccountWithDataSet.java | 42 public class AccountWithDataSet implements Parcelable { class 64 public AccountWithDataSet(String name, String type, String dataSet) { in AccountWithDataSet() method in AccountWithDataSet 75 public AccountWithDataSet(Parcel in) { in AccountWithDataSet() method in AccountWithDataSet 86 public static AccountWithDataSet getNullAccount() { in getNullAccount() 87 return new AccountWithDataSet(null, null, null); in getNullAccount() 90 public static AccountWithDataSet getLocalAccount(Context context) { in getLocalAccount() 93 : new AccountWithDataSet( in getLocalAccount() 117 public static final Creator<AccountWithDataSet> CREATOR = new Creator<AccountWithDataSet>() { 118 public AccountWithDataSet createFromParcel(Parcel source) { 119 return new AccountWithDataSet(source); [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/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/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 | 31 public class AccountWithDataSet { class 32 public static final AccountWithDataSet LOCAL = new AccountWithDataSet(null, null, null); 38 public AccountWithDataSet(String accountName, String accountType, String dataSet) { in AccountWithDataSet() method in AccountWithDataSet 48 public static AccountWithDataSet get(String accountName, String accountType, String dataSet) { in get() 49 return new AccountWithDataSet(accountName, accountType, dataSet); in get() 52 public static AccountWithDataSet get(Account account, String dataSet) { in get() 53 return new AccountWithDataSet(account.name, account.type, null); in get() 74 if (obj instanceof AccountWithDataSet) { in equals() 75 AccountWithDataSet other = (AccountWithDataSet) obj; in equals()
|
/packages/apps/Contacts/src/com/android/contacts/editor/ |
D | ContactEditorUtils.java | 30 import com.android.contacts.model.account.AccountWithDataSet; 92 public void saveDefaultAccount(AccountWithDataSet defaultAccount) { in saveDefaultAccount() 108 public AccountWithDataSet getOnlyOrDefaultAccount( in getOnlyOrDefaultAccount() 109 List<AccountWithDataSet> currentWritableAccounts) { in getOnlyOrDefaultAccount() 117 public boolean shouldShowAccountChangedNotification(List<AccountWithDataSet> writableAccounts) { in shouldShowAccountChangedNotification() 124 public void maybeUpdateDefaultAccount(List<AccountWithDataSet> currentWritableAccounts) { in maybeUpdateDefaultAccount() 126 final AccountWithDataSet onlyAccount = currentWritableAccounts.get(0); in maybeUpdateDefaultAccount() 127 if (!onlyAccount.equals(AccountWithDataSet.getLocalAccount(mContext)) in maybeUpdateDefaultAccount() 149 public AccountWithDataSet getCreatedAccount(int resultCode, Intent resultData) { in getCreatedAccount() 160 return new AccountWithDataSet(accountName, accountType, null); in getCreatedAccount()
|
D | AccountHeaderPresenter.java | 30 import com.android.contacts.model.account.AccountWithDataSet; 59 private AccountWithDataSet mCurrentAccount; 89 public void setCurrentAccount(@NonNull AccountWithDataSet account) { in setCurrentAccount() 111 public AccountWithDataSet getCurrentAccount() { in getCurrentAccount() 189 final AccountWithDataSet newAccount = adapter.getItem(position); in showPopup() 214 private String getAccountLabel(AccountWithDataSet account) { in getAccountLabel()
|
/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/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/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/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() 259 AccountWithDataSet localAccount = AccountWithDataSet.getLocalAccount(mContext); in shouldShowAccountChangedNotification() 389 final AccountWithDataSet accountWithDataSet = AccountWithDataSet.unstringify( in maybeMigrateSystemSettings()
|
/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 | 63 import com.android.contacts.model.account.AccountWithDataSet; 113 private AccountWithDataSet mAccount; 291 private List<AccountWithDataSet> mAccounts; 296 private static AccountWithDataSet sSeedAccount; 327 for (AccountWithDataSet account : mAccounts) { in tearDown() 344 final Map<AccountWithDataSet, Set<SimContact>> existing = sut in returnsEmptyMapWhenNoMatchingContactsExist() 355 final AccountWithDataSet account = mAccountHelper.addTestAccount( in hasAccountWithMatchingContactsWhenSingleMatchingContactExists() 376 final Map<AccountWithDataSet, Set<SimContact>> existing = sut in hasAccountWithMatchingContactsWhenSingleMatchingContactExists() 388 final AccountWithDataSet account1 = mAccountHelper.addTestAccount( in hasMultipleAccountsWhenMultipleMatchingContactsExist() 391 final AccountWithDataSet account2 = mAccountHelper.addTestAccount( in hasMultipleAccountsWhenMultipleMatchingContactsExist() [all …]
|
/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/list/ |
D | ContactListFilter.java | 29 import com.android.contacts.model.account.AccountWithDataSet; 103 AccountWithDataSet account) { in createDeviceContactsFilter() 109 AccountWithDataSet account) { in createSimContactsFilter() 356 public AccountWithDataSet toAccountWithDataSet() { in toAccountWithDataSet() 359 return new AccountWithDataSet(accountName, accountType, dataSet); in toAccountWithDataSet() 411 public boolean isSyncable(List<AccountWithDataSet> accounts) { in isSyncable() 424 for (AccountWithDataSet account : accounts) { in isSyncable() 445 public List<Account> getSyncableAccounts(List<AccountWithDataSet> accounts) { in getSyncableAccounts() 454 for (AccountWithDataSet account : accounts) { in getSyncableAccounts()
|
/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/database/ |
D | SimContactDaoImpl.java | 47 import com.android.contacts.model.account.AccountWithDataSet; 136 AccountWithDataSet targetAccount) in importContacts() 177 public Map<AccountWithDataSet, Set<SimContact>> findAccountsOfExistingSimContacts( in findAccountsOfExistingSimContacts() 179 final Map<AccountWithDataSet, Set<SimContact>> result = new ArrayMap<>(); in findAccountsOfExistingSimContacts() 189 Map<AccountWithDataSet, Set<SimContact>> result) { in findAccountsOfExistingSimContacts() argument 218 final AccountWithDataSet account = AccountQuery.getAccount(accountsCursor); in findAccountsOfExistingSimContacts() 234 AccountWithDataSet targetAccount) in importBatch() 379 AccountWithDataSet targetAccount) { in createImportOperations() 468 public static AccountWithDataSet getAccount(Cursor cursor) { in getAccount() 469 return new AccountWithDataSet(cursor.getString(1), cursor.getString(2), in getAccount()
|