From b7de0e5467ebcf44ecb5a273542d42b1cd297ee3 Mon Sep 17 00:00:00 2001 From: Filip Gruszczynski Date: Mon, 1 Jun 2015 15:53:09 -0700 Subject: [PATCH] More inclusive rules for using outsets. Just fullscreen windows is not enough for existing uses. We also need to preserve chin functionality for overscan windows and wallpapers. Change-Id: I0266d126244102e04bb29aa08e122b3c68d88383 --- .../android/internal/policy/impl/PhoneWindowManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 6e6db3b50fc94..37e110997425d 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -4028,7 +4028,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { // If the device has a chin (e.g. some watches), a dead area at the bottom of the screen we // need to provide information to the clients that want to pretend that you can draw there. - if (isDefaultDisplay && (fl & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0) { + // We only want to apply outsets to certain types of windows. For example, we never want to + // apply the outsets to floating dialogs, because they wouldn't make sense there. + final boolean useOutsets = attrs.type == TYPE_WALLPAPER + || (fl & (WindowManager.LayoutParams.FLAG_FULLSCREEN + | WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN)) != 0; + if (isDefaultDisplay && useOutsets) { osf = mTmpOutsetFrame; osf.set(cf.left, cf.top, cf.right, cf.bottom); int outset = ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources());