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

Commit c7ecf43f authored by Ted Wang's avatar Ted Wang Committed by Automerger Merge Worker
Browse files

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

Merge "Don't set volume to remote if volume is same as current device volume" am: 121de636 am: 31ae0f27 am: f6f117fb am: 0da0414e am: f139dfe2

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/1426868

Change-Id: I01c4f0839a4029b25df93c331593f22c60e161b9
parents b10fa833 f139dfe2
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;