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

Commit 838b533e authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "VolumeControl: Call legacy API when not override" into main

parents 1a2827c7 72eba7bc
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -114,7 +114,11 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
        default void onVolumeOffsetChanged(
                @NonNull BluetoothDevice device,
                @IntRange(from = 1, to = 255) int instanceId,
                @IntRange(from = -255, to = 255) int volumeOffset) {}
                @IntRange(from = -255, to = 255) int volumeOffset) {
            if (instanceId == 1) {
                onVolumeOffsetChanged(device, volumeOffset);
            }
        }

        /**
         * Callback invoked when callback is registered and when audio location changes on the
@@ -186,10 +190,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
        public void onVolumeOffsetChanged(
                @NonNull BluetoothDevice device, int instanceId, int volumeOffset) {
            Attributable.setAttributionSource(device, mAttributionSource);

            if (instanceId == 1) {
                forEach((cb) -> cb.onVolumeOffsetChanged(device, volumeOffset));
            }
            if (Flags.leaudioMultipleVocsInstancesApi()) {
                forEach((cb) -> cb.onVolumeOffsetChanged(device, instanceId, volumeOffset));
            }