summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-10-04 16:48:55 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-10-04 16:48:55 +0000
commitbc07ed7f31845b0565990999e90510c90e8dad9b (patch)
treeade09fe638ed0dc2bf65bd64fa6d68a4e51a0b82 /java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java
parent69ff7c1717c363027a79a454da91e1ca59c1dd3e (diff)
parent5ee0b1e574ed93c7000e355e4a6b03fb9ed8aaba (diff)
Merge changes Ibf79b70e,Iab1415b0
* changes: Only show the most recent call type icon in the new call log, instead of the last 3. Make incoming and ongoing call notification foreground and highest priority.
Diffstat (limited to 'java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java')
-rw-r--r--java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java42
1 files changed, 15 insertions, 27 deletions
diff --git a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java
index 1bdbb8a1b..d6ad618b3 100644
--- a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java
+++ b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java
@@ -38,9 +38,7 @@ import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.text.TextUtils;
import android.util.ArraySet;
-import com.android.dialer.CallTypes;
import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog;
-import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.CoalescedAnnotatedCallLog;
import com.android.dialer.calllog.datasources.CallLogDataSource;
import com.android.dialer.calllog.datasources.CallLogMutations;
import com.android.dialer.calllog.datasources.util.RowCombiner;
@@ -153,30 +151,20 @@ public class SystemCallLogDataSource implements CallLogDataSource {
@Override
public ContentValues coalesce(List<ContentValues> individualRowsSortedByTimestampDesc) {
// TODO(zachh): Complete implementation.
- ContentValues coalescedValues =
- new RowCombiner(individualRowsSortedByTimestampDesc)
- .useMostRecentLong(AnnotatedCallLog.TIMESTAMP)
- .useMostRecentLong(AnnotatedCallLog.NEW)
- .useMostRecentString(AnnotatedCallLog.NUMBER_TYPE_LABEL)
- .useMostRecentString(AnnotatedCallLog.NAME)
- .useMostRecentString(AnnotatedCallLog.FORMATTED_NUMBER)
- .useMostRecentString(AnnotatedCallLog.PHOTO_URI)
- .useMostRecentLong(AnnotatedCallLog.PHOTO_ID)
- .useMostRecentString(AnnotatedCallLog.LOOKUP_URI)
- .useMostRecentString(AnnotatedCallLog.GEOCODED_LOCATION)
- .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_LABEL)
- .useSingleValueLong(AnnotatedCallLog.PHONE_ACCOUNT_COLOR)
- .combine();
-
- CallTypes.Builder callTypes = CallTypes.newBuilder();
- // Store a maximum of 3 call types since that's all we show to users via icons.
- for (int i = 0; i < 3 && i < individualRowsSortedByTimestampDesc.size(); i++) {
- callTypes.addType(
- individualRowsSortedByTimestampDesc.get(i).getAsInteger(AnnotatedCallLog.TYPE));
- }
- coalescedValues.put(CoalescedAnnotatedCallLog.CALL_TYPES, callTypes.build().toByteArray());
-
- return coalescedValues;
+ return new RowCombiner(individualRowsSortedByTimestampDesc)
+ .useMostRecentLong(AnnotatedCallLog.TIMESTAMP)
+ .useMostRecentLong(AnnotatedCallLog.NEW)
+ .useMostRecentString(AnnotatedCallLog.NUMBER_TYPE_LABEL)
+ .useMostRecentString(AnnotatedCallLog.NAME)
+ .useMostRecentString(AnnotatedCallLog.FORMATTED_NUMBER)
+ .useMostRecentString(AnnotatedCallLog.PHOTO_URI)
+ .useMostRecentLong(AnnotatedCallLog.PHOTO_ID)
+ .useMostRecentString(AnnotatedCallLog.LOOKUP_URI)
+ .useMostRecentString(AnnotatedCallLog.GEOCODED_LOCATION)
+ .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_LABEL)
+ .useSingleValueLong(AnnotatedCallLog.PHONE_ACCOUNT_COLOR)
+ .useMostRecentLong(AnnotatedCallLog.CALL_TYPE)
+ .combine();
}
@TargetApi(Build.VERSION_CODES.M) // Uses try-with-resources
@@ -286,7 +274,7 @@ public class SystemCallLogDataSource implements CallLogDataSource {
contentValues.put(AnnotatedCallLog.NUMBER, numberAsProtoBytes);
}
- contentValues.put(AnnotatedCallLog.TYPE, type);
+ contentValues.put(AnnotatedCallLog.CALL_TYPE, type);
contentValues.put(AnnotatedCallLog.NAME, cachedName);
contentValues.put(AnnotatedCallLog.FORMATTED_NUMBER, formattedNumber);
contentValues.put(AnnotatedCallLog.PHOTO_URI, cachedPhotoUri);