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

Commit 4ee833d2 authored by Venkateshwarlu Domakonda's avatar Venkateshwarlu Domakonda Committed by Linux Build Service Account
Browse files

Bluetooth: Update the A2DP status properly

If the device is removed from the hash table before updating
the status because of asynchronous operations involved, audio
is not able to update policy manager regarding A2dp disconnection.
This change takes care of forcibly updating HAL in such scenario
so that Audio chooses the proper device on next playback.

CRs-Fixed: 1031541
Change-Id: I4d0e56590b5e01cda6657f61d31d0b895fce0306
parent f20556c2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5048,7 +5048,9 @@ public class AudioService extends IAudioService.Stub {
            DeviceListSpec deviceSpec = mConnectedDevices.get(key);
            boolean isConnected = deviceSpec != null;

            if (isConnected && state != BluetoothProfile.STATE_CONNECTED) {
            if ((isConnected && state != BluetoothProfile.STATE_CONNECTED) ||
                ((mConnectedBTDevicesList.size() == 0) &&
                 (state == BluetoothProfile.STATE_DISCONNECTED))) {
                if (btDevice.isBluetoothDock()) {
                    if (state == BluetoothProfile.STATE_DISCONNECTED) {
                        // introduction of a delay for transient disconnections of docks when