From 0efc840171da8739359b326249978d0a44df540b Mon Sep 17 00:00:00 2001 From: twyen Date: Tue, 7 Nov 2017 15:39:15 -0800 Subject: Hook up pre-call actions This CL replaces all instance of CallIntentBuilder.build() with PreCall.getIntent(), which when run as an activity, will finish building the intent with user interaction. Bug: 64216442 Test: manual PiperOrigin-RevId: 174924323 Change-Id: If41868df4c7ed078d03bd3431fa85b8947056a01 --- .../android/dialer/interactions/PhoneNumberInteraction.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'java/com/android/dialer/interactions') diff --git a/java/com/android/dialer/interactions/PhoneNumberInteraction.java b/java/com/android/dialer/interactions/PhoneNumberInteraction.java index 255f6c380..15c6ce899 100644 --- a/java/com/android/dialer/interactions/PhoneNumberInteraction.java +++ b/java/com/android/dialer/interactions/PhoneNumberInteraction.java @@ -60,6 +60,7 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.logging.InteractionEvent; import com.android.dialer.logging.Logger; +import com.android.dialer.precall.PreCall; import com.android.dialer.util.DialerUtils; import com.android.dialer.util.PermissionsUtil; import com.android.dialer.util.TransactionSafeActivity; @@ -183,10 +184,11 @@ public class PhoneNumberInteraction implements OnLoadCompleteListener { break; default: intent = - new CallIntentBuilder(phoneNumber, callSpecificAppData) - .setIsVideoCall(isVideoCall) - .setAllowAssistedDial(callSpecificAppData.getAllowAssistedDialing()) - .build(); + PreCall.getIntent( + context, + new CallIntentBuilder(phoneNumber, callSpecificAppData) + .setIsVideoCall(isVideoCall) + .setAllowAssistedDial(callSpecificAppData.getAllowAssistedDialing())); break; } DialerUtils.startActivityWithErrorToast(context, intent); @@ -224,7 +226,7 @@ public class PhoneNumberInteraction implements OnLoadCompleteListener { // crash when the user tries to use such a shortcut, check for this condition and ask the user // for the permission. if (!PermissionsUtil.hasPhonePermissions(mContext)) { - LogUtil.i("PhoneNumberInteraction.startInteraction", "Need phone permissions: CALL_PHONE"); + LogUtil.i("PhoneNumberInteraction.startInteraction", "Need phone permission: CALL_PHONE"); ActivityCompat.requestPermissions( (Activity) mContext, new String[] {permission.CALL_PHONE}, REQUEST_CALL_PHONE); return; -- cgit v1.2.3