diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-04-04 23:56:31 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-04 23:56:31 +0000 |
commit | 9f14cd7ee2e46185f80ce9c364b22687a1d651ff (patch) | |
tree | d2efff2512c24fa05f9fd87c383d4da3f89d4fe9 /java/com/android/dialer/calllog/ui/menu/Modules.java | |
parent | d5408c9423f20bef650ca838ff66bb5ecf60f818 (diff) | |
parent | 612d13a1295afb0f0b9e8217fc0efb211836c949 (diff) |
Merge changes If1ae5505,I65e9c6ac,I1a72ca86,I417b46ed,I60f97924
* changes:
Better support for multi call.
Migrate RTT chat history to use proto buffer.
Disable RTT request button when the call is not active yet.
Use the default phone account for a voice call when the call log item is for Duo.
Explicitly hide the badge in ContactPhotoView when it shouldn't be shown.
Diffstat (limited to 'java/com/android/dialer/calllog/ui/menu/Modules.java')
-rw-r--r-- | java/com/android/dialer/calllog/ui/menu/Modules.java | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/java/com/android/dialer/calllog/ui/menu/Modules.java b/java/com/android/dialer/calllog/ui/menu/Modules.java index e316f66b5..e0a69ca85 100644 --- a/java/com/android/dialer/calllog/ui/menu/Modules.java +++ b/java/com/android/dialer/calllog/ui/menu/Modules.java @@ -18,6 +18,7 @@ package com.android.dialer.calllog.ui.menu; import android.content.Context; import android.provider.CallLog.Calls; +import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.text.TextUtils; import com.android.dialer.blockreportspam.BlockReportSpamDialogInfo; @@ -123,10 +124,21 @@ final class Modules { return Collections.emptyList(); } - List<HistoryItemActionModule> modules = new ArrayList<>(); + boolean isDuoCall = + DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME + .flattenToString() + .equals(row.getPhoneAccountComponentName()); + + // Obtain a PhoneAccountHandle that will be used to start carrier voice/video calls. + // If the row is for a Duo call, we should use the default phone account as the one included in + // the row is for Duo only. PhoneAccountHandle phoneAccountHandle = - TelecomUtil.composePhoneAccountHandle( - row.getPhoneAccountComponentName(), row.getPhoneAccountId()); + isDuoCall + ? TelecomUtil.getDefaultOutgoingPhoneAccount(context, PhoneAccount.SCHEME_TEL) + : TelecomUtil.composePhoneAccountHandle( + row.getPhoneAccountComponentName(), row.getPhoneAccountId()); + + List<HistoryItemActionModule> modules = new ArrayList<>(); // Add an audio call item modules.add( @@ -136,10 +148,6 @@ final class Modules { // Add a video item if (1) the call log entry is for a video call, and (2) the call is not spam. if ((row.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO && !row.getNumberAttributes().getIsSpam()) { - boolean isDuoCall = - DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME - .flattenToString() - .equals(row.getPhoneAccountComponentName()); modules.add( isDuoCall ? new DuoCallModule(context, normalizedNumber, CallInitiationType.Type.CALL_LOG) |