summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllog/datasources/util/RowCombiner.java
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2018-01-26 10:56:46 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-26 12:13:04 -0800
commit03b13198537df025febb842db7f95794a1faad8f (patch)
tree2e013c45154e63429d9c4db817d07d3e79a06658 /java/com/android/dialer/calllog/datasources/util/RowCombiner.java
parent268aed51f835788ef44329db50b62b34215b9203 (diff)
Added number presentation to AnnotatedCallLog.
Updated the new call log UI to properly show text based on the presentation. Bug: 70989592 Test: unit PiperOrigin-RevId: 183414195 Change-Id: I2123f37cd3c733060125b6e894c1a80be4193ad6
Diffstat (limited to 'java/com/android/dialer/calllog/datasources/util/RowCombiner.java')
-rw-r--r--java/com/android/dialer/calllog/datasources/util/RowCombiner.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/java/com/android/dialer/calllog/datasources/util/RowCombiner.java b/java/com/android/dialer/calllog/datasources/util/RowCombiner.java
index 6e33db51e..2bb65cc3e 100644
--- a/java/com/android/dialer/calllog/datasources/util/RowCombiner.java
+++ b/java/com/android/dialer/calllog/datasources/util/RowCombiner.java
@@ -80,6 +80,18 @@ public class RowCombiner {
return this;
}
+ /** Asserts that all column values for the given column name are the same, and uses it. */
+ public RowCombiner useSingleValueInt(String columnName) {
+ Iterator<ContentValues> iterator = individualRowsSortedByTimestampDesc.iterator();
+ Integer singleValue = iterator.next().getAsInteger(columnName);
+ while (iterator.hasNext()) {
+ Integer current = iterator.next().getAsInteger(columnName);
+ Assert.checkState(Objects.equals(singleValue, current), "Values different for " + columnName);
+ }
+ combinedRow.put(columnName, singleValue);
+ return this;
+ }
+
/** Performs a bitwise OR on the specified column and yields the result. */
public RowCombiner bitwiseOr(String columnName) {
int combinedValue = 0;