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

Commit 734819a4 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Fix AVRCP volume control from UI volume slider

Fix error where volume index rescaling was happening twice in the
  setStreamVolume code path for AVRCP absolute volume code path.

Bug: 123857725
Test: see bug
Change-Id: Iadfa664e6eb6298acf712f02f98b892ad2d36d44
parent c4b9c96d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1710,7 +1710,7 @@ public class AudioService extends IAudioService.Stub
                    Log.d(TAG, "adjustSreamVolume: postSetAvrcpAbsoluteVolumeIndex index="
                            + newIndex + "stream=" + streamType);
                }
                mDeviceBroker.postSetAvrcpAbsoluteVolumeIndex(newIndex);
                mDeviceBroker.postSetAvrcpAbsoluteVolumeIndex(newIndex / 10);
            }

            // Check if volume update should be send to Hearing Aid
+2 −2
Original line number Diff line number Diff line
@@ -191,8 +191,8 @@ public class BtHelper {
            Log.i(TAG, "setAvrcpAbsoluteVolumeIndex index=" + index);
        }
        AudioService.sVolumeLogger.log(new AudioServiceEvents.VolumeEvent(
                AudioServiceEvents.VolumeEvent.VOL_SET_AVRCP_VOL, index / 10));
        mA2dp.setAvrcpAbsoluteVolume(index / 10);
                AudioServiceEvents.VolumeEvent.VOL_SET_AVRCP_VOL, index));
        mA2dp.setAvrcpAbsoluteVolume(index);
    }

    /*package*/ synchronized int getA2dpCodec(@NonNull BluetoothDevice device) {