summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-12-08 19:56:09 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-12-08 19:56:09 +0000
commitae916b9c3304621d4733e53a081df8c384c6a868 (patch)
tree913c4b07fffd2b9eb99ff1f530e050be3471f8f3 /java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java
parentc9d21e15e6bd69496b6de3a1e4168d96d0132975 (diff)
parentafb1d0fa6c9421a8a26c8ad9c5630a3f6f34a8f0 (diff)
Merge "In the coalesced call log, replace column NUMBER_CALLS with a new column COALESCED_IDS."
Diffstat (limited to 'java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java')
-rw-r--r--java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java b/java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java
index 9f635439a..8aefb1a74 100644
--- a/java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java
+++ b/java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java
@@ -19,6 +19,7 @@ package com.android.dialer.calllog.ui;
import android.content.Context;
import android.database.Cursor;
import android.support.v4.content.CursorLoader;
+import com.android.dialer.CoalescedIds;
import com.android.dialer.DialerPhoneNumber;
import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.CoalescedAnnotatedCallLog;
import com.android.dialer.calllog.model.CoalescedRow;
@@ -48,7 +49,7 @@ final class CoalescedAnnotatedCallLogCursorLoader extends CursorLoader {
private static final int IS_BUSINESS = 17;
private static final int IS_VOICEMAIL = 18;
private static final int CALL_TYPE = 19;
- private static final int NUMBER_CALLS = 20;
+ private static final int COALESCED_IDS = 20;
CoalescedAnnotatedCallLogCursorLoader(Context context) {
// CoalescedAnnotatedCallLog requires that PROJECTION be ALL_COLUMNS and the following params be
@@ -71,6 +72,13 @@ final class CoalescedAnnotatedCallLogCursorLoader extends CursorLoader {
throw new IllegalStateException("Couldn't parse DialerPhoneNumber bytes");
}
+ CoalescedIds coalescedIds;
+ try {
+ coalescedIds = CoalescedIds.parseFrom(cursor.getBlob(COALESCED_IDS));
+ } catch (InvalidProtocolBufferException e) {
+ throw new IllegalStateException("Couldn't parse CoalescedIds bytes");
+ }
+
return CoalescedRow.builder()
.setId(cursor.getInt(ID))
.setTimestamp(cursor.getLong(TIMESTAMP))
@@ -92,7 +100,7 @@ final class CoalescedAnnotatedCallLogCursorLoader extends CursorLoader {
.setIsBusiness(cursor.getInt(IS_BUSINESS) == 1)
.setIsVoicemail(cursor.getInt(IS_VOICEMAIL) == 1)
.setCallType(cursor.getInt(CALL_TYPE))
- .setNumberCalls(cursor.getInt(NUMBER_CALLS))
+ .setCoalescedIds(coalescedIds)
.build();
}