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

Commit 83c614ab authored by Vlad Popa's avatar Vlad Popa Committed by Android (Google) Code Review
Browse files

Merge "Fix the range of the avrcp index" into main

parents a939396e 4cfa336c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -4467,11 +4467,16 @@ public class AudioService extends IAudioService.Stub
            if (streamTypeAlias == getBluetoothContextualVolumeStream()
                    && AudioSystem.DEVICE_OUT_ALL_A2DP_SET.contains(deviceType)
                    && (flags & AudioManager.FLAG_BLUETOOTH_ABS_VOLUME) == 0) {
                // the AVRCP index is always in the range of STREAM_MUSIC
                int avrcpIndex = newIndex / 10;
                if (streamType != AudioSystem.STREAM_MUSIC) {
                    avrcpIndex = rescaleIndex(avrcpIndex, streamType, AudioSystem.STREAM_MUSIC);
                }
                if (DEBUG_VOL) {
                    Log.d(TAG, "adjustStreamVolume: postSetAvrcpAbsoluteVolumeIndex index="
                            + newIndex + "stream=" + streamType);
                            + newIndex + "stream=" + streamType + "avrcpIndex=" + avrcpIndex);
                }
                mDeviceBroker.postSetAvrcpAbsoluteVolumeIndex(newIndex / 10);
                mDeviceBroker.postSetAvrcpAbsoluteVolumeIndex(avrcpIndex);
                volumeHandled = true;
            }