From aff2a94e0c7ef06992d0e54f1b298842bba76229 Mon Sep 17 00:00:00 2001 From: erfanian Date: Wed, 29 Nov 2017 14:49:47 -0800 Subject: Add flag to control default assisted dialing state during precall flow. Currently, the only other client that is initiating calls is Contacts, and we consider that to be a non-idle-dial. Bug: 69860859 Test: existing unit tests PiperOrigin-RevId: 177367226 Change-Id: I22de38dc973f5a1eecfe42833110690744c317fd --- .../dialer/precall/externalreceiver/LaunchPreCallActivity.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/java/com/android/dialer/precall/externalreceiver/LaunchPreCallActivity.java b/java/com/android/dialer/precall/externalreceiver/LaunchPreCallActivity.java index a7811fe6a..f79546e54 100644 --- a/java/com/android/dialer/precall/externalreceiver/LaunchPreCallActivity.java +++ b/java/com/android/dialer/precall/externalreceiver/LaunchPreCallActivity.java @@ -23,6 +23,8 @@ import android.os.Bundle; import android.support.annotation.Nullable; import com.android.dialer.callintent.CallInitiationType.Type; import com.android.dialer.callintent.CallIntentBuilder; +import com.android.dialer.configprovider.ConfigProvider; +import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.precall.PreCall; @@ -50,13 +52,18 @@ public class LaunchPreCallActivity extends Activity { public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); Logger.get(this).logImpression(DialerImpression.Type.PRECALL_INITIATED_EXTERNAL); + + ConfigProvider configProvider = ConfigProviderBindings.get(getApplicationContext()); Intent intent = getIntent(); CallIntentBuilder builder = new CallIntentBuilder(intent.getData(), Type.EXTERNAL_INITIATION); builder .setPhoneAccountHandle(intent.getParcelableExtra(EXTRA_PHONE_ACCOUNT_HANDLE)) .setIsVideoCall(intent.getBooleanExtra(EXTRA_IS_VIDEO_CALL, false)) .setCallSubject(intent.getStringExtra(EXTRA_CALL_SUBJECT)) - .setAllowAssistedDial(intent.getBooleanExtra(EXTRA_ALLOW_ASSISTED_DIAL, false)); + .setAllowAssistedDial( + intent.getBooleanExtra( + EXTRA_ALLOW_ASSISTED_DIAL, + configProvider.getBoolean("assisted_dialing_default_precall_state", false))); PreCall.start(this, builder); finish(); } -- cgit v1.2.3