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

Commit 8793bf69 authored by William Escande's avatar William Escande
Browse files

BluetoothVolumeControl: Add default implementation to deprecated callback API

Without that user has to override deprecated API.

Bug: 327543670
Test: atest VolumeControlServiceTest BluetoothVolumeControlTest VolumeControlProfileTest
Change-Id: Ibd1fc734aa63693c5f90328a81d56fa105dc42bd
parent dfa40390
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ public class VolumeControlProfileTest {
        mServiceListener.onServiceConnected(BluetoothProfile.VOLUME_CONTROL, mService);

        final Executor executor = (command -> new Thread(command).start());
        final BluetoothVolumeControl.Callback callback = (device, volumeOffset) -> {};
        final BluetoothVolumeControl.Callback callback = new BluetoothVolumeControl.Callback() {};
        mProfile.registerCallback(executor, callback);

        verify(mService).registerCallback(executor, callback);
@@ -200,7 +200,7 @@ public class VolumeControlProfileTest {

    @Test
    public void unregisterCallback_verifyIsCalled() {
        final BluetoothVolumeControl.Callback callback = (device, volumeOffset) -> {};
        final BluetoothVolumeControl.Callback callback = new BluetoothVolumeControl.Callback() {};
        mServiceListener.onServiceConnected(BluetoothProfile.VOLUME_CONTROL, mService);

        mProfile.unregisterCallback(callback);