Only use outsets for full screen windows.

Change-Id: I1d89c314b0f9944dfa417ce066c397073d51466e
This commit is contained in:
Filip Gruszczynski
2015-05-27 15:38:29 -07:00
parent f33da5188d
commit 35a803beec
2 changed files with 17 additions and 9 deletions

View File

@@ -3641,7 +3641,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
final Rect vf = mTmpVisibleFrame; final Rect vf = mTmpVisibleFrame;
final Rect dcf = mTmpDecorFrame; final Rect dcf = mTmpDecorFrame;
final Rect sf = mTmpStableFrame; final Rect sf = mTmpStableFrame;
final Rect osf = mTmpOutsetFrame; Rect osf = null;
dcf.setEmpty(); dcf.setEmpty();
final boolean hasNavBar = (isDefaultDisplay && mHasNavigationBar final boolean hasNavBar = (isDefaultDisplay && mHasNavigationBar
@@ -3654,7 +3654,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
} else { } else {
sf.set(mOverscanLeft, mOverscanTop, mOverscanRight, mOverscanBottom); sf.set(mOverscanLeft, mOverscanTop, mOverscanRight, mOverscanBottom);
} }
osf.set(mStableLeft, mStableTop, mStableRight, mStableBottom);
if (!isDefaultDisplay) { if (!isDefaultDisplay) {
if (attached != null) { 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 // 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. // 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()); int outset = ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources());
if (outset > 0) { if (outset > 0) {
int rotation = Surface.ROTATION_0; int rotation = Surface.ROTATION_0;
@@ -4060,7 +4061,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
+ " cf=" + cf.toShortString() + " vf=" + vf.toShortString() + " cf=" + cf.toShortString() + " vf=" + vf.toShortString()
+ " dcf=" + dcf.toShortString() + " dcf=" + dcf.toShortString()
+ " sf=" + sf.toShortString() + " sf=" + sf.toShortString()
+ " osf=" + osf.toShortString()); + " osf=" + (osf == null ? "null" : osf.toShortString()));
win.computeFrameLw(pf, df, of, cf, vf, dcf, sf, osf); win.computeFrameLw(pf, df, of, cf, vf, dcf, sf, osf);

View File

@@ -598,7 +598,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mVisibleFrame.set(vf); mVisibleFrame.set(vf);
mDecorFrame.set(dcf); mDecorFrame.set(dcf);
mStableFrame.set(sf); mStableFrame.set(sf);
final boolean hasOutsets = osf != null;
if (hasOutsets) {
mOutsetFrame.set(osf); mOutsetFrame.set(osf);
}
final int fw = mFrame.width(); final int fw = mFrame.width();
final int fh = mFrame.height(); final int fh = mFrame.height();
@@ -661,10 +664,14 @@ final class WindowState implements WindowManagerPolicy.WindowState {
Math.max(mFrame.right - mStableFrame.right, 0), Math.max(mFrame.right - mStableFrame.right, 0),
Math.max(mFrame.bottom - mStableFrame.bottom, 0)); Math.max(mFrame.bottom - mStableFrame.bottom, 0));
if (hasOutsets) {
mOutsets.set(Math.max(mContentFrame.left - mOutsetFrame.left, 0), mOutsets.set(Math.max(mContentFrame.left - mOutsetFrame.left, 0),
Math.max(mContentFrame.top - mOutsetFrame.top, 0), Math.max(mContentFrame.top - mOutsetFrame.top, 0),
Math.max(mOutsetFrame.right - mContentFrame.right, 0), Math.max(mOutsetFrame.right - mContentFrame.right, 0),
Math.max(mOutsetFrame.bottom - mContentFrame.bottom, 0)); Math.max(mOutsetFrame.bottom - mContentFrame.bottom, 0));
} else {
mOutsets.set(0, 0, 0, 0);
}
mCompatFrame.set(mFrame); mCompatFrame.set(mFrame);
if (mEnforceSizeCompat) { if (mEnforceSizeCompat) {