From 2cf2c3484c5f8dd11e6ad32633f7254119525413 Mon Sep 17 00:00:00 2001 From: erfanian Date: Thu, 21 Dec 2017 12:01:33 -0800 Subject: Update assisted dialing extras in preparation for platform implementation. * Use only one extra as if we were going to make a request of the Platform. * Modify the incallui to handle instances where the platform may not supply TransformationInfo. This should accommodate instances where the platform "used" assisted dialing, but did not provide the necessary TransformationInfo. Test: unit tests PiperOrigin-RevId: 179841752 Change-Id: I06411dc00812dba8978a2a090d8769dcce9b2ad6 --- java/com/android/dialer/precall/impl/AssistedDialAction.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'java/com/android/dialer/precall') diff --git a/java/com/android/dialer/precall/impl/AssistedDialAction.java b/java/com/android/dialer/precall/impl/AssistedDialAction.java index c4f61d2dd..dc2510960 100644 --- a/java/com/android/dialer/precall/impl/AssistedDialAction.java +++ b/java/com/android/dialer/precall/impl/AssistedDialAction.java @@ -51,10 +51,12 @@ public class AssistedDialAction implements PreCallAction { AssistedDialingMediator assistedDialingMediator = ConcreteCreator.createNewAssistedDialingMediator( context.getSystemService(TelephonyManager.class), context); + if (Build.VERSION.SDK_INT > ConcreteCreator.BUILD_CODE_CEILING) { + builder.getOutgoingCallExtras().putBoolean(TelephonyManagerCompat.USE_ASSISTED_DIALING, true); + } if (!assistedDialingMediator.isPlatformEligible()) { return; } - builder.getOutgoingCallExtras().putBoolean(TelephonyManagerCompat.ALLOW_ASSISTED_DIAL, true); String phoneNumber = builder.getUri().getScheme().equals(PhoneAccount.SCHEME_TEL) ? builder.getUri().getSchemeSpecificPart() @@ -62,8 +64,8 @@ public class AssistedDialAction implements PreCallAction { Optional transformedNumber = assistedDialingMediator.attemptAssistedDial(phoneNumber); if (transformedNumber.isPresent()) { + builder.getOutgoingCallExtras().putBoolean(TelephonyManagerCompat.USE_ASSISTED_DIALING, true); Bundle assistedDialingExtras = transformedNumber.get().toBundle(); - builder.getOutgoingCallExtras().putBoolean(TelephonyManagerCompat.IS_ASSISTED_DIALED, true); builder .getOutgoingCallExtras() .putBundle(TelephonyManagerCompat.ASSISTED_DIALING_EXTRAS, assistedDialingExtras); -- cgit v1.2.3