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

Commit 444b1a9f authored by Grzegorz Kołodziejczyk's avatar Grzegorz Kołodziejczyk Committed by Grzegorz Kolodziejczyk (xWF)
Browse files

bass_client: Imitate receive state change when source removed

Source remove inject should also imitate receive state updated as state
machine does.

Bug: 360051130
Test: atest BassClientServiceTest
Flag: EXEMPT; simple fix
Change-Id: I6f9ce3130d5e9df9e78304d4a4f718fe5fdca1d8
parent 4ee5d7f1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1693,10 +1693,16 @@ public class BassClientServiceTest {
                });
        doReturn(stateList).when(sm).getAllSources();

        Optional<BluetoothLeBroadcastReceiveState> receiveState =
                stateList.stream().filter(e -> e.getSourceId() == sourceId).findFirst();

        mBassClientService
                .getCallbacks()
                .notifySourceRemoved(
                        sm.getDevice(), sourceId, BluetoothStatusCodes.REASON_LOCAL_APP_REQUEST);
        mBassClientService
                .getCallbacks()
                .notifyReceiveStateChanged(sm.getDevice(), sourceId, receiveState.get());
        TestUtils.waitForLooperToFinishScheduledTask(mBassClientService.getCallbacks().getLooper());
    }