Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b63d581 authored by Hieu Dang's avatar Hieu Dang
Browse files

Fix NPE on BluetoothOppServiceTest

Bug: 292207461
Test: atest BluetoothInstrumentationTests
Tag: #refactor
Change-Id: I7ab076e1a0bfd640f061129b8081577c7e3fa5aa
parent 47b1e39a
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;


@MediumTest
@RunWith(AndroidJUnit4.class)
public class BluetoothOppServiceTest {
@@ -90,7 +89,11 @@ public class BluetoothOppServiceTest {
        // Since the update thread is not run (we mocked it), it will not clean itself on interrupt
        // (normally, the service will wait for the update thread to clean itself after
        // being interrupted). We clean it manually here
        mService.mUpdateThread = null;
        BluetoothOppService service = mService;
        if (service != null) {
            service.mUpdateThread = null;
        }

        BluetoothMethodProxy.setInstanceForTesting(null);
        TestUtils.stopService(mServiceRule, BluetoothOppService.class);
        TestUtils.clearAdapterService(mAdapterService);
@@ -188,4 +191,3 @@ public class BluetoothOppServiceTest {
                        any());
    }
}
 No newline at end of file