summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/precall
diff options
context:
space:
mode:
authorerfanian <erfanian@google.com>2017-12-21 12:01:33 -0800
committerEric Erfanian <erfanian@google.com>2017-12-22 08:56:01 -0800
commit2cf2c3484c5f8dd11e6ad32633f7254119525413 (patch)
treeb4ed88351160ea63c2f0eb128cd01583cdbfc45b /java/com/android/dialer/precall
parent9709446856e01c23cfd02f83f85ecd79bdd8f785 (diff)
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
Diffstat (limited to 'java/com/android/dialer/precall')
-rw-r--r--java/com/android/dialer/precall/impl/AssistedDialAction.java6
1 files changed, 4 insertions, 2 deletions
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<TransformationInfo> 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);