Merge "Fix flakiness of testTransferLaunchCookie" am: c2cd376f6f am: c51eb6a40e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1884198 Change-Id: Ib606412bdbf77c8b93e574a536000377deb0aeda
This commit is contained in:
@@ -110,18 +110,20 @@ public class ActivityOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
public void onTaskAppeared(RunningTaskInfo taskInfo, SurfaceControl leash) {
|
public void onTaskAppeared(RunningTaskInfo taskInfo, SurfaceControl leash) {
|
||||||
try (SurfaceControl.Transaction t = new SurfaceControl.Transaction()) {
|
try (SurfaceControl.Transaction t = new SurfaceControl.Transaction()) {
|
||||||
t.setVisibility(leash, true /* visible */).apply();
|
t.show(leash).apply();
|
||||||
}
|
}
|
||||||
int cookieIndex = -1;
|
int cookieIndex = -1;
|
||||||
if (trampoline.equals(taskInfo.baseActivity)) {
|
if (trampoline.equals(taskInfo.baseActivity)) {
|
||||||
cookieIndex = 0;
|
cookieIndex = 0;
|
||||||
} else if (main.equals(taskInfo.baseActivity)) {
|
} else if (main.equals(taskInfo.baseActivity)) {
|
||||||
cookieIndex = 1;
|
cookieIndex = 1;
|
||||||
mainLatch.countDown();
|
|
||||||
}
|
}
|
||||||
if (cookieIndex >= 0) {
|
if (cookieIndex >= 0) {
|
||||||
appearedCookies[cookieIndex] = taskInfo.launchCookies.isEmpty()
|
appearedCookies[cookieIndex] = taskInfo.launchCookies.isEmpty()
|
||||||
? null : taskInfo.launchCookies.get(0);
|
? null : taskInfo.launchCookies.get(0);
|
||||||
|
if (cookieIndex == 1) {
|
||||||
|
mainLatch.countDown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user