diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-01-12 02:48:25 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-01-12 02:48:25 +0000 |
commit | 6bd659e6e90346f58ed08f6c127835a320bbd2e4 (patch) | |
tree | b90e5f582dcab0d3ad6393f4ffbc7a4dd78e81dc /java/com/android/dialer/calllog/datasources/phonelookup | |
parent | 58bade2ace277dff4db3bbbfa2e07015f0f7c6ad (diff) | |
parent | 01aac5de58903555a089d16a58b9346d34d54e7b (diff) |
Merge changes I2e091371,I4e0bc1c6,I24063ee4
* changes:
Implement PhoneLookup for CP2 remote contacts
Merge PhoneLookupDataSource results into a proto in annotated call log.
Attempt to place call even call permission is missing
Diffstat (limited to 'java/com/android/dialer/calllog/datasources/phonelookup')
-rw-r--r-- | java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java b/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java index 30461a4be..b73c169b9 100644 --- a/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java +++ b/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java @@ -28,6 +28,7 @@ import android.text.TextUtils; import android.util.ArrayMap; import android.util.ArraySet; import com.android.dialer.DialerPhoneNumber; +import com.android.dialer.NumberAttributes; import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog; import com.android.dialer.calllog.datasources.CallLogDataSource; import com.android.dialer.calllog.datasources.CallLogMutations; @@ -286,13 +287,7 @@ public final class PhoneLookupDataSource @Override public ContentValues coalesce(List<ContentValues> individualRowsSortedByTimestampDesc) { return new RowCombiner(individualRowsSortedByTimestampDesc) - .useMostRecentString(AnnotatedCallLog.NAME) - .useMostRecentString(AnnotatedCallLog.NUMBER_TYPE_LABEL) - .useMostRecentString(AnnotatedCallLog.PHOTO_URI) - .useMostRecentLong(AnnotatedCallLog.PHOTO_ID) - .useMostRecentString(AnnotatedCallLog.LOOKUP_URI) - .useMostRecentInt(AnnotatedCallLog.CAN_REPORT_AS_INVALID_NUMBER) - .useMostRecentInt(AnnotatedCallLog.CP2_INFO_INCOMPLETE) + .useMostRecentBlob(AnnotatedCallLog.NUMBER_ATTRIBUTES) .combine(); } @@ -584,19 +579,20 @@ public final class PhoneLookupDataSource } private void updateContentValues(ContentValues contentValues, PhoneLookupInfo phoneLookupInfo) { - contentValues.put(AnnotatedCallLog.NAME, phoneLookupSelector.selectName(phoneLookupInfo)); contentValues.put( - AnnotatedCallLog.PHOTO_URI, phoneLookupSelector.selectPhotoUri(phoneLookupInfo)); - contentValues.put( - AnnotatedCallLog.PHOTO_ID, phoneLookupSelector.selectPhotoId(phoneLookupInfo)); - contentValues.put( - AnnotatedCallLog.LOOKUP_URI, phoneLookupSelector.selectLookupUri(phoneLookupInfo)); - contentValues.put( - AnnotatedCallLog.NUMBER_TYPE_LABEL, phoneLookupSelector.selectNumberLabel(phoneLookupInfo)); - contentValues.put( - AnnotatedCallLog.CAN_REPORT_AS_INVALID_NUMBER, - PhoneLookupSelector.canReportAsInvalidNumber(phoneLookupInfo)); - contentValues.put( - AnnotatedCallLog.CP2_INFO_INCOMPLETE, phoneLookupInfo.getCp2LocalInfo().getIsIncomplete()); + AnnotatedCallLog.NUMBER_ATTRIBUTES, + NumberAttributes.newBuilder() + .setName(phoneLookupSelector.selectName(phoneLookupInfo)) + .setPhotoUri(phoneLookupSelector.selectPhotoUri(phoneLookupInfo)) + .setPhotoId(phoneLookupSelector.selectPhotoId(phoneLookupInfo)) + .setLookupUri(phoneLookupSelector.selectLookupUri(phoneLookupInfo)) + .setNumberTypeLabel(phoneLookupSelector.selectNumberLabel(phoneLookupInfo)) + .setIsBusiness(phoneLookupSelector.selectIsBusiness(phoneLookupInfo)) + .setIsVoicemail(phoneLookupSelector.selectIsVoicemail(phoneLookupInfo)) + .setCanReportAsInvalidNumber( + phoneLookupSelector.canReportAsInvalidNumber(phoneLookupInfo)) + .setIsCp2InfoIncomplete(phoneLookupSelector.selectIsCp2InfoIncomplete(phoneLookupInfo)) + .build() + .toByteArray()); } } |