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

Commit a0d5d285 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4793185 from acb31f36 to pi-release

Change-Id: I8e690c5a7785362bcb2814405a98fcd024f1d9df
parents 82de483b acb31f36
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -803,14 +803,12 @@ public class A2dpService extends ProfileService {
            Log.d(TAG, "broadcastActiveDevice(" + device + ")");
        }

        // Currently the audio service can only remember the volume for a single device. We send
        // active device changed intent after informing AVRCP that the device switched so it can
        // set the stream volume to the new device before A2DP informs the audio service that the
        // device has changed. This is to avoid the indeterminate volume state that exists when
        // in the middle of switching devices.
        // We need to inform AVRCP that the device has switched before informing the audio service
        // so that AVRCP can prepare and wait on audio service connecting the new stream before
        // restoring the previous volume. Otherwise the updated volume could be applied to the
        // old active device before the switch has fully completed.
        if (AvrcpTargetService.get() != null) {
            AvrcpTargetService.get().volumeDeviceSwitched(
                    device != null ? device.getAddress() : "");
            AvrcpTargetService.get().volumeDeviceSwitched(device);
        }

        Intent intent = new Intent(BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED);
Loading