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

Commit 9dd0561e authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "A2dpServiceTest: Sync test teardown on main looper" into main am: a81bd3c3

parents 3c48412d a81bd3c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -728,7 +728,7 @@ final class A2dpStateMachine extends StateMachine {
        mA2dpService.codecConfigUpdated(mDevice, mCodecStatus, sameAudioFeedingParameters);
    }

    // This method does not check for error conditon (newState == prevState)
    // This method does not check for error condition (newState == prevState)
    private void broadcastConnectionState(int newState, int prevState) {
        log("Connection state " + mDevice + ": " + profileStateToString(prevState)
                    + "->" + profileStateToString(newState));
+6 −2
Original line number Diff line number Diff line
@@ -122,8 +122,12 @@ public class A2dpServiceTest {
    }

    @After
    public void tearDown() throws Exception {
        mA2dpService.stop();
    public void tearDown() {
        // A2dpService handler is running on main looper. Calling `stop` remove the messages but
        // assume it is already on the correct thread.
        // Calling it from another thread may lead to having messages still being processed and
        // executed after tearDown is called.
        InstrumentationRegistry.getInstrumentation().runOnMainSync(mA2dpService::stop);
    }

    @SafeVarargs