From b6d4e2be31eeae83a1b80689073f10ffaeab8a58 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Fri, 30 Mar 2018 15:39:58 -0700 Subject: [PATCH] Avoid calling detachChildren from onAppVisibilityChanged When entering PiP we use mDeferHidingClient to prevent sending the app visibility to the client before it has a chance to enter PiP. However, WindowState#onAppVisibilityChanged is not guarded by this so we could end up detaching children when we mean to enter PiP. Instead only detach children from sendAppVisibilityToClients so that we are correctly guarded by the mDeferHidingClient flag. Bug: 77294187 Test: Manual. go/wm-smoke. Change-Id: Ia9df12fadf3c48d0704e9e6d7e98a6e9cf46783d --- services/core/java/com/android/server/wm/WindowState.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 0debf83713f15..54c2e9badc7b0 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -1691,13 +1691,6 @@ class WindowState extends WindowContainer implements WindowManagerP return changed; } - // Next up we will notify the client that it's visibility has changed. - // We need to prevent it from destroying child surfaces until - // the animation has finished. - if (!visible && isVisibleNow()) { - mWinAnimator.detachChildren(); - } - if (visible != isVisibleNow()) { if (!runningAppAnimation) { final AccessibilityController accessibilityController =