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

Commit 0ac7447a authored by Michal Belusiak's avatar Michal Belusiak
Browse files

BluetoothVolumeControl: Add default implementation to deprecated callback API

Without that user has to override deprecated API.

Bug: 327543670
Flag: Exempt, cannot flag deprecated API
Test: atest VolumeControlServiceTest BluetoothVolumeControlTest
Change-Id: Iab8adaaddc78104dbf946be1fd98aaa967b23d7d
parent 3d03fd40
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1124,7 +1124,7 @@ package android.bluetooth {
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_broadcast_volume_control_for_connected_devices") public default void onDeviceVolumeChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0, to=255) int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") public default void onVolumeOffsetAudioDescriptionChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @NonNull String);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") public default void onVolumeOffsetAudioLocationChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
    method @Deprecated public void onVolumeOffsetChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0xffffff01, to=255) int);
    method @Deprecated public default void onVolumeOffsetChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0xffffff01, to=255) int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") public default void onVolumeOffsetChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
  }

+3 −2
Original line number Diff line number Diff line
@@ -94,8 +94,9 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
         */
        @Deprecated
        @SystemApi
        void onVolumeOffsetChanged(
                @NonNull BluetoothDevice device, @IntRange(from = -255, to = 255) int volumeOffset);
        default void onVolumeOffsetChanged(
                @NonNull BluetoothDevice device,
                @IntRange(from = -255, to = 255) int volumeOffset) {}

        /**
         * Callback invoked when callback is registered and when volume offset changes on the remote