Fix a NPE when displaying device detail page.

Bug: 68956750
Test: robotests
Change-Id: I1eed4e07ad723ee787a333ae88cd2ced62b3d34f
This commit is contained in:
Fan Zhang
2017-11-10 17:02:38 -08:00
parent 49dac3d4ac
commit 7020d97545
6 changed files with 10 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.RuntimeEnvironment;
public class BluetoothDetailsControllerTestBase {
protected Context mContext = RuntimeEnvironment.application;
protected Context mContext;
protected Lifecycle mLifecycle;
protected DeviceConfig mDeviceConfig;
protected BluetoothDevice mDevice;
@@ -58,6 +58,7 @@ public class BluetoothDetailsControllerTestBase {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mPreferenceManager = new PreferenceManager(mContext);
mScreen = mPreferenceManager.createPreferenceScreen(mContext);
mDeviceConfig = makeDefaultDeviceConfig();