From acc87cca571c89322980423e190b188fdd8fa265 Mon Sep 17 00:00:00 2001 From: Ajay Panicker Date: Wed, 22 Mar 2017 16:29:56 -0700 Subject: [PATCH] Remove Context from mockContentResolver to avoid a Null Pointer Exception mockContentResolver was updated to call a function on the context provided in its constructor which caused an exception with mockContext. Instead leaving the context out of the constructor skips this function call and doesn't affect the test. Test: Run unit tests with "runtest bluetooth" Change-Id: I7a597c5864943d3d53dcb551bf3d3bafb4beb5ed --- .../src/com/android/bluetooth/map/BluetoothMapContentObserverTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/com/android/bluetooth/map/BluetoothMapContentObserverTest.java b/tests/src/com/android/bluetooth/map/BluetoothMapContentObserverTest.java index 01f752f6..4b185ee4 100644 --- a/tests/src/com/android/bluetooth/map/BluetoothMapContentObserverTest.java +++ b/tests/src/com/android/bluetooth/map/BluetoothMapContentObserverTest.java @@ -38,7 +38,7 @@ public class BluetoothMapContentObserverTest extends AndroidTestCase { if (Looper.myLooper() == null) Looper.prepare(); Context mockContext = mock(Context.class); - MockContentResolver mockResolver = new MockContentResolver(mockContext); + MockContentResolver mockResolver = new MockContentResolver(); ExceptionTestProvider mockProvider = new ExceptionTestProvider(mockContext); mockResolver.addProvider("sms", mockProvider); -- 2.11.0