From 65567d4e6ca61bbf702afd76e8be938982187e9a Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Tue, 8 Oct 2013 10:08:32 -0400 Subject: [PATCH] Don't crop top-most windows at rest. They can affect the system decor state, cropping to their current requested state is too aggressive. Bug:11079003 Change-Id: Ifec576d41cdefd1b851463d4b12311f1a8e27b3d --- .../android/internal/policy/impl/PhoneWindowManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 3468425e3a13f..de841da31735e 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -3003,9 +3003,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { dcf.bottom = mSystemBottom; final boolean inheritTranslucentDecor = (attrs.privateFlags & WindowManager.LayoutParams.PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR) != 0; - if (attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW - && attrs.type <= WindowManager.LayoutParams.LAST_APPLICATION_WINDOW - && !inheritTranslucentDecor) { + final boolean isAppWindow = + attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && + attrs.type <= WindowManager.LayoutParams.LAST_APPLICATION_WINDOW; + final boolean topAtRest = + win == mTopFullscreenOpaqueWindowState && !win.isAnimatingLw(); + if (isAppWindow && !inheritTranslucentDecor && !topAtRest) { if ((sysUiFl & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0 && (fl & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0 && (fl & WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) == 0) {