diff options
Diffstat (limited to 'java/com/android/dialer')
-rw-r--r-- | java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java | 14 | ||||
-rw-r--r-- | java/com/android/dialer/precall/impl/AssistedDialAction.java | 6 |
2 files changed, 8 insertions, 12 deletions
diff --git a/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java b/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java index 6bed818da..b01689da4 100644 --- a/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java +++ b/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java @@ -57,22 +57,16 @@ public class TelephonyManagerCompat { * * <p>This signals to the telephony platform that an outgoing call qualifies for assisted dialing. */ - public static final String ALLOW_ASSISTED_DIAL = "android.telecom.extra.ALLOW_ASSISTED_DIAL"; - - // TODO(erfanian): a bug Replace with the platform/telecom constant when available. - /** - * Indicates that an outgoing call has undergone assisted dialing. - * - * <p>Unlike {@link ALLOW_ASSISTED_DIAL}, the presence of this key further indicates that a call - * has undergone Assisted Dialing -- not just that it qualified for Assisted Dialing. - */ - public static final String IS_ASSISTED_DIALED = "android.telecom.extra.IS_ASSISTED_DIALED"; + public static final String USE_ASSISTED_DIALING = "android.telecom.extra.USE_ASSISTED_DIALING"; // TODO(erfanian): a bug Replace with the platform/telecom API when available. /** Additional information relating to the assisted dialing transformation. */ public static final String ASSISTED_DIALING_EXTRAS = "android.telecom.extra.ASSISTED_DIALING_EXTRAS"; + /** Indicates the Connection/Call used assisted dialing. */ + public static final int PROPERTY_ASSISTED_DIALING_USED = 0x00000200; + public static final String EXTRA_IS_REFRESH = BuildCompat.isAtLeastOMR1() ? "android.telephony.extra.IS_REFRESH" : "is_refresh"; 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); |