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

Commit 787b244d authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Attempt to fix WrongTypeOfReturnValue flaky exception

The flake may be caused by multi-thread issue. As most of the
performSurfacePlacement access are holding the lock, try to hold the
lock.

Test: atest AppTransitionTests
Bug: 74078662
Change-Id: I2132f90222a3ea21454aae2fdb305b7a9bd715d9
parent 2949a41a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -55,8 +55,11 @@ public class AppTransitionTests extends WindowTestsBase {

    @Before
    public void setUp() throws Exception {
        synchronized (mWm.mGlobalLock) {
            // Hold the lock to protect the stubbing from being accessed by other threads.
            spyOn(mWm.mRoot);
            doNothing().when(mWm.mRoot).performSurfacePlacement(anyBoolean());
        }
        mDc = mWm.getDefaultDisplayContentLocked();
    }