diff options
author | Zachary Heidepriem <zachh@google.com> | 2017-10-12 01:29:20 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-12 01:29:20 +0000 |
commit | 306bb488847ebd58c31e2144ba8c558544403048 (patch) | |
tree | d06792cffc3d7a377631796a2ca85a99ae7b43b6 /java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java | |
parent | 71064e2aa5b3c6b24e27095f0bc1a2d940d58d05 (diff) | |
parent | 2633778c274746a35e4a54266a3319c53fd1cded (diff) |
Merge "Added basic bottom sheet to new call log."
am: 2633778c27
Change-Id: Id6b9f75c0cf3c42b28a0c44d75c10d9c80853936
Diffstat (limited to 'java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java')
-rw-r--r-- | java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java index d6ad618b3..0a965f63e 100644 --- a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java +++ b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java @@ -38,6 +38,7 @@ import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.text.TextUtils; import android.util.ArraySet; +import com.android.dialer.DialerPhoneNumber; import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog; import com.android.dialer.calllog.datasources.CallLogDataSource; import com.android.dialer.calllog.datasources.CallLogMutations; @@ -156,11 +157,17 @@ public class SystemCallLogDataSource implements CallLogDataSource { .useMostRecentLong(AnnotatedCallLog.NEW) .useMostRecentString(AnnotatedCallLog.NUMBER_TYPE_LABEL) .useMostRecentString(AnnotatedCallLog.NAME) + // Two different DialerPhoneNumbers could be combined if they are different but considered + // to be an "exact match" by libphonenumber; in this case we arbitrarily select the most + // recent one. + .useMostRecentBlob(AnnotatedCallLog.NUMBER) .useMostRecentString(AnnotatedCallLog.FORMATTED_NUMBER) .useMostRecentString(AnnotatedCallLog.PHOTO_URI) .useMostRecentLong(AnnotatedCallLog.PHOTO_ID) .useMostRecentString(AnnotatedCallLog.LOOKUP_URI) .useMostRecentString(AnnotatedCallLog.GEOCODED_LOCATION) + .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME) + .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_ID) .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_LABEL) .useSingleValueLong(AnnotatedCallLog.PHONE_ACCOUNT_COLOR) .useMostRecentLong(AnnotatedCallLog.CALL_TYPE) @@ -272,10 +279,14 @@ public class SystemCallLogDataSource implements CallLogDataSource { dialerPhoneNumberUtil.parse(numberAsStr, countryIso).toByteArray(); // TODO(zachh): Need to handle post-dial digits; different on N and M. contentValues.put(AnnotatedCallLog.NUMBER, numberAsProtoBytes); + } else { + contentValues.put( + AnnotatedCallLog.NUMBER, DialerPhoneNumber.getDefaultInstance().toByteArray()); } contentValues.put(AnnotatedCallLog.CALL_TYPE, type); contentValues.put(AnnotatedCallLog.NAME, cachedName); + // TODO(zachh): Format the number using DialerPhoneNumberUtil here. contentValues.put(AnnotatedCallLog.FORMATTED_NUMBER, formattedNumber); contentValues.put(AnnotatedCallLog.PHOTO_URI, cachedPhotoUri); contentValues.put(AnnotatedCallLog.PHOTO_ID, cachedPhotoId); @@ -292,6 +303,9 @@ public class SystemCallLogDataSource implements CallLogDataSource { contentValues.put(AnnotatedCallLog.IS_READ, isRead); contentValues.put(AnnotatedCallLog.NEW, isNew); contentValues.put(AnnotatedCallLog.GEOCODED_LOCATION, geocodedLocation); + contentValues.put( + AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME, phoneAccountComponentName); + contentValues.put(AnnotatedCallLog.PHONE_ACCOUNT_ID, phoneAccountId); populatePhoneAccountLabelAndColor( appContext, contentValues, phoneAccountComponentName, phoneAccountId); contentValues.put(AnnotatedCallLog.FEATURES, features); |