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

Commit 84b2e62d authored by Jaikumar Ganesh's avatar Jaikumar Ganesh
Browse files

Fix runtime reboot when connecting to a A2DP headset and

user toggles BT state.

Bug:2607218

This happens when Bluetooth is turned off, and when the headset is
still trying to connect. We get the connection result of
attempt before Bluetooth was toggled. We need to ignore this result.

Change-Id: I611232631b7f67f4a1ea803de0dcf4b749c1d8d5
parent 9a6c37a5
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -554,6 +554,7 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub {
        if (!result) {
        if (!result) {
            if (deviceObjectPath != null) {
            if (deviceObjectPath != null) {
                String address = mBluetoothService.getAddressFromObjectPath(deviceObjectPath);
                String address = mBluetoothService.getAddressFromObjectPath(deviceObjectPath);
                if (address == null) return;
                BluetoothDevice device = mAdapter.getRemoteDevice(address);
                BluetoothDevice device = mAdapter.getRemoteDevice(address);
                int state = getSinkState(device);
                int state = getSinkState(device);
                handleSinkStateChange(device, state, BluetoothA2dp.STATE_DISCONNECTED);
                handleSinkStateChange(device, state, BluetoothA2dp.STATE_DISCONNECTED);