/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/ |
D | SearchIndexManagerTest.java | 52 long rawContactId = RawContactUtil.createRawContact(mResolver); in testSearchIndexForStructuredName() local 53 long contactId = queryContactId(rawContactId); in testSearchIndexForStructuredName() 54 DataUtil.insertStructuredName(mResolver, rawContactId, "John", "Doe"); in testSearchIndexForStructuredName() 57 DataUtil.insertStructuredName(mResolver, rawContactId, values); in testSearchIndexForStructuredName() 66 DataUtil.insertStructuredName(mResolver, rawContactId, values); in testSearchIndexForStructuredName() 73 long rawContactId = RawContactUtil.createRawContact(mResolver); in testSearchIndexForStructuredName_phoneticOnly() local 74 long contactId = queryContactId(rawContactId); in testSearchIndexForStructuredName_phoneticOnly() 75 DataUtil.insertStructuredName(mResolver, rawContactId, "John", "Doe"); in testSearchIndexForStructuredName_phoneticOnly() 78 DataUtil.insertStructuredName(mResolver, rawContactId, values); in testSearchIndexForStructuredName_phoneticOnly() 87 DataUtil.insertStructuredName(mResolver, rawContactId, values); in testSearchIndexForStructuredName_phoneticOnly() [all …]
|
D | BaseContactsProvider2Test.java | 232 protected Uri insertOrganization(long rawContactId, ContentValues values) { in insertOrganization() argument 233 return insertOrganization(rawContactId, values, false, false); in insertOrganization() 236 protected Uri insertOrganization(long rawContactId, ContentValues values, boolean primary) { in insertOrganization() argument 237 return insertOrganization(rawContactId, values, primary, false); in insertOrganization() 240 protected Uri insertOrganization(long rawContactId, ContentValues values, boolean primary, in insertOrganization() argument 242 values.put(Data.RAW_CONTACT_ID, rawContactId); in insertOrganization() 256 protected Uri insertPhoneNumber(long rawContactId, String phoneNumber) { in insertPhoneNumber() argument 257 return insertPhoneNumber(rawContactId, phoneNumber, false); in insertPhoneNumber() 260 protected Uri insertPhoneNumber(long rawContactId, String phoneNumber, boolean primary) { in insertPhoneNumber() argument 261 return insertPhoneNumber(rawContactId, phoneNumber, primary, false, Phone.TYPE_HOME); in insertPhoneNumber() [all …]
|
D | ContactsProvider2Test.java | 957 long rawContactId = ContentUris.parseId(rowUri); in testRawContactsInsert() local 960 assertSelection(RawContacts.CONTENT_URI, values, RawContacts._ID, rawContactId); in testRawContactsInsert() 967 long rawContactId = RawContactUtil.createRawContactWithName(mResolver); in testDataDirectoryWithLookupUri() local 968 insertPhoneNumber(rawContactId, "555-GOOG-411"); in testDataDirectoryWithLookupUri() 969 insertEmail(rawContactId, "google@android.com"); in testDataDirectoryWithLookupUri() 971 long contactId = queryContactId(rawContactId); in testDataDirectoryWithLookupUri() 1128 long rawContactId = RawContactUtil.createRawContactWithName(mResolver, "John", "Doe"); in testDataInsert() local 1131 putDataValues(values, rawContactId); in testDataInsert() 1135 long contactId = queryContactId(rawContactId); in testDataInsert() 1143 Uri rawContactUri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId); in testDataInsert() [all …]
|
D | SqlInjectionDetectionTest.java | 46 long rawContactId = RawContactUtil.createRawContactWithName(mResolver, "Hot", "Tamale"); in testPhoneQueryValid() local 47 insertPhoneNumber(rawContactId, "555-123-4567"); in testPhoneQueryValid() 54 long rawContactId = RawContactUtil.createRawContactWithName(mResolver, "Hot", "Tamale"); in testPhoneQueryBadProjection() local 55 insertPhoneNumber(rawContactId, "555-123-4567"); in testPhoneQueryBadProjection() 62 long rawContactId = RawContactUtil.createRawContactWithName(mResolver, "Hot", "Tamale"); in testPhoneQueryBadSelection() local 63 insertPhoneNumber(rawContactId, "555-123-4567"); in testPhoneQueryBadSelection() 70 long rawContactId = RawContactUtil.createRawContactWithName(mResolver, "Hot", "Tamale"); in testPhoneQueryBadSortOrder() local 71 insertPhoneNumber(rawContactId, "555-123-4567"); in testPhoneQueryBadSortOrder() 79 long rawContactId = RawContactUtil.createRawContactWithName(mResolver, "Hot", "Tamale"); in testPhoneQueryBadLimit() local 80 insertPhoneNumber(rawContactId, "555-123-4567"); in testPhoneQueryBadLimit()
|
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ |
D | DataRowHandlerForGroupMembership.java | 75 public long insert(SQLiteDatabase db, TransactionContext txContext, long rawContactId, in insert() argument 77 resolveGroupSourceIdInValues(txContext, rawContactId, db, values, true); in insert() 78 long dataId = super.insert(db, txContext, rawContactId, values); in insert() 79 if (hasFavoritesGroupMembership(db, rawContactId)) { in insert() 80 updateRawContactsStar(db, rawContactId, true /* starred */); in insert() 82 updateVisibility(txContext, rawContactId); in insert() 89 long rawContactId = c.getLong(DataUpdateQuery.RAW_CONTACT_ID); in update() local 90 boolean wasStarred = hasFavoritesGroupMembership(db, rawContactId); in update() 91 resolveGroupSourceIdInValues(txContext, rawContactId, db, values, false); in update() 95 boolean isStarred = hasFavoritesGroupMembership(db, rawContactId); in update() [all …]
|
D | DataRowHandler.java | 112 public long insert(SQLiteDatabase db, TransactionContext txContext, long rawContactId, in insert() argument 123 mDbHelper.setIsPrimary(rawContactId, dataId, mimeTypeId); in insert() 124 txContext.markRawContactMetadataDirty(rawContactId, /* isMetadataSyncAdapter =*/false); in insert() 130 mDbHelper.setIsSuperPrimary(rawContactId, dataId, mimeTypeId); in insert() 132 mDbHelper.clearSuperPrimary(rawContactId, mimeTypeId); in insert() 137 if (mDbHelper.rawContactHasSuperPrimary(rawContactId, mimeTypeId)) { in insert() 138 mDbHelper.setIsSuperPrimary(rawContactId, dataId, mimeTypeId); in insert() 144 txContext.invalidateSearchIndexForRawContact(rawContactId); in insert() 160 long rawContactId = c.getLong(DataUpdateQuery.RAW_CONTACT_ID); in update() local 162 handlePrimaryAndSuperPrimary(txContext, values, dataId, rawContactId, in update() [all …]
|
D | TransactionContext.java | 57 public void rawContactInserted(long rawContactId, long accountId) { in rawContactInserted() argument 59 mInsertedRawContactsAccounts.put(rawContactId, accountId); in rawContactInserted() 61 markRawContactChangedOrDeletedOrInserted(rawContactId); in rawContactInserted() 64 public void rawContactUpdated(long rawContactId) { in rawContactUpdated() argument 66 mUpdatedRawContacts.add(rawContactId); in rawContactUpdated() 69 public void markRawContactDirtyAndChanged(long rawContactId, boolean isSyncAdapter) { in markRawContactDirtyAndChanged() argument 74 mDirtyRawContacts.add(rawContactId); in markRawContactDirtyAndChanged() 77 markRawContactChangedOrDeletedOrInserted(rawContactId); in markRawContactDirtyAndChanged() 80 public void markRawContactMetadataDirty(long rawContactId, boolean isMetadataSyncAdapter) { in markRawContactMetadataDirty() argument 85 mMetadataDirtyRawContacts.add(rawContactId); in markRawContactMetadataDirty() [all …]
|
D | DataRowHandlerForPhoneNumber.java | 42 public long insert(SQLiteDatabase db, TransactionContext txContext, long rawContactId, in insert() argument 46 final long dataId = super.insert(db, txContext, rawContactId, values); in insert() 50 updatePhoneLookup(db, rawContactId, dataId, number, normalizedNumber); in insert() 51 mContactAggregator.updateHasPhoneNumber(db, rawContactId); in insert() 52 fixRawContactDisplayName(db, txContext, rawContactId); in insert() 54 triggerAggregation(txContext, rawContactId); in insert() 70 long rawContactId = c.getLong(DataUpdateQuery.RAW_CONTACT_ID); in update() local 71 updatePhoneLookup(db, rawContactId, dataId, in update() 74 mContactAggregator.updateHasPhoneNumber(db, rawContactId); in update() 75 fixRawContactDisplayName(db, txContext, rawContactId); in update() [all …]
|
D | NameLookupBuilder.java | 82 protected abstract void insertNameLookup(long rawContactId, long dataId, int lookupType, in insertNameLookup() argument 99 public void insertNameLookup(long rawContactId, long dataId, String name, int fullNameStyle) { in insertNameLookup() argument 111 insertNameVariant(rawContactId, dataId, tokenCount, NameLookupType.NAME_EXACT, true); in insertNameLookup() 126 insertCollationKey(rawContactId, dataId, MAX_NAME_TOKENS); in insertNameLookup() 138 insertNameVariants(rawContactId, dataId, 0, tokenCount, !tooManyTokens, true); in insertNameLookup() 139 insertNicknamePermutations(rawContactId, dataId, 0, tokenCount); in insertNameLookup() 239 private void insertNameVariants(long rawContactId, long dataId, int fromIndex, int toIndex, in insertNameVariants() argument 242 insertNameVariant(rawContactId, dataId, toIndex, in insertNameVariants() 255 insertNameVariants(rawContactId, dataId, fromIndex + 1, toIndex, in insertNameVariants() 266 private void insertNameVariant(long rawContactId, long dataId, int tokenCount, in insertNameVariant() argument [all …]
|
D | DataRowHandlerForNickname.java | 39 public long insert(SQLiteDatabase db, TransactionContext txContext, long rawContactId, in insert() argument 43 long dataId = super.insert(db, txContext, rawContactId, values); in insert() 46 fixRawContactDisplayName(db, txContext, rawContactId); in insert() 47 mDbHelper.insertNameLookupForNickname(rawContactId, dataId, nickname); in insert() 48 triggerAggregation(txContext, rawContactId); in insert() 57 long rawContactId = c.getLong(DataUpdateQuery.RAW_CONTACT_ID); in update() local 66 mDbHelper.insertNameLookupForNickname(rawContactId, dataId, nickname); in update() 67 fixRawContactDisplayName(db, txContext, rawContactId); in update() 68 triggerAggregation(txContext, rawContactId); in update() 77 long rawContactId = c.getLong(DataDeleteQuery.RAW_CONTACT_ID); in delete() local [all …]
|
D | DataRowHandlerForEmail.java | 37 public long insert(SQLiteDatabase db, TransactionContext txContext, long rawContactId, in insert() argument 41 long dataId = super.insert(db, txContext, rawContactId, values); in insert() 43 fixRawContactDisplayName(db, txContext, rawContactId); in insert() 44 String address = mDbHelper.insertNameLookupForEmail(rawContactId, dataId, email); in insert() 46 triggerAggregation(txContext, rawContactId); in insert() 60 long rawContactId = c.getLong(DataUpdateQuery.RAW_CONTACT_ID); in update() local 64 mDbHelper.insertNameLookupForEmail(rawContactId, dataId, address); in update() 65 fixRawContactDisplayName(db, txContext, rawContactId); in update() 66 triggerAggregation(txContext, rawContactId); in update() 75 long rawContactId = c.getLong(DataDeleteQuery.RAW_CONTACT_ID); in delete() local [all …]
|
D | DataRowHandlerForIdentity.java | 35 public long insert(SQLiteDatabase db, TransactionContext txContext, long rawContactId, in insert() argument 37 final long dataId = super.insert(db, txContext, rawContactId, values); in insert() 41 triggerAggregation(txContext, rawContactId); in insert() 54 final long rawContactId = c.getLong(DataUpdateQuery.RAW_CONTACT_ID); in update() local 56 triggerAggregation(txContext, rawContactId); in update() 67 final long rawContactId = c.getLong(DataUpdateQuery.RAW_CONTACT_ID); in delete() local 68 triggerAggregation(txContext, rawContactId); in delete()
|
D | DataRowHandlerForStructuredName.java | 47 public long insert(SQLiteDatabase db, TransactionContext txContext, long rawContactId, in insert() argument 51 long dataId = super.insert(db, txContext, rawContactId, values); in insert() 55 mNameLookupBuilder.insertNameLookup(rawContactId, dataId, name, in insert() 59 fixRawContactDisplayName(db, txContext, rawContactId); in insert() 60 triggerAggregation(txContext, rawContactId); in insert() 68 final long rawContactId = c.getLong(DataUpdateQuery.RAW_CONTACT_ID); in update() local 83 mNameLookupBuilder.insertNameLookup(rawContactId, dataId, name, in update() 88 fixRawContactDisplayName(db, txContext, rawContactId); in update() 89 triggerAggregation(txContext, rawContactId); in update() 96 long rawContactId = c.getLong(DataDeleteQuery.RAW_CONTACT_ID); in delete() local [all …]
|
D | DataRowHandlerForPhoto.java | 58 public long insert(SQLiteDatabase db, TransactionContext txContext, long rawContactId, in insert() argument 70 long dataId = super.insert(db, txContext, rawContactId, values); in insert() 71 if (!txContext.isNewRawContact(rawContactId)) { in insert() 72 mContactAggregator.updatePhotoId(db, rawContactId); in insert() 80 long rawContactId = c.getLong(DataUpdateQuery.RAW_CONTACT_ID); in update() local 96 mContactAggregator.updatePhotoId(db, rawContactId); in update() 132 long rawContactId = c.getLong(DataDeleteQuery.RAW_CONTACT_ID); in delete() local 134 mContactAggregator.updatePhotoId(db, rawContactId); in delete()
|
/packages/providers/ContactsProvider/src/com/android/providers/contacts/aggregation/ |
D | ContactAggregator.java | 80 long rawContactId, long accountId, long currentContactId, in aggregateContact() argument 84 Log.v(TAG, "aggregateContact: rid=" + rawContactId + " cid=" + currentContactId); in aggregateContact() 89 Integer aggModeObject = mRawContactsMarkedForAggregation.remove(rawContactId); in aggregateContact() 104 contactId = pickBestMatchBasedOnExceptions(db, rawContactId, matcher); in aggregateContact() 111 contactId = pickBestMatchBasedOnData(db, rawContactId, candidates, matcher); in aggregateContact() 124 mSelectionArgs2[1] = String.valueOf(rawContactId); in aggregateContact() 155 actionCode = canJoinIntoContact(db, rawContactId, in aggregateContact() 175 mRawContactCountQuery.bindLong(2, rawContactId); in aggregateContact() 190 markAggregated(db, String.valueOf(rawContactId)); in aggregateContact() 196 createContactForRawContacts(db, txContext, Sets.newHashSet(rawContactId), null); in aggregateContact() [all …]
|
D | ContactAggregator2.java | 92 long rawContactId, long accountId, long currentContactId, in aggregateContact() argument 95 if (!needAggregate(db, rawContactId)) { in aggregateContact() 97 Log.v(TAG, "Skip rid=" + rawContactId + " which has already been aggregated."); in aggregateContact() 103 Log.v(TAG, "aggregateContact: rid=" + rawContactId + " cid=" + currentContactId); in aggregateContact() 108 Integer aggModeObject = mRawContactsMarkedForAggregation.remove(rawContactId); in aggregateContact() 121 matchingCandidates = findRawContactMatchingCandidates(db, rawContactId, candidates, in aggregateContact() 134 mRawContactCountQuery.bindLong(2, rawContactId); in aggregateContact() 169 markAggregated(db, String.valueOf(rawContactId)); in aggregateContact() 173 Log.v(TAG, "create new contact for rid=" + rawContactId); in aggregateContact() 175 createContactForRawContacts(db, txContext, Sets.newHashSet(rawContactId), null); in aggregateContact() [all …]
|
D | AbstractContactAggregator.java | 251 long rawContactId; field in AbstractContactAggregator.DisplayNameCandidate 262 rawContactId = -1; in clear() 448 for (long rawContactId : mRawContactsMarkedForAggregation.keySet()) { in aggregateInTransaction() 452 sbQuery.append(rawContactId); in aggregateInTransaction() 500 public final void triggerAggregation(TransactionContext txContext, long rawContactId) { in triggerAggregation() argument 505 int aggregationMode = mDbHelper.getAggregationMode(rawContactId); in triggerAggregation() 511 markForAggregation(rawContactId, aggregationMode, false); in triggerAggregation() 516 long contactId = mDbHelper.getContactId(rawContactId); in triggerAggregation() 525 aggregateContact(txContext, mDbHelper.getWritableDatabase(), rawContactId); in triggerAggregation() 537 public final void markNewForAggregation(long rawContactId, int aggregationMode) { in markNewForAggregation() argument [all …]
|
/packages/providers/ContactsProvider/src/com/android/providers/contacts/aggregation/util/ |
D | RawContactMatcher.java | 168 private MatchScore getMatchingScore(long rawContactId, long contactId, long accountId) { in getMatchingScore() argument 169 MatchScore matchingScore = mScores.get(rawContactId); in getMatchingScore() 173 matchingScore.reset(rawContactId, contactId, accountId); in getMatchingScore() 175 matchingScore = new MatchScore(rawContactId, contactId, accountId); in getMatchingScore() 179 mScores.put(rawContactId, matchingScore); in getMatchingScore() 191 public void matchName(long rawContactId, long contactId, long accountId, int in matchName() argument 199 updatePrimaryScore(rawContactId, contactId, accountId, maxScore); in matchName() 239 updatePrimaryScore(rawContactId, contactId, accountId, score); in matchName() 242 public void matchIdentity(long rawContactId, long contactId, long accountId) { in matchIdentity() argument 243 updateSecondaryScore(rawContactId, contactId, accountId, IDENTITY_MATCH_SCORE); in matchIdentity() [all …]
|
/packages/apps/ContactsCommon/src/com/android/contacts/common/model/ |
D | RawContactDeltaList.java | 109 final Long rawContactId = remoteEntity.getValues().getId(); in mergeAfter() local 112 final RawContactDelta localEntity = local.getByRawContactId(rawContactId); in mergeAfter() 136 final long rawContactId = this.findRawContactId(); in buildDiff() local 163 if (rawContactId != -1) { in buildDiff() 164 builder.withValue(AggregationExceptions.RAW_CONTACT_ID2, rawContactId); in buildDiff() 179 if (rawContactId != -1) { in buildDiff() 182 builder.withValue(AggregationExceptions.RAW_CONTACT_ID1, rawContactId); in buildDiff() 224 final long rawContactId = this.findRawContactId(); in buildDiffWrapper() local 251 if (rawContactId != -1) { in buildDiffWrapper() 252 builder.withValue(AggregationExceptions.RAW_CONTACT_ID2, rawContactId); in buildDiffWrapper() [all …]
|
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/testutil/ |
D | DataUtil.java | 45 public static Uri insertStructuredName(ContentResolver resolver, long rawContactId, in insertStructuredName() argument 47 values.put(ContactsContract.Data.RAW_CONTACT_ID, rawContactId); in insertStructuredName() 54 public static Uri insertStructuredName(ContentResolver resolver, long rawContactId, in insertStructuredName() argument 56 return insertStructuredName(resolver, rawContactId, givenName, familyName, in insertStructuredName() 61 ContentResolver resolver, long rawContactId, String givenName, String familyName, in insertStructuredName() argument 63 return insertStructuredName(resolver, rawContactId, givenName, familyName, phoneticFamily, in insertStructuredName() 68 ContentResolver resolver, long rawContactId, String givenName, String familyName, in insertStructuredName() argument 97 return insertStructuredName(resolver, rawContactId, values); in insertStructuredName() 100 public static Uri insertPhoneticName(ContentResolver resolver, long rawContactId, in insertPhoneticName() argument 106 return insertStructuredName(resolver, rawContactId, values); in insertPhoneticName()
|
D | DatabaseAsserts.java | 58 long rawContactId = RawContactUtil.createRawContactWithName(resolver); in assertAndCreateContact() local 60 long contactId = RawContactUtil.queryContactIdByRawContactId(resolver, rawContactId); in assertAndCreateContact() 63 return new ContactIdPair(contactId, rawContactId); in assertAndCreateContact() 73 long rawContactId = RawContactUtil.createRawContactWithName(resolver, firstName, lastName); in assertAndCreateContactWithName() local 75 long contactId = RawContactUtil.queryContactIdByRawContactId(resolver, rawContactId); in assertAndCreateContactWithName() 78 return new ContactIdPair(contactId, rawContactId); in assertAndCreateContactWithName() 105 public ContactIdPair(long contactId, long rawContactId) { in ContactIdPair() argument 107 this.mRawContactId = rawContactId; in ContactIdPair()
|
D | RawContactUtil.java | 38 public static void update(ContentResolver resolver, long rawContactId, in update() argument 40 Uri uri = ContentUris.withAppendedId(URI, rawContactId); in update() 45 long rawContactId, String[] projection) { in queryByRawContactId() argument 47 rawContactId); in queryByRawContactId() 64 public static void delete(ContentResolver resolver, long rawContactId, in delete() argument 66 Uri uri = ContentUris.withAppendedId(ContactsContract.RawContacts.CONTENT_URI, rawContactId) in delete() 125 long rawContactId = createRawContact(resolver, account); in createRawContactWithName() local 126 DataUtil.insertStructuredName(resolver, rawContactId, firstName, lastName); in createRawContactWithName() 127 return rawContactId; in createRawContactWithName()
|
/packages/experimental/LoaderApp/src/com/android/loaderapp/model/ |
D | EntitySet.java | 93 final Long rawContactId = remoteEntity.getValues().getId(); in mergeAfter() local 96 final EntityDelta localEntity = local.getByRawContactId(rawContactId); in mergeAfter() 117 final long rawContactId = this.findRawContactId(); in buildDiff() local 142 if (rawContactId != -1) { in buildDiff() 145 builder.withValue(AggregationExceptions.RAW_CONTACT_ID1, rawContactId); in buildDiff() 233 final Long rawContactId = delta.getValues().getAsLong(RawContacts._ID); in findRawContactId() local 234 if (rawContactId != null && rawContactId >= 0) { in findRawContactId() 235 return rawContactId; in findRawContactId() 255 public EntityDelta getByRawContactId(Long rawContactId) { in getByRawContactId() argument 256 final int index = this.indexOfRawContactId(rawContactId); in getByRawContactId() [all …]
|
/packages/apps/EmergencyInfo/tests/src/com/android/emergency/ |
D | ContactTestUtils.java | 69 long rawContactId = ContentUris.parseId(rawContactUri); in createContact() local 70 insertStructuredName(contentResolver, rawContactId, name, values); in createContact() 71 return insertPhoneNumber(contentResolver, rawContactId, in createContact() 77 long rawContactId, in insertStructuredName() argument 81 values.put(ContactsContract.Data.RAW_CONTACT_ID, rawContactId); in insertStructuredName() 87 long rawContactId, in insertPhoneNumber() argument 91 values.put(ContactsContract.Data.RAW_CONTACT_ID, rawContactId); in insertPhoneNumber()
|
/packages/apps/Contacts/src/com/android/contacts/ |
D | SplitAggregateView.java | 81 void onContactSelected(long rawContactId); in onContactSelected() argument 100 mListener.onContactSelected(list.get(position).rawContactId); in SplitAggregateView() 116 final long rawContactId; field in SplitAggregateView.RawContactInfo 124 public RawContactInfo(long rawContactId) { in RawContactInfo() argument 125 this.rawContactId = rawContactId; in RawContactInfo() 165 long rawContactId = cursor.getLong(SplitQuery.RAW_CONTACT_ID); in loadData() local 166 RawContactInfo info = rawContactInfos.get(rawContactId); in loadData() 168 info = new RawContactInfo(rawContactId); in loadData() 169 rawContactInfos.put(rawContactId, info); in loadData()
|