From 37d7a68de7e353c31a3a4736054cd86f0e002eaf Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Thu, 6 Nov 2014 18:15:16 +0100 Subject: Fix inset hinting when adding window Windows with FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS were getting an incorrect content inset hint, because the hinting didn't see the adjusted systemUiVisibility. Also adds hinting for the stable insets. Bug: 17508238 Change-Id: If9647277feb6811b15665b801accd896c51dbd12 --- .../internal/policy/impl/PhoneWindowManager.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'policy/src') diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 3c44e87..f29d5a6 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -3073,7 +3073,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { } @Override - public void getContentInsetHintLw(WindowManager.LayoutParams attrs, Rect contentInset) { + public void getInsetHintLw(WindowManager.LayoutParams attrs, Rect outContentInsets, + Rect outStableInsets) { final int fl = PolicyControl.getWindowFlags(null, attrs); final int sysuiVis = PolicyControl.getSystemUiVisibility(null, attrs); final int systemUiVisibility = (sysuiVis | attrs.subtreeSystemUiVisibility); @@ -3091,26 +3092,30 @@ public class PhoneWindowManager implements WindowManagerPolicy { } if ((systemUiVisibility & View.SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0) { if ((fl & FLAG_FULLSCREEN) != 0) { - contentInset.set(mStableFullscreenLeft, mStableFullscreenTop, + outContentInsets.set(mStableFullscreenLeft, mStableFullscreenTop, availRight - mStableFullscreenRight, availBottom - mStableFullscreenBottom); } else { - contentInset.set(mStableLeft, mStableTop, + outContentInsets.set(mStableLeft, mStableTop, availRight - mStableRight, availBottom - mStableBottom); } } else if ((fl & FLAG_FULLSCREEN) != 0 || (fl & FLAG_LAYOUT_IN_OVERSCAN) != 0) { - contentInset.setEmpty(); + outContentInsets.setEmpty(); } else if ((systemUiVisibility & (View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)) == 0) { - contentInset.set(mCurLeft, mCurTop, + outContentInsets.set(mCurLeft, mCurTop, availRight - mCurRight, availBottom - mCurBottom); } else { - contentInset.set(mCurLeft, mCurTop, + outContentInsets.set(mCurLeft, mCurTop, availRight - mCurRight, availBottom - mCurBottom); } + + outStableInsets.set(mStableLeft, mStableTop, + availRight - mStableRight, availBottom - mStableBottom); return; } - contentInset.setEmpty(); + outContentInsets.setEmpty(); + outStableInsets.setEmpty(); } /** {@inheritDoc} */ -- cgit v1.1