Loading core/java/com/android/internal/policy/SystemBarUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -92,4 +92,11 @@ public final class SystemBarUtils { // Equals to status bar height if status bar height is bigger. return Math.max(defaultSize, statusBarHeight); } /** * Gets the taskbar frame height. */ public static int getTaskbarHeight(Resources res) { return res.getDimensionPixelSize(R.dimen.taskbar_frame_height); } } libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java +17 −2 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ public class DisplayLayout { private boolean mHasNavigationBar = false; private boolean mHasStatusBar = false; private int mNavBarFrameHeight = 0; private int mTaskbarFrameHeight = 0; private boolean mAllowSeamlessRotationDespiteNavBarMoving = false; private boolean mNavigationBarCanMove = false; private boolean mReverseDefaultRotation = false; Loading Loading @@ -119,6 +120,7 @@ public class DisplayLayout { && mNavigationBarCanMove == other.mNavigationBarCanMove && mReverseDefaultRotation == other.mReverseDefaultRotation && mNavBarFrameHeight == other.mNavBarFrameHeight && mTaskbarFrameHeight == other.mTaskbarFrameHeight && Objects.equals(mInsetsState, other.mInsetsState); } Loading @@ -126,7 +128,7 @@ public class DisplayLayout { public int hashCode() { return Objects.hash(mUiMode, mWidth, mHeight, mCutout, mRotation, mDensityDpi, mNonDecorInsets, mStableInsets, mHasNavigationBar, mHasStatusBar, mNavBarFrameHeight, mAllowSeamlessRotationDespiteNavBarMoving, mNavBarFrameHeight, mTaskbarFrameHeight, mAllowSeamlessRotationDespiteNavBarMoving, mNavigationBarCanMove, mReverseDefaultRotation, mInsetsState); } Loading Loading @@ -176,6 +178,7 @@ public class DisplayLayout { mNavigationBarCanMove = dl.mNavigationBarCanMove; mReverseDefaultRotation = dl.mReverseDefaultRotation; mNavBarFrameHeight = dl.mNavBarFrameHeight; mTaskbarFrameHeight = dl.mTaskbarFrameHeight; mNonDecorInsets.set(dl.mNonDecorInsets); mStableInsets.set(dl.mStableInsets); mInsetsState.set(dl.mInsetsState, true /* copySources */); Loading Loading @@ -214,7 +217,8 @@ public class DisplayLayout { if (mHasStatusBar) { convertNonDecorInsetsToStableInsets(res, mStableInsets, mCutout, mHasStatusBar); } mNavBarFrameHeight = getNavigationBarFrameHeight(res, mWidth > mHeight); mNavBarFrameHeight = getNavigationBarFrameHeight(res, /* landscape */ mWidth > mHeight); mTaskbarFrameHeight = SystemBarUtils.getTaskbarHeight(res); } /** Loading Loading @@ -321,6 +325,17 @@ public class DisplayLayout { outBounds.inset(mStableInsets); } /** Predicts the calculated stable bounds when in Desktop Mode. */ public void getStableBoundsForDesktopMode(Rect outBounds) { getStableBounds(outBounds); if (mNavBarFrameHeight != mTaskbarFrameHeight) { // Currently not in pinned taskbar mode, exclude taskbar insets instead of current // navigation insets from bounds. outBounds.bottom = mHeight - mTaskbarFrameHeight; } } /** * Gets navigation bar position for this layout * @return Navigation bar position for this layout. Loading services/core/java/com/android/server/wm/DisplayContent.java +0 −1 Original line number Diff line number Diff line Loading @@ -550,7 +550,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp /** Save allocating when calculating rects */ private final Rect mTmpRect = new Rect(); private final Rect mTmpRect2 = new Rect(); private final Region mTmpRegion = new Region(); private final Configuration mTmpConfiguration = new Configuration(); Loading Loading
core/java/com/android/internal/policy/SystemBarUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -92,4 +92,11 @@ public final class SystemBarUtils { // Equals to status bar height if status bar height is bigger. return Math.max(defaultSize, statusBarHeight); } /** * Gets the taskbar frame height. */ public static int getTaskbarHeight(Resources res) { return res.getDimensionPixelSize(R.dimen.taskbar_frame_height); } }
libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java +17 −2 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ public class DisplayLayout { private boolean mHasNavigationBar = false; private boolean mHasStatusBar = false; private int mNavBarFrameHeight = 0; private int mTaskbarFrameHeight = 0; private boolean mAllowSeamlessRotationDespiteNavBarMoving = false; private boolean mNavigationBarCanMove = false; private boolean mReverseDefaultRotation = false; Loading Loading @@ -119,6 +120,7 @@ public class DisplayLayout { && mNavigationBarCanMove == other.mNavigationBarCanMove && mReverseDefaultRotation == other.mReverseDefaultRotation && mNavBarFrameHeight == other.mNavBarFrameHeight && mTaskbarFrameHeight == other.mTaskbarFrameHeight && Objects.equals(mInsetsState, other.mInsetsState); } Loading @@ -126,7 +128,7 @@ public class DisplayLayout { public int hashCode() { return Objects.hash(mUiMode, mWidth, mHeight, mCutout, mRotation, mDensityDpi, mNonDecorInsets, mStableInsets, mHasNavigationBar, mHasStatusBar, mNavBarFrameHeight, mAllowSeamlessRotationDespiteNavBarMoving, mNavBarFrameHeight, mTaskbarFrameHeight, mAllowSeamlessRotationDespiteNavBarMoving, mNavigationBarCanMove, mReverseDefaultRotation, mInsetsState); } Loading Loading @@ -176,6 +178,7 @@ public class DisplayLayout { mNavigationBarCanMove = dl.mNavigationBarCanMove; mReverseDefaultRotation = dl.mReverseDefaultRotation; mNavBarFrameHeight = dl.mNavBarFrameHeight; mTaskbarFrameHeight = dl.mTaskbarFrameHeight; mNonDecorInsets.set(dl.mNonDecorInsets); mStableInsets.set(dl.mStableInsets); mInsetsState.set(dl.mInsetsState, true /* copySources */); Loading Loading @@ -214,7 +217,8 @@ public class DisplayLayout { if (mHasStatusBar) { convertNonDecorInsetsToStableInsets(res, mStableInsets, mCutout, mHasStatusBar); } mNavBarFrameHeight = getNavigationBarFrameHeight(res, mWidth > mHeight); mNavBarFrameHeight = getNavigationBarFrameHeight(res, /* landscape */ mWidth > mHeight); mTaskbarFrameHeight = SystemBarUtils.getTaskbarHeight(res); } /** Loading Loading @@ -321,6 +325,17 @@ public class DisplayLayout { outBounds.inset(mStableInsets); } /** Predicts the calculated stable bounds when in Desktop Mode. */ public void getStableBoundsForDesktopMode(Rect outBounds) { getStableBounds(outBounds); if (mNavBarFrameHeight != mTaskbarFrameHeight) { // Currently not in pinned taskbar mode, exclude taskbar insets instead of current // navigation insets from bounds. outBounds.bottom = mHeight - mTaskbarFrameHeight; } } /** * Gets navigation bar position for this layout * @return Navigation bar position for this layout. Loading
services/core/java/com/android/server/wm/DisplayContent.java +0 −1 Original line number Diff line number Diff line Loading @@ -550,7 +550,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp /** Save allocating when calculating rects */ private final Rect mTmpRect = new Rect(); private final Rect mTmpRect2 = new Rect(); private final Region mTmpRegion = new Region(); private final Configuration mTmpConfiguration = new Configuration(); Loading