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

Commit 64391b65 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Handle AVRCP volume control issue" into main

parents 579915a7 9ce6ff60
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -508,7 +508,8 @@ public class AvrcpControllerService extends ProfileService {
        AvrcpControllerStateMachine stateMachine = getStateMachine(device);
        if (stateMachine != null) {
            stateMachine.sendMessage(
                    AvrcpControllerStateMachine.MESSAGE_PROCESS_REGISTER_ABS_VOL_NOTIFICATION);
                    AvrcpControllerStateMachine.MESSAGE_PROCESS_REGISTER_ABS_VOL_NOTIFICATION,
                    label);
        }
    }

@@ -517,8 +518,8 @@ public class AvrcpControllerService extends ProfileService {
    synchronized void handleSetAbsVolume(BluetoothDevice device, byte absVol, byte label) {
        AvrcpControllerStateMachine stateMachine = getStateMachine(device);
        if (stateMachine != null) {
            stateMachine.sendMessage(AvrcpControllerStateMachine.MESSAGE_PROCESS_SET_ABS_VOL_CMD,
                    absVol);
            stateMachine.sendMessage(
                    AvrcpControllerStateMachine.MESSAGE_PROCESS_SET_ABS_VOL_CMD, absVol, label);
        }
    }

+6 −3
Original line number Diff line number Diff line
@@ -361,8 +361,10 @@ public class AvrcpControllerServiceTest {

        mService.handleRegisterNotificationAbsVol(mRemoteDevice, label);

        verify(mStateMachine).sendMessage(
                AvrcpControllerStateMachine.MESSAGE_PROCESS_REGISTER_ABS_VOL_NOTIFICATION);
        verify(mStateMachine)
                .sendMessage(
                        AvrcpControllerStateMachine.MESSAGE_PROCESS_REGISTER_ABS_VOL_NOTIFICATION,
                        label);
    }

    @Test
@@ -373,7 +375,8 @@ public class AvrcpControllerServiceTest {
        mService.handleSetAbsVolume(mRemoteDevice, absVol, label);

        verify(mStateMachine)
                .sendMessage(AvrcpControllerStateMachine.MESSAGE_PROCESS_SET_ABS_VOL_CMD, absVol);
                .sendMessage(
                        AvrcpControllerStateMachine.MESSAGE_PROCESS_SET_ABS_VOL_CMD, absVol, label);
    }

    @Test