Don't applyReady immediately if WCT is launching activity

In this case, we need to wait for the activity lifecycle
callbacks or else we just immediately make a no-op. This
is a temporary fix until we address readiness properly.

Bug: 294624260
Test: start transition w/ launchtask (eg. with fullscreen app,
      go to recents, start entering split w/ that app, "cancel"
      split by tapping app preview to launch it in fullscreen).
Change-Id: If0852d184fe440f52f91b489a786201f86e41d59
This commit is contained in:
Evan Rosky
2023-08-07 18:16:31 -07:00
parent 191f2fd456
commit adcf46d698

View File

@@ -309,6 +309,14 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
applyTransaction(wct, -1 /* syncId */, nextTransition, caller,
deferred);
if (needsSetReady) {
// TODO(b/294925498): Remove this once we have accurate ready
// tracking.
if (hasActivityLaunch(wct) && !mService.mRootWindowContainer
.allPausedActivitiesComplete()) {
// WCT is launching an activity, so we need to wait for its
// lifecycle events.
return;
}
nextTransition.setAllReady();
}
});
@@ -344,6 +352,15 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
}
}
private static boolean hasActivityLaunch(WindowContainerTransaction wct) {
for (int i = 0; i < wct.getHierarchyOps().size(); ++i) {
if (wct.getHierarchyOps().get(i).getType() == HIERARCHY_OP_TYPE_LAUNCH_TASK) {
return true;
}
}
return false;
}
@Override
public int startLegacyTransition(int type, @NonNull RemoteAnimationAdapter adapter,
@NonNull IWindowContainerTransactionCallback callback,