From fe23fd3894e266095d8c882b8dd66065f7092d5d Mon Sep 17 00:00:00 2001 From: twyen Date: Tue, 7 Nov 2017 13:22:58 -0800 Subject: Make CallIntentBuilder parcelable Multi-SIM and several other new features requires additional user input (ie. select the phone account to call with) or processing (ie. rewrite phone number for assisted dialing) before the call is actually made. The plan is to use a chain of pre-call actions to complete the dialing infomation,with the CallIntentBuilder holding the intermediate steps. For example, a pre-call action can examine the CallIntentBuilder and figure that the PhoneAccountHandle cannot be inferred, and show a dialog for the user the select it. Only after pre-call actions are completed, the intent is built and sent to telecom. Since pre-call actions involves dialogs and the process can be interrupted, the CallIntentBuilder must be persistable so the state can be restored. This CL made it parcelable so it can be stored with onSaveInstanceState(). The AssistedDialingMediator in CallIntentBuilder is temporarily removed as it would be called using a pre-call action in a future CL. Bug: 64216442 Test: CallIntentBuilderTest PiperOrigin-RevId: 174902775 Change-Id: Icf2f8fae620868d1a2f5acf0d08ae0a6bec4fb76 --- java/com/android/dialer/interactions/PhoneNumberInteraction.java | 7 +------ 1 file changed, 1 insertion(+), 6 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 ac744cce7..255f6c380 100644 --- a/java/com/android/dialer/interactions/PhoneNumberInteraction.java +++ b/java/com/android/dialer/interactions/PhoneNumberInteraction.java @@ -41,7 +41,6 @@ import android.provider.ContactsContract.RawContacts; import android.support.annotation.IntDef; import android.support.annotation.VisibleForTesting; import android.support.v4.app.ActivityCompat; -import android.telephony.TelephonyManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -53,7 +52,6 @@ import com.android.contacts.common.Collapser; import com.android.contacts.common.Collapser.Collapsible; import com.android.contacts.common.MoreContactUtils; import com.android.contacts.common.util.ContactDisplayUtils; -import com.android.dialer.assisteddialing.ConcreteCreator; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.callintent.CallIntentParser; @@ -187,10 +185,7 @@ public class PhoneNumberInteraction implements OnLoadCompleteListener { intent = new CallIntentBuilder(phoneNumber, callSpecificAppData) .setIsVideoCall(isVideoCall) - .setAllowAssistedDial( - callSpecificAppData.getAllowAssistedDialing(), - ConcreteCreator.createNewAssistedDialingMediator( - context.getSystemService(TelephonyManager.class), context)) + .setAllowAssistedDial(callSpecificAppData.getAllowAssistedDialing()) .build(); break; } -- cgit v1.2.3