Merge "WindowManager: Take care with Surface lifetime during relayout to invisible." into oc-dev
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -341,7 +341,7 @@ class WindowStateAnimator {
|
||||
mAnimation.cancel();
|
||||
mAnimation = null;
|
||||
mLocalAnimating = false;
|
||||
mWin.destroyOrSaveSurface();
|
||||
mWin.destroyOrSaveSurfaceUnchecked();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user