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

Commit 841a42d8 authored by Calvin On's avatar Calvin On Committed by android-build-merger
Browse files

Work around/prevent NPE in aclStateChangedCallback.

am: 35f4114a

Change-Id: I21751c40fc3e332e350f00309458c4c92004dcf6
parents e04d8aab 35f4114a
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -422,10 +422,17 @@ final class RemoteDevices {
            debugLog("aclStateChangeCallback: Adapter State: "
                    + BluetoothAdapter.nameForState(state) + " Disconnected: " + device);
        }

        if (intent != null) {
            intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
            intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT
                    | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
            intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
            mAdapterService.sendBroadcast(intent, mAdapterService.BLUETOOTH_PERM);
        } else {
            Log.e(TAG, "aclStateChangeCallback intent is null. deviceBondState: "
                    + device.getBondState());
        }
    }