diff options
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 9 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowState.java | 17 |
2 files changed, 17 insertions, 9 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index d08f5d1fc190..ae19e1d62d71 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -3641,7 +3641,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { final Rect vf = mTmpVisibleFrame; final Rect dcf = mTmpDecorFrame; final Rect sf = mTmpStableFrame; - final Rect osf = mTmpOutsetFrame; + Rect osf = null; dcf.setEmpty(); final boolean hasNavBar = (isDefaultDisplay && mHasNavigationBar @@ -3654,7 +3654,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { } else { sf.set(mOverscanLeft, mOverscanTop, mOverscanRight, mOverscanBottom); } - osf.set(mStableLeft, mStableTop, mStableRight, mStableBottom); if (!isDefaultDisplay) { if (attached != null) { @@ -4029,7 +4028,9 @@ 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) { + if (isDefaultDisplay && (fl & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0) { + osf = mTmpOutsetFrame; + osf.set(cf.left, cf.top, cf.right, cf.bottom); int outset = ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources()); if (outset > 0) { int rotation = Surface.ROTATION_0; @@ -4060,7 +4061,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { + " cf=" + cf.toShortString() + " vf=" + vf.toShortString() + " dcf=" + dcf.toShortString() + " sf=" + sf.toShortString() - + " osf=" + osf.toShortString()); + + " osf=" + (osf == null ? "null" : osf.toShortString())); win.computeFrameLw(pf, df, of, cf, vf, dcf, sf, osf); diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index a2b1880fcbe8..9f679982c773 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -596,7 +596,10 @@ final class WindowState implements WindowManagerPolicy.WindowState { mVisibleFrame.set(vf); mDecorFrame.set(dcf); mStableFrame.set(sf); - mOutsetFrame.set(osf); + final boolean hasOutsets = osf != null; + if (hasOutsets) { + mOutsetFrame.set(osf); + } final int fw = mFrame.width(); final int fh = mFrame.height(); @@ -659,10 +662,14 @@ final class WindowState implements WindowManagerPolicy.WindowState { Math.max(mFrame.right - mStableFrame.right, 0), Math.max(mFrame.bottom - mStableFrame.bottom, 0)); - mOutsets.set(Math.max(mContentFrame.left - mOutsetFrame.left, 0), - Math.max(mContentFrame.top - mOutsetFrame.top, 0), - Math.max(mOutsetFrame.right - mContentFrame.right, 0), - Math.max(mOutsetFrame.bottom - mContentFrame.bottom, 0)); + if (hasOutsets) { + mOutsets.set(Math.max(mContentFrame.left - mOutsetFrame.left, 0), + Math.max(mContentFrame.top - mOutsetFrame.top, 0), + Math.max(mOutsetFrame.right - mContentFrame.right, 0), + Math.max(mOutsetFrame.bottom - mContentFrame.bottom, 0)); + } else { + mOutsets.set(0, 0, 0, 0); + } mCompatFrame.set(mFrame); if (mEnforceSizeCompat) { |