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

Commit 52d46f6f authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Fix flakiness of testTransferLaunchCookie" am: c2cd376f am: c51eb6a4 am: 6507326d

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1884198

Change-Id: I41b34afd4466a602b4d997b56370c65b2b3372a3
parents de4dc925 6507326d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -110,18 +110,20 @@ public class ActivityOptionsTest {
            @Override
            public void onTaskAppeared(RunningTaskInfo taskInfo, SurfaceControl leash) {
                try (SurfaceControl.Transaction t = new SurfaceControl.Transaction()) {
                    t.setVisibility(leash, true /* visible */).apply();
                    t.show(leash).apply();
                }
                int cookieIndex = -1;
                if (trampoline.equals(taskInfo.baseActivity)) {
                    cookieIndex = 0;
                } else if (main.equals(taskInfo.baseActivity)) {
                    cookieIndex = 1;
                    mainLatch.countDown();
                }
                if (cookieIndex >= 0) {
                    appearedCookies[cookieIndex] = taskInfo.launchCookies.isEmpty()
                            ? null : taskInfo.launchCookies.get(0);
                    if (cookieIndex == 1) {
                        mainLatch.countDown();
                    }
                }
            }
        };