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/calllogutils | |
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/calllogutils')
-rw-r--r-- | java/com/android/dialer/calllogutils/CallLogIntents.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/java/com/android/dialer/calllogutils/CallLogIntents.java b/java/com/android/dialer/calllogutils/CallLogIntents.java index 11308e607..b06fe6e93 100644 --- a/java/com/android/dialer/calllogutils/CallLogIntents.java +++ b/java/com/android/dialer/calllogutils/CallLogIntents.java @@ -15,6 +15,7 @@ */ package com.android.dialer.calllogutils; +import android.content.Context; import android.content.Intent; import android.provider.CallLog.Calls; import android.support.annotation.Nullable; @@ -22,6 +23,7 @@ import android.text.TextUtils; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.calllog.model.CoalescedRow; +import com.android.dialer.precall.PreCall; /** Provides intents related to call log entries. */ public final class CallLogIntents { @@ -35,10 +37,9 @@ public final class CallLogIntents { * @return null if the provided {@code row} doesn't have a number */ @Nullable - public static Intent getCallBackIntent(CoalescedRow row) { + public static Intent getCallBackIntent(Context context, CoalescedRow row) { // TODO(zachh): Do something with parsed values to make more dialable? String originalNumber = row.number().getRawInput().getNumber(); - // TODO(zachh): Make this more sophisticated, e.g. return null for non-dialable numbers? if (TextUtils.isEmpty(originalNumber)) { return null; @@ -46,10 +47,11 @@ public final class CallLogIntents { // TODO(zachh): More granular logging? // TODO(zachh): Support assisted dialing. - return new CallIntentBuilder(originalNumber, CallInitiationType.Type.CALL_LOG) - .setPhoneAccountHandle( - PhoneAccountUtils.getAccount(row.phoneAccountComponentName(), row.phoneAccountId())) - .setIsVideoCall((row.features() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO) - .build(); + return PreCall.getIntent( + context, + new CallIntentBuilder(originalNumber, CallInitiationType.Type.CALL_LOG) + .setPhoneAccountHandle( + PhoneAccountUtils.getAccount(row.phoneAccountComponentName(), row.phoneAccountId())) + .setIsVideoCall((row.features() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO)); } } |