Only use outsets for full screen windows.
Change-Id: I1d89c314b0f9944dfa417ce066c397073d51466e
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -598,7 +598,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();
|
||||
@@ -661,10 +664,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) {
|
||||
|
||||
Reference in New Issue
Block a user