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/DialtactsActivity.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/com/android/dialer/DialtactsActivity.java') diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 786acab1a..a77fd8e7e 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -83,6 +83,7 @@ import com.android.dialer.list.SmartDialSearchFragment; import com.android.dialer.list.SpeedDialFragment; import com.android.dialer.settings.DialerSettingsActivity; import com.android.dialer.util.IntentUtil; +import com.android.dialer.util.IntentUtil.CallIntentBuilder; import com.android.dialer.util.DialerUtils; import com.android.dialer.widget.ActionBarController; import com.android.dialer.widget.SearchEditTextLayout; @@ -1262,9 +1263,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O // an error message. phoneNumber = ""; } - Intent intent = isVideoCall ? - IntentUtil.getVideoCallIntent(phoneNumber, (String) null) : - IntentUtil.getCallIntent(phoneNumber, (String) null); + + final Intent intent = new CallIntentBuilder(phoneNumber) + .setIsVideoCall(isVideoCall) + .build(); + DialerUtils.startActivityWithErrorToast(this, intent); mClearSearchOnPause = true; } -- cgit v1.2.3