Merge "Skip resize changing transition if display is rotating" into sc-v2-dev am: 34ea03d9bf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15727463

Change-Id: I94f73fce5bdbd117f470134af16380000605f0cf
This commit is contained in:
TreeHugger Robot
2021-09-01 03:45:49 +00:00
committed by Automerger Merge Worker
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);
}
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());
if (hasResizeChange) {
final boolean isDragResizing = task.isDragResizing();

View File

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

View File

@@ -729,7 +729,12 @@ class ScreenRotationAnimation {
mScreenshotRotationAnimator = null;
mRotateScreenAnimator = null;
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);
}
}

View File

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

View File

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