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/database/Coalescer.java | |
parent | ae140ba6eee4164f6856d33635cc15414c2db40b (diff) | |
parent | f212de674ed1678aa35a5c72e041e82e1f38dce6 (diff) |
Merge "Add assisted dialing to the new call log."
Diffstat (limited to 'java/com/android/dialer/calllog/database/Coalescer.java')
-rw-r--r-- | java/com/android/dialer/calllog/database/Coalescer.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/java/com/android/dialer/calllog/database/Coalescer.java b/java/com/android/dialer/calllog/database/Coalescer.java index 71052b907..f4ef02a25 100644 --- a/java/com/android/dialer/calllog/database/Coalescer.java +++ b/java/com/android/dialer/calllog/database/Coalescer.java @@ -29,6 +29,7 @@ import com.android.dialer.calllog.datasources.CallLogDataSource; import com.android.dialer.calllog.datasources.DataSources; import com.android.dialer.calllogutils.PhoneAccountUtils; import com.android.dialer.common.Assert; +import com.android.dialer.compat.telephony.TelephonyManagerCompat; import com.android.dialer.phonenumberproto.DialerPhoneNumberUtil; import com.google.common.base.Preconditions; import com.google.i18n.phonenumbers.PhoneNumberUtil; @@ -171,10 +172,31 @@ public class Coalescer { // An empty number should not be combined with any other number. return false; } + + if (!meetsAssistedDialingCriteria(row1, row2)) { + return false; + } return dialerPhoneNumberUtil.isExactMatch(number1, number2); } /** + * Returns a boolean indicating whether or not FEATURES_ASSISTED_DIALING is mutually exclusive + * between two rows. + */ + 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; + } + + /** * Delegates to data sources to aggregate individual columns to create a new coalesced row. * * @param individualRows {@link AnnotatedCallLog} rows sorted by timestamp descending |