From 7d20f8273886411ffc864231d59f780e450de3db Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Thu, 19 Jun 2014 17:09:33 -0700 Subject: Fix Dialer tests Fix Dialer tests and also wrap all startActivity calls that have the potential to fail with a catch block for ActivityNotFoundException Change-Id: I02ce4b985eeb0e3e607b8008a333e02168acd378 --- src/com/android/dialer/dialpad/DialpadFragment.java | 9 +++------ 1 file changed, 3 insertions(+), 6 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 bb5880295..cc4275518 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -279,10 +279,7 @@ public class DialpadFragment extends Fragment * Return an Intent for launching voicemail screen. */ private static Intent getVoicemailIntent() { - final Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED, - Uri.fromParts("voicemail", "", null)); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - return intent; + return CallUtil.getCallIntent(Uri.fromParts("voicemail", "", null)); } private TelephonyManager getTelephonyManager() { @@ -986,7 +983,7 @@ public class DialpadFragment extends Fragment } public void callVoicemail() { - startActivity(getVoicemailIntent()); + DialerUtils.startActivityWithErrorToast(getActivity(), getVoicemailIntent()); hideAndClearDialpad(false); } @@ -1085,7 +1082,7 @@ public class DialpadFragment extends Fragment final Intent intent = CallUtil.getCallIntent(number, (getActivity() instanceof DialtactsActivity ? ((DialtactsActivity) getActivity()).getCallOrigin() : null)); - startActivity(intent); + DialerUtils.startActivityWithErrorToast(getActivity(), intent); hideAndClearDialpad(false); } } -- cgit v1.2.3