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

Commit 572c7fee authored by Venkata Jagadeesh Garaga's avatar Venkata Jagadeesh Garaga Committed by Martin Brabham
Browse files

BT: Synchronize Bond SM message processing and cleanup

Issue:
ANR while accessing bonded devices

Steps:
Bonding/unbonding while BT disabling.

RootCause:
Bond State Machine cleanup while processing of
a message cause a application exit because of
dereference of cleaned up objects.

Fix:
Serialize BondStateMachine cleanup and processing of messages

Test:
On OFF sanity and other bonding and unbonding related scenario

Bug: 147404785
Change-Id: I0f1be81fd9d596968883e9a6759a619dced50624
parent 23e2e35a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ final class BondStateMachine extends StateMachine {
        return bsm;
    }

    public void doQuit() {
    public synchronized void doQuit() {
        quitNow();
    }

@@ -122,7 +122,7 @@ final class BondStateMachine extends StateMachine {
        }

        @Override
        public boolean processMessage(Message msg) {
        public synchronized boolean processMessage(Message msg) {

            BluetoothDevice dev = (BluetoothDevice) msg.obj;

@@ -178,7 +178,7 @@ final class BondStateMachine extends StateMachine {
        }

        @Override
        public boolean processMessage(Message msg) {
        public synchronized boolean processMessage(Message msg) {
            BluetoothDevice dev = (BluetoothDevice) msg.obj;
            DeviceProperties devProp = mRemoteDevices.getDeviceProperties(dev);
            boolean result = false;