From 7098dbd4d6a7337c6299d386e74f5ec328348229 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Mon, 1 Feb 2016 12:31:01 -0800 Subject: [PATCH] Allow saving child surfaces. We can and should save child surfaces as the client side window state hasn't been torn down in the case where we would otherwise save. So, if we destroy the Surface, the client will continue to render and crash. Bug: 26793431 Bug: 25780116 Bug: 26777815 Change-Id: Ia043b7af24b9370fc17a5b57226566f94c08ba4e --- .../core/java/com/android/server/wm/WindowState.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index c541b3f6f56be..5fedd5a25c4be 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -120,6 +120,8 @@ final class WindowState implements WindowManagerPolicy.WindowState { static final int DRAG_RESIZE_MODE_FREEFORM = 0; static final int DRAG_RESIZE_MODE_DOCKED_DIVIDER = 1; + static final boolean DEBUG_DISABLE_SAVING_SURFACES = false; + final WindowManagerService mService; final WindowManagerPolicy mPolicy; final Context mContext; @@ -1795,10 +1797,6 @@ final class WindowState implements WindowManagerPolicy.WindowState { return false; } - if (isChildWindow()) { - return false; - } - Task task = getTask(); if (task == null || task.inHomeStack()) { // Don't save surfaces for home stack apps. These usually resume and draw @@ -1812,6 +1810,10 @@ final class WindowState implements WindowManagerPolicy.WindowState { return false; } + if (DEBUG_DISABLE_SAVING_SURFACES) { + return false; + } + return mAppToken.shouldSaveSurface(); }