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

Commit 72eba7bc authored by William Escande's avatar William Escande
Browse files

VolumeControl: Call legacy API when not override

Bug: 324492914
Test: m Bluetooth | no logic modified
Flag: Exempt, no-op
Change-Id: I41c7b17cafded02486a5e2935cdc5698f7e05a2e
parent 66cf562d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -113,7 +113,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
@@ -185,10 +189,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));
            }