Merge "Ensure activity visibility gets updated before executing transition" into tm-dev

This commit is contained in:
Louis Chang
2022-04-18 06:49:17 +00:00
committed by Android (Google) Code Review

View File

@@ -1034,20 +1034,20 @@ class TaskFragment extends WindowContainer<WindowContainer> {
// If the top activity is the resumed one, nothing to do. // If the top activity is the resumed one, nothing to do.
if (mResumedActivity == next && next.isState(RESUMED) if (mResumedActivity == next && next.isState(RESUMED)
&& taskDisplayArea.allResumedActivitiesComplete()) { && taskDisplayArea.allResumedActivitiesComplete()) {
// Ensure the visibility gets updated before execute app transition.
taskDisplayArea.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
false /* preserveWindows */, true /* notifyClients */);
// Make sure we have executed any pending transitions, since there // Make sure we have executed any pending transitions, since there
// should be nothing left to do at this point. // should be nothing left to do at this point.
executeAppTransition(options); executeAppTransition(options);
// For devices that are not in fullscreen mode (e.g. freeform windows), it's possible
// we still want to check if the visibility of other windows have changed (e.g. bringing // In a multi-resumed environment, like in a freeform device, the top
// a fullscreen window forward to cover another freeform activity.) // activity can be resumed, but it might not be the focused app.
if (taskDisplayArea.inMultiWindowMode()) { // Set focused app when top activity is resumed
if (taskDisplayArea.mDisplayContent != null if (taskDisplayArea.inMultiWindowMode() && taskDisplayArea.mDisplayContent != null
&& taskDisplayArea.mDisplayContent.mFocusedApp != next) { && taskDisplayArea.mDisplayContent.mFocusedApp != next) {
taskDisplayArea.mDisplayContent.setFocusedApp(next); taskDisplayArea.mDisplayContent.setFocusedApp(next);
} }
taskDisplayArea.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
false /* preserveWindows */, true /* notifyClients */);
}
ProtoLog.d(WM_DEBUG_STATES, "resumeTopActivity: Top activity " ProtoLog.d(WM_DEBUG_STATES, "resumeTopActivity: Top activity "
+ "resumed %s", next); + "resumed %s", next);
return false; return false;