From e3a2d133a9fdf12462dab75ed7d6c6c6061fa5e3 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Mon, 14 Sep 2015 16:52:08 -0700 Subject: Refactor IntentUtil.getCallIntent variants to use builder Use the builder pattern to create a Call intent to replace the numerous variants of getCallIntent. This will facilitate the addition of future extras to the created call intent. Bug: 23164804 Change-Id: Ibab8473274de8e423f621ae6fbb9685eeb2a7cab --- src/com/android/dialer/calllog/IntentProvider.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/com/android/dialer/calllog/IntentProvider.java') diff --git a/src/com/android/dialer/calllog/IntentProvider.java b/src/com/android/dialer/calllog/IntentProvider.java index a11d00bc2..79743b0b7 100644 --- a/src/com/android/dialer/calllog/IntentProvider.java +++ b/src/com/android/dialer/calllog/IntentProvider.java @@ -21,16 +21,15 @@ import android.content.ContentUris; import android.content.Context; import android.content.Intent; import android.net.Uri; -import android.provider.CallLog.Calls; import android.provider.ContactsContract; import android.telecom.PhoneAccountHandle; +import com.android.contacts.common.CallUtil; import com.android.contacts.common.model.Contact; import com.android.contacts.common.model.ContactLoader; import com.android.dialer.CallDetailActivity; -import com.android.dialer.DialtactsActivity; -import com.android.dialer.PhoneCallDetails; import com.android.dialer.util.IntentUtil; +import com.android.dialer.util.IntentUtil.CallIntentBuilder; import com.android.dialer.util.TelecomUtil; import java.util.ArrayList; @@ -55,7 +54,9 @@ public abstract class IntentProvider { return new IntentProvider() { @Override public Intent getIntent(Context context) { - return IntentUtil.getCallIntent(number, accountHandle); + return new CallIntentBuilder(number) + .setPhoneAccountHandle(accountHandle) + .build(); } }; } @@ -69,7 +70,10 @@ public abstract class IntentProvider { return new IntentProvider() { @Override public Intent getIntent(Context context) { - return IntentUtil.getVideoCallIntent(number, accountHandle); + return new CallIntentBuilder(number) + .setPhoneAccountHandle(accountHandle) + .setIsVideoCall(true) + .build(); } }; } @@ -78,7 +82,7 @@ public abstract class IntentProvider { return new IntentProvider() { @Override public Intent getIntent(Context context) { - return IntentUtil.getVoicemailIntent(); + return new CallIntentBuilder(CallUtil.getVoicemailUri()).build(); } }; } -- cgit v1.2.3