From 8a4bd60ca1b35e2c6fa46fed16891f5be4be9f46 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 2 Oct 2015 17:28:44 -0700 Subject: Return Mock TelephonyManager for test. Bug: 24341350 Change-Id: Ie47faafcb834083b4a6877e713d871d8283886f7 --- InCallUI/tests/src/com/android/incallui/InCallPresenterTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'InCallUI/tests/src') diff --git a/InCallUI/tests/src/com/android/incallui/InCallPresenterTest.java b/InCallUI/tests/src/com/android/incallui/InCallPresenterTest.java index f4e06a5fa..b5828ea62 100644 --- a/InCallUI/tests/src/com/android/incallui/InCallPresenterTest.java +++ b/InCallUI/tests/src/com/android/incallui/InCallPresenterTest.java @@ -23,6 +23,7 @@ import static org.mockito.Mockito.when; import android.content.Context; import android.content.Intent; import android.telecom.PhoneAccountHandle; +import android.telephony.TelephonyManager; import android.test.InstrumentationTestCase; import com.android.incallui.InCallPresenter.InCallState; @@ -41,6 +42,7 @@ public class InCallPresenterTest extends InstrumentationTestCase { InCallPresenter mInCallPresenter; @Mock private Context mContext; + @Mock private TelephonyManager mTelephonyManager; @Override protected void setUp() throws Exception { @@ -50,6 +52,8 @@ public class InCallPresenterTest extends InstrumentationTestCase { MockitoAnnotations.initMocks(this); mCallList = new MockCallListWrapper(); + when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager); + mInCallPresenter = InCallPresenter.getInstance(); mInCallPresenter.setUp(mContext, mCallList.getCallList(), mAudioModeProvider, mStatusBarNotifier, mContactInfoCache, mProximitySensor); -- cgit v1.2.3