From a46ed83a7ccba16bbfd791a3a6588d5f0add9526 Mon Sep 17 00:00:00 2001 From: Brad Ebinger Date: Wed, 30 Mar 2016 18:24:42 -0700 Subject: Add via number to CallLog Account entry Call Log now provides the phone number that an incoming call was received on if that number is different than the SIM subscription number. This "via number" is appended to the Phone Account of the Call Log entry in Dialer if it exists. Screenshots: - One PhoneAccount: http://screen/HuCSL0U6jU6.png - Multiple PhoneAccounts: http://screen/pDg8F9zpMei.png Bug: 25594198 Change-Id: I8c05ea98409e54d20493fbdb20096bf851480719 --- src/com/android/dialer/calllog/CallLogGroupBuilder.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/com/android/dialer/calllog/CallLogGroupBuilder.java') diff --git a/src/com/android/dialer/calllog/CallLogGroupBuilder.java b/src/com/android/dialer/calllog/CallLogGroupBuilder.java index 0931e0644..aa45029c0 100644 --- a/src/com/android/dialer/calllog/CallLogGroupBuilder.java +++ b/src/com/android/dialer/calllog/CallLogGroupBuilder.java @@ -125,6 +125,8 @@ public class CallLogGroupBuilder { String groupNumber = cursor.getString(CallLogQuery.NUMBER); String groupPostDialDigits = CompatUtils.isNCompatible() ? cursor.getString(CallLogQuery.POST_DIAL_DIGITS) : ""; + String groupViaNumbers = CompatUtils.isNCompatible() + ? cursor.getString(CallLogQuery.VIA_NUMBER) : ""; int groupCallType = cursor.getInt(CallLogQuery.CALL_TYPE); String groupAccountComponentName = cursor.getString(CallLogQuery.ACCOUNT_COMPONENT_NAME); String groupAccountId = cursor.getString(CallLogQuery.ACCOUNT_ID); @@ -132,6 +134,7 @@ public class CallLogGroupBuilder { String number; String numberPostDialDigits; + String numberViaNumbers; int callType; String accountComponentName; String accountId; @@ -141,18 +144,21 @@ public class CallLogGroupBuilder { number = cursor.getString(CallLogQuery.NUMBER); numberPostDialDigits = CompatUtils.isNCompatible() ? cursor.getString(CallLogQuery.POST_DIAL_DIGITS) : ""; + numberViaNumbers = CompatUtils.isNCompatible() + ? cursor.getString(CallLogQuery.VIA_NUMBER) : ""; callType = cursor.getInt(CallLogQuery.CALL_TYPE); accountComponentName = cursor.getString(CallLogQuery.ACCOUNT_COMPONENT_NAME); accountId = cursor.getString(CallLogQuery.ACCOUNT_ID); final boolean isSameNumber = equalNumbers(groupNumber, number); final boolean isSamePostDialDigits = groupPostDialDigits.equals(numberPostDialDigits); + final boolean isSameViaNumbers = groupViaNumbers.equals(numberViaNumbers); final boolean isSameAccount = isSameAccount( groupAccountComponentName, accountComponentName, groupAccountId, accountId); // Group with the same number and account. Never group voicemails. Only group blocked // calls with other blocked calls. - if (isSameNumber && isSameAccount && isSamePostDialDigits + if (isSameNumber && isSameAccount && isSamePostDialDigits && isSameViaNumbers && areBothNotVoicemail(callType, groupCallType) && (areBothNotBlocked(callType, groupCallType) || areBothBlocked(callType, groupCallType))) { @@ -174,6 +180,7 @@ public class CallLogGroupBuilder { // Update the group values to those of the current call. groupNumber = number; groupPostDialDigits = numberPostDialDigits; + groupViaNumbers = numberViaNumbers; groupCallType = callType; groupAccountComponentName = accountComponentName; groupAccountId = accountId; -- cgit v1.2.3