From 72d59616b7a491d41c9b127b777c63fe315ecd06 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Fri, 18 Jul 2014 09:08:51 -0700 Subject: Switch from ACTION_CALL_PRIVILEGED TO ACTION_CALL (1/5) Bug: 6948882 Change-Id: I1f90c9f3f33d875482958d5f565629160ce2177e --- src/com/android/dialer/util/DialerUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/com/android/dialer/util/DialerUtils.java') diff --git a/src/com/android/dialer/util/DialerUtils.java b/src/com/android/dialer/util/DialerUtils.java index bd1813354..93a055df1 100644 --- a/src/com/android/dialer/util/DialerUtils.java +++ b/src/com/android/dialer/util/DialerUtils.java @@ -15,6 +15,7 @@ */ package com.android.dialer.util; +import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; @@ -64,7 +65,11 @@ public class DialerUtils { */ public static void startActivityWithErrorToast(Context context, Intent intent, int msgId) { try { - context.startActivity(intent); + if (Intent.ACTION_CALL.equals(intent.getAction())) { + ((Activity) context).startActivityForResult(intent, 0); + } else { + context.startActivity(intent); + } } catch (ActivityNotFoundException e) { Toast.makeText(context, msgId, Toast.LENGTH_SHORT).show(); } -- cgit v1.2.3