summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/calllog/CallLogGroupBuilder.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/com/android/dialer/calllog/CallLogGroupBuilder.java b/src/com/android/dialer/calllog/CallLogGroupBuilder.java
index 4cf2d07cd..5eea096b8 100644
--- a/src/com/android/dialer/calllog/CallLogGroupBuilder.java
+++ b/src/com/android/dialer/calllog/CallLogGroupBuilder.java
@@ -24,6 +24,7 @@ import android.text.TextUtils;
import com.android.contacts.common.util.DateUtils;
import com.android.contacts.common.util.PhoneNumberHelper;
+import com.android.dialer.util.AppCompatConstants;
import com.google.common.annotations.VisibleForTesting;
@@ -145,10 +146,11 @@ public class CallLogGroupBuilder {
final boolean isSameAccount = isSameAccount(
groupAccountComponentName, accountComponentName, groupAccountId, accountId);
- // Group with the same number and account which are not voicemail.
- if (isSameNumber && isSameAccount
- && (callType != Calls.VOICEMAIL_TYPE)
- && (groupCallType != Calls.VOICEMAIL_TYPE)) {
+ // Group with the same number and account. Never group voicemails. Only group blocked
+ // calls with other blocked calls.
+ if (isSameNumber && isSameAccount && areBothNotVoicemail(callType, groupCallType)
+ && (areBothNotBlocked(callType, groupCallType)
+ || areBothBlocked(callType, groupCallType))) {
// Increment the size of the group to include the current call, but do not create
// the group until finding a call that does not match.
groupSize++;
@@ -240,4 +242,19 @@ public class CallLogGroupBuilder {
return DAY_GROUP_OTHER;
}
}
+
+ private boolean areBothNotVoicemail(int callType, int groupCallType) {
+ return callType != AppCompatConstants.CALLS_VOICEMAIL_TYPE
+ && groupCallType != AppCompatConstants.CALLS_VOICEMAIL_TYPE;
+ }
+
+ private boolean areBothNotBlocked(int callType, int groupCallType) {
+ return callType != AppCompatConstants.CALLS_BLOCKED_TYPE
+ && groupCallType != AppCompatConstants.CALLS_BLOCKED_TYPE;
+ }
+
+ private boolean areBothBlocked(int callType, int groupCallType) {
+ return callType == AppCompatConstants.CALLS_BLOCKED_TYPE
+ && groupCallType == AppCompatConstants.CALLS_BLOCKED_TYPE;
+ }
}