diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-04-04 01:43:18 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-04 01:43:18 +0000 |
commit | d5408c9423f20bef650ca838ff66bb5ecf60f818 (patch) | |
tree | d71a3bf4606c11bcf0ce9f2dc2266b5533561c0b /java/com/android/dialer/calllog/database/Coalescer.java | |
parent | c81fbd75f18621d7ce68c8df65cc468efe6ffe23 (diff) | |
parent | 01b782754418aa17dbb867591642b49e473e92b1 (diff) |
Merge changes I28244a72,Ic984f958,I5dc2bed7,I1be427b3,I0220a342, ...
* changes:
Remove reference to RTT system setting.
Fix the button style of RTT request dialog.
Don't deadlock in DialerDatabaseHelper.
Fix NPE for details number
Per linguists' request, increase CHAR_LIMIT of "Carrier video" from 30 to 31.
Fix permission
Handle missed calls for new call log in old peer.
Separate calls with the video feature from others when coalescing rows in the new call log.
Support placing Duo calls in the new UI's bottom sheet.
Turn off component generating step of RootComponentGenerato and @DialerCompoennt. Delete related tests.
Implement dialog for responding RTT request.
Diffstat (limited to 'java/com/android/dialer/calllog/database/Coalescer.java')
-rw-r--r-- | java/com/android/dialer/calllog/database/Coalescer.java | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/java/com/android/dialer/calllog/database/Coalescer.java b/java/com/android/dialer/calllog/database/Coalescer.java index ed09eea68..6b1a9e1f5 100644 --- a/java/com/android/dialer/calllog/database/Coalescer.java +++ b/java/com/android/dialer/calllog/database/Coalescer.java @@ -18,6 +18,7 @@ package com.android.dialer.calllog.database; import android.content.ContentValues; import android.database.Cursor; import android.database.MatrixCursor; +import android.provider.CallLog.Calls; import android.support.annotation.NonNull; import android.support.annotation.WorkerThread; import android.telecom.PhoneAccountHandle; @@ -151,7 +152,6 @@ public class Coalescer { TelecomUtil.composePhoneAccountHandle( row2.getAsString(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME), row2.getAsString(AnnotatedCallLog.PHONE_ACCOUNT_ID)); - if (!Objects.equals(phoneAccount1, phoneAccount2)) { return false; } @@ -161,7 +161,7 @@ public class Coalescer { return false; } - if (!meetsAssistedDialingCriteria(row1, row2)) { + if (!meetsCallFeatureCriteria(row1, row2)) { return false; } @@ -185,20 +185,25 @@ public class Coalescer { } /** - * Returns a boolean indicating whether or not FEATURES_ASSISTED_DIALING is mutually exclusive - * between two rows. + * Returns true if column {@link AnnotatedCallLog#FEATURES} of the two given rows indicate that + * they can be coalesced. */ - private static boolean meetsAssistedDialingCriteria(ContentValues row1, ContentValues row2) { - int row1Assisted = - row1.getAsInteger(AnnotatedCallLog.FEATURES) - & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING; - int row2Assisted = - row2.getAsInteger(AnnotatedCallLog.FEATURES) - & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING; - - // FEATURES_ASSISTED_DIALING should not be combined with calls that are - // !FEATURES_ASSISTED_DIALING - return row1Assisted == row2Assisted; + private static boolean meetsCallFeatureCriteria(ContentValues row1, ContentValues row2) { + int row1Features = row1.getAsInteger(AnnotatedCallLog.FEATURES); + int row2Features = row2.getAsInteger(AnnotatedCallLog.FEATURES); + + // A row with FEATURES_ASSISTED_DIALING should not be combined with one without it. + if ((row1Features & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING) + != (row2Features & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING)) { + return false; + } + + // A video call should not be combined with one that is not a video call. + if ((row1Features & Calls.FEATURES_VIDEO) != (row2Features & Calls.FEATURES_VIDEO)) { + return false; + } + + return true; } /** |