Merge "WindowManager: Take care with Surface lifetime during relayout to invisible." into oc-dev

am: b8bb3f7137

Change-Id: Iceb64847b920939ac2ddfd49e3d7e8b35e5f6a4f
This commit is contained in:
Rob Carr
2017-04-25 20:55:27 +00:00
committed by android-build-merger
4 changed files with 13 additions and 5 deletions

View File

@@ -674,7 +674,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> {
if (win.getDisplayContent().mWallpaperController.isWallpaperTarget(win)) {
wallpaperDestroyed = true;
}
win.destroyOrSaveSurface();
win.destroyOrSaveSurfaceUnchecked();
} while (i > 0);
mService.mDestroySurface.clear();
}

View File

@@ -2141,7 +2141,12 @@ public class WindowManagerService extends IWindowManager.Stub
if (mInputMethodWindow == win) {
setInputMethodWindowLocked(null);
}
win.destroyOrSaveSurface();
boolean stopped = win.mAppToken != null ? win.mAppToken.mAppStopped : false;
// We set mDestroying=true so AppWindowToken#notifyAppStopped in-to destroy surfaces
// will later actually destroy the surface if we do not do so here. Normally we leave
// this to the exit animation.
win.mDestroying = true;
win.destroySurface(false, stopped);
}
// TODO(multidisplay): Magnification is supported only for the default display.
if (mAccessibilityController != null && win.getDisplayId() == DEFAULT_DISPLAY) {

View File

@@ -2710,7 +2710,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
+ " win.mWindowRemovalAllowed=" + mWindowRemovalAllowed
+ " win.mRemoveOnExit=" + mRemoveOnExit);
if (!cleanupOnResume || mRemoveOnExit) {
destroyOrSaveSurface();
destroyOrSaveSurfaceUnchecked();
}
if (mRemoveOnExit) {
removeImmediately();
@@ -2725,7 +2725,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return destroyedSomething;
}
void destroyOrSaveSurface() {
// Destroy or save the application surface without checking
// various indicators of whether the client has released the surface.
// This is in general unsafe, and most callers should use {@link #destroySurface}
void destroyOrSaveSurfaceUnchecked() {
mSurfaceSaved = shouldSaveSurface();
if (mSurfaceSaved) {
if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {

View File

@@ -341,7 +341,7 @@ class WindowStateAnimator {
mAnimation.cancel();
mAnimation = null;
mLocalAnimating = false;
mWin.destroyOrSaveSurface();
mWin.destroyOrSaveSurfaceUnchecked();
}
}