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

Commit e3fdcb7e authored by Hui Peng's avatar Hui Peng Committed by Automerger Merge Worker
Browse files

Merge "Fix a null-ptr-deref bug in BondStateMachine" into main am: 78ad277d

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

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

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