diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-01-03 02:41:22 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-01-03 02:41:22 +0000 |
commit | 15fd7535818344e905745b390a1b4098ca4d2cf1 (patch) | |
tree | 484de8c21bcfd61f299013a318d915cd2f29bcb1 /java/com/android/dialer/calllog/datasources | |
parent | ae140ba6eee4164f6856d33635cc15414c2db40b (diff) | |
parent | f212de674ed1678aa35a5c72e041e82e1f38dce6 (diff) |
Merge "Add assisted dialing to the new call log."
Diffstat (limited to 'java/com/android/dialer/calllog/datasources')
-rw-r--r-- | java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java | 3 | ||||
-rw-r--r-- | java/com/android/dialer/calllog/datasources/util/RowCombiner.java | 10 |
2 files changed, 13 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 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; } |