Merge "Skip resize changing transition if display is rotating" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-09-01 03:37:15 +00:00
committed by Android (Google) Code Review
5 changed files with 21 additions and 2 deletions

View File

@@ -8418,7 +8418,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
startFreezingScreenLocked(globalChanges); startFreezingScreenLocked(globalChanges);
} }
forceNewConfig = false; forceNewConfig = false;
preserveWindow &= isResizeOnlyChange(changes); // Do not preserve window if it is freezing screen because the original window won't be
// able to update drawn state that causes freeze timeout.
preserveWindow &= isResizeOnlyChange(changes) && !mFreezingScreen;
final boolean hasResizeChange = hasResizeChange(changes & ~info.getRealConfigChanged()); final boolean hasResizeChange = hasResizeChange(changes & ~info.getRealConfigChanged());
if (hasResizeChange) { if (hasResizeChange) {
final boolean isDragResizing = task.isDragResizing(); final boolean isDragResizing = task.isDragResizing();

View File

@@ -3139,6 +3139,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
return mScreenRotationAnimation; return mScreenRotationAnimation;
} }
/** If the display is in transition, there should be a screenshot covering it. */
@Override
boolean inTransition() {
return mScreenRotationAnimation != null || super.inTransition();
}
@Override @Override
public void dumpDebug(ProtoOutputStream proto, long fieldId, public void dumpDebug(ProtoOutputStream proto, long fieldId,
@WindowTraceLogLevel int logLevel) { @WindowTraceLogLevel int logLevel) {

View File

@@ -729,7 +729,12 @@ class ScreenRotationAnimation {
mScreenshotRotationAnimator = null; mScreenshotRotationAnimator = null;
mRotateScreenAnimator = null; mRotateScreenAnimator = null;
mService.mAnimator.mBulkUpdateParams |= WindowSurfacePlacer.SET_UPDATE_ROTATION; mService.mAnimator.mBulkUpdateParams |= WindowSurfacePlacer.SET_UPDATE_ROTATION;
kill(); if (mDisplayContent.getRotationAnimation() == ScreenRotationAnimation.this) {
// It also invokes kill().
mDisplayContent.setRotationAnimation(null);
} else {
kill();
}
mService.updateRotation(false, false); mService.updateRotation(false, false);
} }
} }

View File

@@ -2014,6 +2014,8 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|| mDisplayContent == null || mDisplayContent == null
|| mTaskFragmentOrganizer == null || mTaskFragmentOrganizer == null
|| getSurfaceControl() == null || getSurfaceControl() == null
// The change transition will be covered by display.
|| mDisplayContent.inTransition()
|| !isVisible()) { || !isVisible()) {
return false; return false;
} }

View File

@@ -987,6 +987,10 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
return mDisplayContent != null && mDisplayContent.mChangingContainers.contains(this); return mDisplayContent != null && mDisplayContent.mChangingContainers.contains(this);
} }
boolean inTransition() {
return mWmService.mAtmService.getTransitionController().inTransition(this);
}
void sendAppVisibilityToClients() { void sendAppVisibilityToClients() {
for (int i = mChildren.size() - 1; i >= 0; --i) { for (int i = mChildren.size() - 1; i >= 0; --i) {
final WindowContainer wc = mChildren.get(i); final WindowContainer wc = mChildren.get(i);