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

Commit 8d724c3c authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Guard against start/stop race conditions.

We've seen evidence of BluetoothKeystoreService being initialized
in parallel with being torn down, so guard against possible NPEs.

Bug: 193659633
Test: atest BluetoothInstrumentationTests:com.android.bluetooth.btservice.AdapterServiceTest --rerun-until-failure 100
Change-Id: I91c36142cc96a26e9a7d9d886f8abe94175acb2c
parent 552c28ba
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -303,8 +303,10 @@ public class BluetoothKeystoreService {
        stopThread();
        startThread();
        // Initialize native interface
        if (mBluetoothKeystoreNativeInterface != null) {
            mBluetoothKeystoreNativeInterface.init();
        }
    }

    private boolean isAvailable() {
        return !mCleaningUp;