Fix ReplaceWindowTests#testReplaceWindow_Dock_Relaunch() failure
Window was destroyed and added back when activity relaunched while being moved from fullscreen stack to split-screen primary stack. The activity window was recreated during the relaunch process because RAC#ensureActivitiesVisible() executed recursively and the inner calls override the setting to not preserve windows. Avoid running RAC#ensureActivitiesVisible() recursively. RootActivityContainer#ensureActivitiesVisible() RootActivityContainer#ensureActivitiesVisible(preserveWindows=false) ActivityTaskManagerService#ensureConfigAndVisibilityAfterUpdate() ActivityDisplay#updateDisplayOverrideConfigurationLocked() RootActivityContainer#ensureVisibilityAndConfig() ActivityStack#resumeTopActivityInnerLocked() ActivityStack#resumeTopActivityUncheckedLocked() ActivityRecord#makeActiveIfNeeded() ActivityRecord#makeClientVisible() ActivityRecord#makeVisibleIfNeeded() ActivityStack#ensureActivitiesVisibleLocked() ActivityDisplay#ensureActivitiesVisible() RootActivityContainer#ensureActivitiesVisible() RootActivityContainer#ensureActivitiesVisible(preserveWindows=true) ActivityStack#setWindowingModeInSurfaceTransaction() ActivityStack#lambda$setWindowingMode$0$ActivityStack() WindowManagerService#inSurfaceTransaction() ActivityStack#setWindowingMode() ActivityTaskManagerService#setTaskWindowingModeSplitScreenPrimary() ActivityTaskManagerService#setTaskWindowingMode() Bug: 137232340 Test: atest ReplaceWindowTests Change-Id: I8243a49edf8314100e13d3a15b961e3d768f6364
This commit is contained in:
@@ -196,6 +196,9 @@ class RootActivityContainer extends ConfigurationContainer
|
||||
/** Set when a power hint has started, but not ended. */
|
||||
private boolean mPowerHintSent;
|
||||
|
||||
/** Used to keep ensureActivitiesVisible() from being entered recursively. */
|
||||
private boolean mInEnsureActivitiesVisible = false;
|
||||
|
||||
// The default minimal size that will be used if the activity doesn't specify its minimal size.
|
||||
// It will be calculated when the default display gets added.
|
||||
int mDefaultMinSizeOfResizeableTaskDp = -1;
|
||||
@@ -808,8 +811,14 @@ class RootActivityContainer extends ConfigurationContainer
|
||||
*/
|
||||
void ensureActivitiesVisible(ActivityRecord starting, int configChanges,
|
||||
boolean preserveWindows, boolean notifyClients) {
|
||||
mStackSupervisor.getKeyguardController().beginActivityVisibilityUpdate();
|
||||
if (mInEnsureActivitiesVisible) {
|
||||
// Don't do recursive work.
|
||||
return;
|
||||
}
|
||||
mInEnsureActivitiesVisible = true;
|
||||
|
||||
try {
|
||||
mStackSupervisor.getKeyguardController().beginActivityVisibilityUpdate();
|
||||
// First the front stacks. In case any are not fullscreen and are in front of home.
|
||||
for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) {
|
||||
final ActivityDisplay display = mActivityDisplays.get(displayNdx);
|
||||
@@ -818,6 +827,7 @@ class RootActivityContainer extends ConfigurationContainer
|
||||
}
|
||||
} finally {
|
||||
mStackSupervisor.getKeyguardController().endActivityVisibilityUpdate();
|
||||
mInEnsureActivitiesVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user