Merge "Fix flakiness of testTransferLaunchCookie" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-09-22 04:01:09 +00:00
committed by Android (Google) Code Review

View File

@@ -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();
}
}
}
};