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

Commit 35f4114a authored by Calvin On's avatar Calvin On
Browse files

Work around/prevent NPE in aclStateChangedCallback.

Bug: 62440980
Change-Id: I0fd02d80a9cb656a253e537a4ce2dd538df4c48d
parent 57f63b5f
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());
        }
    }