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

Commit 54face31 authored by Sudharma Damgatla's avatar Sudharma Damgatla Committed by Steve Kondik
Browse files

Update A2DP device connection state properly.

Update Audio devices only for first connected
and last disconnected A2DP devices.

Change-Id: I3ac83e507e2b8c638a08881cd70f7900c9312391
parent 32a03fb4
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -3808,6 +3808,7 @@ public class AudioService extends IAudioService.Stub {
            mConnectedBTDevicesList.add(device);
            if (mConnectedBTDevicesList.size() > 1) {
                Log.d(TAG, "Second device connected, add new device ");
                return delay;
            }
        } else if ((state == BluetoothA2dp.STATE_DISCONNECTED) ||
            (state == BluetoothA2dp.STATE_DISCONNECTING)) {
@@ -3817,9 +3818,7 @@ public class AudioService extends IAudioService.Stub {
                mConnectedBTDevicesList.remove(device);
            }
            if (mConnectedBTDevicesList.size() > 0) {
                Log.d(TAG, "device removed " + device.getAddress() );
                mConnectedDevices.remove(makeDeviceListKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP,
                        device.getAddress()));
                Log.d(TAG, "Not all are disconnected ");
                return delay;
            }
        }