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

Commit 78ad277d authored by Hui Peng's avatar Hui Peng Committed by Gerrit Code Review
Browse files

Merge "Fix a null-ptr-deref bug in BondStateMachine" into main

parents 01ce8c6d 9f87fe77
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -250,6 +250,11 @@ final class BondStateMachine extends StateMachine {
                    }
                    break;
                case SSP_REQUEST:
                    if (devProp == null) {
                        errorLog("devProp is null, maybe the device is disconnected");
                        break;
                    }

                    int passkey = msg.arg1;
                    int variant = msg.arg2;
                    boolean displayPasskey =
@@ -262,6 +267,11 @@ final class BondStateMachine extends StateMachine {
                            variant);
                    break;
                case PIN_REQUEST:
                    if (devProp == null) {
                        errorLog("devProp is null, maybe the device is disconnected");
                        break;
                    }

                    BluetoothClass btClass = dev.getBluetoothClass();
                    int btDeviceClass = btClass.getDeviceClass();
                    if (btDeviceClass == BluetoothClass.Device.PERIPHERAL_KEYBOARD || btDeviceClass