diff options
author | twyen <twyen@google.com> | 2017-11-07 15:39:15 -0800 |
---|---|---|
committer | zachh <zachh@google.com> | 2017-11-11 23:15:49 +0000 |
commit | 0efc840171da8739359b326249978d0a44df540b (patch) | |
tree | 238f87ae39ac404331e96a8cbf138e333cb73afa /java/com/android/dialer/interactions | |
parent | 73d995ff88b3a8894c7463a21a24dcec3f8d68e4 (diff) |
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
Diffstat (limited to 'java/com/android/dialer/interactions')
-rw-r--r-- | java/com/android/dialer/interactions/PhoneNumberInteraction.java | 12 |
1 files changed, 7 insertions, 5 deletions
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<Cursor> { 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<Cursor> { // 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; |