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

Commit 8c6f9861 authored by Hemant Gupta's avatar Hemant Gupta
Browse files

PBAP: Intialise Service instance before START_LISTENER is processed

Usecase:
1) Turn ON Bluetooth.
2) Establish PBAP Connection.
3) Turn OFF Bluetooth.
4) Repeat above steps in loop.

Issue:
PBAP Connection fails rarely (1/50)

Root Cause:
When BluetoothPbapService is started, before PBAP Service instance
is intialized in setBluetoothPbapService(), START_LISTENER is
processed in PbapHandlerThread and null is passed ObexServerSockets
leading to incoming connection being rejected.
This looks to be regression introduced due to commit
27ca8a77.

Fix:
Invoke setBluetoothPbapService() before START_LISTENER is sent.

Test: Connection didnt fail in reliability test.

Bug: 118473239
Change-Id: Ic530d520e3e5428b669398948dbc268840c46730
parent 473163bf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -516,9 +516,9 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect
            }
        }

        setBluetoothPbapService(this);
        mSessionStatusHandler.sendMessage(mSessionStatusHandler.obtainMessage(LOAD_CONTACTS));
        mSessionStatusHandler.sendMessage(mSessionStatusHandler.obtainMessage(START_LISTENER));
        setBluetoothPbapService(this);
        return true;
    }