From 6c86e632b5c5f65567e45114b6bd1ba48f5863d8 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Sat, 25 Oct 2014 18:30:36 -0700 Subject: Fix some broken Dialer tests Bug: 17487016 Change-Id: I4c13c3e826a4eb1de84708dfa27ad093b2134087 --- src/com/android/dialer/util/DialerUtils.java | 2 +- tests/src/com/android/dialer/calllog/CallLogFragmentTest.java | 5 +++-- .../android/dialer/interactions/PhoneNumberInteractionTest.java | 5 +++-- tests/src/com/android/dialer/util/TestConstants.java | 7 +++++++ 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 tests/src/com/android/dialer/util/TestConstants.java diff --git a/src/com/android/dialer/util/DialerUtils.java b/src/com/android/dialer/util/DialerUtils.java index 9cd4d9936..10eadffd5 100644 --- a/src/com/android/dialer/util/DialerUtils.java +++ b/src/com/android/dialer/util/DialerUtils.java @@ -71,7 +71,7 @@ public class DialerUtils { */ public static void startActivityWithErrorToast(Context context, Intent intent, int msgId) { try { - if (Intent.ACTION_CALL.equals(intent.getAction())) { + if (Intent.ACTION_CALL.equals(intent.getAction()) && context instanceof Activity) { // All dialer-initiated calls should pass the touch point to the InCallUI Point touchPoint = TouchPointManager.getInstance().getPoint(); if (touchPoint.x != 0 || touchPoint.y != 0) { diff --git a/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java b/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java index e0e111bcf..b88989d4d 100644 --- a/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java @@ -42,6 +42,7 @@ import android.widget.FrameLayout; import com.android.contacts.common.test.FragmentTestActivity; import com.android.dialer.CallDetailActivity; import com.android.dialer.R; +import com.android.dialer.util.TestConstants; import java.util.Date; import java.util.Formatter; @@ -323,7 +324,7 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2