diff options
author | linyuh <linyuh@google.com> | 2018-06-15 13:31:28 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-18 13:20:17 -0700 |
commit | 8f1fbd77f64fdf376e70dd3e7de3c8eb5d9cfbf9 (patch) | |
tree | e212342f4a8b8a4e29c52c8df34225a1fb11a0b5 /java/com/android/dialer/calllog/datasources/systemcalllog | |
parent | eed866a9b6bf32cb81e62fc94b94cd3242895c76 (diff) |
Improve Coalescer performance
Bug: 77813585
Test: CoalescerTest
PiperOrigin-RevId: 200764878
Change-Id: I7e3d9c3b4eab1e5de12a108b82c04704550c8c5e
Diffstat (limited to 'java/com/android/dialer/calllog/datasources/systemcalllog')
-rw-r--r-- | java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java index 1b66f5099..7a12bc4ba 100644 --- a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java +++ b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java @@ -41,7 +41,6 @@ import com.android.dialer.calllog.database.AnnotatedCallLogDatabaseHelper; import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog; import com.android.dialer.calllog.datasources.CallLogDataSource; import com.android.dialer.calllog.datasources.CallLogMutations; -import com.android.dialer.calllog.datasources.util.RowCombiner; import com.android.dialer.calllog.observer.MarkDirtyObserver; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; @@ -231,39 +230,6 @@ public class SystemCallLogDataSource implements CallLogDataSource { return null; } - @Override - public ContentValues coalesce(List<ContentValues> individualRowsSortedByTimestampDesc) { - assertNoVoicemailsInRows(individualRowsSortedByTimestampDesc); - - return new RowCombiner(individualRowsSortedByTimestampDesc) - .useMostRecentLong(AnnotatedCallLog.TIMESTAMP) - .useMostRecentLong(AnnotatedCallLog.NEW) - .useMostRecentLong(AnnotatedCallLog.IS_READ) - // 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) - .useSingleValueInt(AnnotatedCallLog.NUMBER_PRESENTATION) - .useMostRecentString(AnnotatedCallLog.GEOCODED_LOCATION) - .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME) - .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_ID) - .useMostRecentLong(AnnotatedCallLog.CALL_TYPE) - // If any call in a group includes a feature (like Wifi/HD), consider the group to have the - // feature. - .bitwiseOr(AnnotatedCallLog.FEATURES) - .combine(); - } - - private void assertNoVoicemailsInRows(List<ContentValues> individualRowsSortedByTimestampDesc) { - for (ContentValues contentValue : individualRowsSortedByTimestampDesc) { - if (contentValue.getAsLong(AnnotatedCallLog.CALL_TYPE) != null) { - Assert.checkArgument( - contentValue.getAsLong(AnnotatedCallLog.CALL_TYPE) != Calls.VOICEMAIL_TYPE); - } - } - } - @TargetApi(Build.VERSION_CODES.N) // Uses try-with-resources private void handleInsertsAndUpdates( Context appContext, CallLogMutations mutations, Set<Long> existingAnnotatedCallLogIds) { |