From ad11c3f4f2063d216422f2405ce92639afebf071 Mon Sep 17 00:00:00 2001 From: linyuh Date: Wed, 18 Apr 2018 16:13:15 -0700 Subject: Support placing a call with assisted dialing in the new call log. Bug: 70988691 Test: ModulesTest PiperOrigin-RevId: 193434411 Change-Id: I3fe493eeb2869cad0d42ccf08d57018a42b1b84e --- java/com/android/dialer/calllog/ui/menu/Modules.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/java/com/android/dialer/calllog/ui/menu/Modules.java b/java/com/android/dialer/calllog/ui/menu/Modules.java index 70f17662e..0b9b01d2a 100644 --- a/java/com/android/dialer/calllog/ui/menu/Modules.java +++ b/java/com/android/dialer/calllog/ui/menu/Modules.java @@ -149,7 +149,8 @@ final class Modules { // TODO(zachh): Support post-dial digits; consider using DialerPhoneNumber. CallIntentBuilder callIntentBuilder = new CallIntentBuilder(normalizedNumber, CallInitiationType.Type.CALL_LOG) - .setPhoneAccountHandle(phoneAccountHandle); + .setPhoneAccountHandle(phoneAccountHandle) + .setAllowAssistedDial(canSupportAssistedDialing(row)); modules.add(IntentModule.newCallModule(context, callIntentBuilder)); // If the call log entry is for a spam call, nothing more to be done. @@ -184,8 +185,6 @@ final class Modules { private static HistoryItemActionModule createModuleForAccessingCallDetails( Context context, CoalescedRow row) { boolean canReportAsInvalidNumber = row.getNumberAttributes().getCanReportAsInvalidNumber(); - boolean canSupportAssistedDialing = - !TextUtils.isEmpty(row.getNumberAttributes().getLookupUri()); return new IntentModule( context, @@ -194,7 +193,7 @@ final class Modules { row.getCoalescedIds(), createCallDetailsHeaderInfoFromRow(context, row), canReportAsInvalidNumber, - canSupportAssistedDialing), + canSupportAssistedDialing(row)), R.string.call_details_menu_label, R.drawable.quantum_ic_info_outline_vd_theme_24); } @@ -243,4 +242,8 @@ final class Modules { && canRelyOnCarrierVideoPresence && row.getNumberAttributes().getCanSupportCarrierVideoCall(); } + + private static boolean canSupportAssistedDialing(CoalescedRow row) { + return !TextUtils.isEmpty(row.getNumberAttributes().getLookupUri()); + } } -- cgit v1.2.3