Don't destroy preserved surfaces when cleaning up on resume.

We clean up surfaces from apps which were stopping (mDestroying=true)
but not stopped when we resume, as described in commit 45e6d2d. The removal
of preserved surfaces was added earlier in eb66557 for a use case where
an app is stopped without an animation pass. It seems the clean up of preserved
surfaces on resume may be more coincidental than intentional, so let's try
disabling it! This fixes flicker at the end of the PiP animation when we use
preserved surfaces for switching in to fullscreen.

Bug: 35396882
Test: Move PiP to fullscreen. No flickers?
Change-Id: I0df55b11774c826027b0982fca7a28f4d8322d1d
This commit is contained in:
Robert Carr
2017-03-01 20:17:58 -08:00
parent e65a1c4fde
commit db2f6e6edf

View File

@@ -2721,29 +2721,32 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
destroyedSomething |= c.destroySurface(cleanupOnResume, appStopped);
}
if (appStopped || mWindowRemovalAllowed || cleanupOnResume) {
mWinAnimator.destroyPreservedSurfaceLocked();
if (mDestroying) {
if (DEBUG_ADD_REMOVE) Slog.e(TAG_WM, "win=" + this
+ " destroySurfaces: appStopped=" + appStopped
+ " win.mWindowRemovalAllowed=" + mWindowRemovalAllowed
+ " win.mRemoveOnExit=" + mRemoveOnExit);
if (!cleanupOnResume || mRemoveOnExit) {
destroyOrSaveSurface();
}
if (mRemoveOnExit) {
removeImmediately();
}
if (cleanupOnResume) {
requestUpdateWallpaperIfNeeded();
}
mDestroying = false;
destroyedSomething = true;
}
if (!(appStopped || mWindowRemovalAllowed || cleanupOnResume)) {
return destroyedSomething;
}
if (appStopped || mWindowRemovalAllowed) {
mWinAnimator.destroyPreservedSurfaceLocked();
}
if (mDestroying) {
if (DEBUG_ADD_REMOVE) Slog.e(TAG_WM, "win=" + this
+ " destroySurfaces: appStopped=" + appStopped
+ " win.mWindowRemovalAllowed=" + mWindowRemovalAllowed
+ " win.mRemoveOnExit=" + mRemoveOnExit);
if (!cleanupOnResume || mRemoveOnExit) {
destroyOrSaveSurface();
}
if (mRemoveOnExit) {
removeImmediately();
}
if (cleanupOnResume) {
requestUpdateWallpaperIfNeeded();
}
mDestroying = false;
destroyedSomething = true;
}
return destroyedSomething;
}
@@ -4401,7 +4404,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// will keep their surface and its size may change over time.
if (mHasSurface && !isChildWindow()) {
mWinAnimator.preserveSurfaceLocked();
result |= RELAYOUT_RES_FIRST_TIME;
result |= RELAYOUT_RES_SURFACE_CHANGED |
RELAYOUT_RES_FIRST_TIME;
}
}
final boolean freeformResizing = isDragResizing()