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/dialpad/DialpadFragment.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/com/android/dialer/dialpad') diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index c35bdea3c..eb17fefe3 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -81,7 +81,7 @@ import com.android.dialer.R; import com.android.dialer.SpecialCharSequenceMgr; import com.android.dialer.calllog.PhoneAccountUtils; import com.android.dialer.util.DialerUtils; -import com.android.dialer.util.IntentUtil; +import com.android.dialer.util.IntentUtil.CallIntentBuilder; import com.android.phone.common.CallLogAsync; import com.android.phone.common.animation.AnimUtils; import com.android.phone.common.dialpad.DialpadKeyButton; @@ -1044,7 +1044,8 @@ public class DialpadFragment extends Fragment } public void callVoicemail() { - DialerUtils.startActivityWithErrorToast(getActivity(), IntentUtil.getVoicemailIntent()); + DialerUtils.startActivityWithErrorToast(getActivity(), + new CallIntentBuilder(CallUtil.getVoicemailUri()).build()); hideAndClearDialpad(false); } @@ -1140,7 +1141,7 @@ public class DialpadFragment extends Fragment // Clear the digits just in case. clearDialpad(); } else { - final Intent intent = IntentUtil.getCallIntent(number, (String) null); + final Intent intent = new CallIntentBuilder(number).build(); DialerUtils.startActivityWithErrorToast(getActivity(), intent); hideAndClearDialpad(false); } @@ -1665,7 +1666,7 @@ public class DialpadFragment extends Fragment } private Intent newFlashIntent() { - final Intent intent = IntentUtil.getCallIntent(EMPTY_NUMBER); + final Intent intent = new CallIntentBuilder(EMPTY_NUMBER).build(); intent.putExtra(EXTRA_SEND_EMPTY_FLASH, true); return intent; } -- cgit v1.2.3