From f212de674ed1678aa35a5c72e041e82e1f38dce6 Mon Sep 17 00:00:00 2001 From: erfanian Date: Tue, 2 Jan 2018 16:46:00 -0800 Subject: Add assisted dialing to the new call log. Bug: 70506228 Test: new unit tests PiperOrigin-RevId: 180610636 Change-Id: I7f498df1a529737bf8473584836bdc3e04a5043c --- .../datasources/systemcalllog/SystemCallLogDataSource.java | 3 +++ .../android/dialer/calllog/datasources/util/RowCombiner.java | 10 ++++++++++ 2 files changed, 13 insertions(+) (limited to 'java/com/android/dialer/calllog/datasources') diff --git a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java index 95fbf9d04..5edc46a0a 100644 --- a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java +++ b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java @@ -199,6 +199,9 @@ public class SystemCallLogDataSource implements CallLogDataSource { .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_LABEL) .useSingleValueLong(AnnotatedCallLog.PHONE_ACCOUNT_COLOR) .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(); } diff --git a/java/com/android/dialer/calllog/datasources/util/RowCombiner.java b/java/com/android/dialer/calllog/datasources/util/RowCombiner.java index 8e9e9c659..ebb1ba665 100644 --- a/java/com/android/dialer/calllog/datasources/util/RowCombiner.java +++ b/java/com/android/dialer/calllog/datasources/util/RowCombiner.java @@ -73,6 +73,16 @@ public class RowCombiner { return this; } + /** Performs a bitwise OR on the specified column and yields the result. */ + public RowCombiner bitwiseOr(String columnName) { + int combinedValue = 0; + for (ContentValues val : individualRowsSortedByTimestampDesc) { + combinedValue |= val.getAsInteger(columnName); + } + combinedRow.put(columnName, combinedValue); + return this; + } + public ContentValues combine() { return combinedRow; } -- cgit v1.2.3