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

Commit f8cfcceb authored by Ted Wang's avatar Ted Wang
Browse files

Don't set volume to remote if volume is same as current device volume

Tag: #compatibility
Bug: 167885146
Test: Manual
Change-Id: I70577b2645aef21cc475ba08815d35f6afbfaab1
parent 582f78f3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -184,6 +184,10 @@ class AvrcpVolumeManager extends AudioDeviceCallback {
    }

    void sendVolumeChanged(@NonNull BluetoothDevice device, int deviceVolume) {
        if (deviceVolume == getVolume(device, -1)) {
            d("sendVolumeChanged: Skipping update volume to same as current.");
            return;
        }
        int avrcpVolume =
                (int) Math.floor((double) deviceVolume * AVRCP_MAX_VOL / sDeviceMaxVolume);
        if (avrcpVolume > 127) avrcpVolume = 127;