Loading services/core/java/com/android/server/policy/WindowManagerPolicy.java +0 −8 Original line number Diff line number Diff line Loading @@ -395,14 +395,6 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { return false; } /** * Returns true if the window has a letterbox and any part of that letterbox overlaps with * the given {@code rect}. */ default boolean isLetterboxedOverlappingWith(Rect rect) { return false; } /** @return the current windowing mode of this window. */ int getWindowingMode(); Loading services/core/java/com/android/server/wm/ActivityRecord.java +3 −4 Original line number Diff line number Diff line Loading @@ -1419,11 +1419,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } /** * @return {@code true} if there is a letterbox and any part of that letterbox overlaps with * the given {@code rect}. * @see Letterbox#notIntersectsOrFullyContains(Rect) */ boolean isLetterboxOverlappingWith(Rect rect) { return mLetterbox != null && mLetterbox.isOverlappingWith(rect); boolean letterboxNotIntersectsOrFullyContains(Rect rect) { return mLetterbox == null || mLetterbox.notIntersectsOrFullyContains(rect); } static class Token extends IApplicationToken.Stub { Loading services/core/java/com/android/server/wm/BarController.java +1 −1 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ public class BarController { } boolean isTransparentAllowed(WindowState win) { return win == null || !win.isLetterboxedOverlappingWith(mContentFrame); return win == null || win.letterboxNotIntersectsOrFullyContains(mContentFrame); } boolean setBarShowingLw(final boolean show) { Loading services/core/java/com/android/server/wm/Letterbox.java +21 −20 Original line number Diff line number Diff line Loading @@ -77,10 +77,10 @@ public class Letterbox { mOuter.set(outer); mInner.set(inner); mTop.layout(outer.left, outer.top, inner.right, inner.top, surfaceOrigin); mLeft.layout(outer.left, inner.top, inner.left, outer.bottom, surfaceOrigin); mBottom.layout(inner.left, inner.bottom, outer.right, outer.bottom, surfaceOrigin); mRight.layout(inner.right, outer.top, outer.right, inner.bottom, surfaceOrigin); mTop.layout(outer.left, outer.top, outer.right, inner.top, surfaceOrigin); mLeft.layout(outer.left, outer.top, inner.left, outer.bottom, surfaceOrigin); mBottom.layout(outer.left, inner.bottom, outer.right, outer.bottom, surfaceOrigin); mRight.layout(inner.right, outer.top, outer.right, outer.bottom, surfaceOrigin); } Loading @@ -101,17 +101,29 @@ public class Letterbox { } /** * Returns true if any part of the letterbox overlaps with the given {@code rect}. * Returns {@code true} if the letterbox does not overlap with the bar, or the letterbox can * fully cover the window frame. * * @param rect The area of the window frame. */ public boolean isOverlappingWith(Rect rect) { boolean notIntersectsOrFullyContains(Rect rect) { int emptyCount = 0; int noOverlappingCount = 0; for (LetterboxSurface surface : mSurfaces) { if (surface.isOverlappingWith(rect)) { final Rect surfaceRect = surface.mLayoutFrameGlobal; if (surfaceRect.isEmpty()) { // empty letterbox emptyCount++; } else if (!Rect.intersects(surfaceRect, rect)) { // no overlapping noOverlappingCount++; } else if (surfaceRect.contains(rect)) { // overlapping and covered return true; } } return false; return (emptyCount + noOverlappingCount) == mSurfaces.length; } /** * Hides the letterbox. * Loading Loading @@ -282,17 +294,6 @@ public class Letterbox { return Math.max(0, mLayoutFrameGlobal.height()); } /** * Returns if the given {@code rect} overlaps with this letterbox piece. * @param rect the area to check for overlap in global coordinates */ public boolean isOverlappingWith(Rect rect) { if (mLayoutFrameGlobal.isEmpty()) { return false; } return Rect.intersects(rect, mLayoutFrameGlobal); } public void applySurfaceChanges(SurfaceControl.Transaction t) { if (mSurfaceFrameRelative.equals(mLayoutFrameRelative)) { // Nothing changed. Loading services/core/java/com/android/server/wm/WindowState.java +6 −3 Original line number Diff line number Diff line Loading @@ -3660,9 +3660,12 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP return mActivityRecord.getBounds().equals(mTmpRect); } @Override public boolean isLetterboxedOverlappingWith(Rect rect) { return mActivityRecord != null && mActivityRecord.isLetterboxOverlappingWith(rect); /** * @see Letterbox#notIntersectsOrFullyContains(Rect) */ boolean letterboxNotIntersectsOrFullyContains(Rect rect) { return mActivityRecord == null || mActivityRecord.letterboxNotIntersectsOrFullyContains(rect); } boolean isDragResizeChanged() { Loading Loading
services/core/java/com/android/server/policy/WindowManagerPolicy.java +0 −8 Original line number Diff line number Diff line Loading @@ -395,14 +395,6 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { return false; } /** * Returns true if the window has a letterbox and any part of that letterbox overlaps with * the given {@code rect}. */ default boolean isLetterboxedOverlappingWith(Rect rect) { return false; } /** @return the current windowing mode of this window. */ int getWindowingMode(); Loading
services/core/java/com/android/server/wm/ActivityRecord.java +3 −4 Original line number Diff line number Diff line Loading @@ -1419,11 +1419,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } /** * @return {@code true} if there is a letterbox and any part of that letterbox overlaps with * the given {@code rect}. * @see Letterbox#notIntersectsOrFullyContains(Rect) */ boolean isLetterboxOverlappingWith(Rect rect) { return mLetterbox != null && mLetterbox.isOverlappingWith(rect); boolean letterboxNotIntersectsOrFullyContains(Rect rect) { return mLetterbox == null || mLetterbox.notIntersectsOrFullyContains(rect); } static class Token extends IApplicationToken.Stub { Loading
services/core/java/com/android/server/wm/BarController.java +1 −1 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ public class BarController { } boolean isTransparentAllowed(WindowState win) { return win == null || !win.isLetterboxedOverlappingWith(mContentFrame); return win == null || win.letterboxNotIntersectsOrFullyContains(mContentFrame); } boolean setBarShowingLw(final boolean show) { Loading
services/core/java/com/android/server/wm/Letterbox.java +21 −20 Original line number Diff line number Diff line Loading @@ -77,10 +77,10 @@ public class Letterbox { mOuter.set(outer); mInner.set(inner); mTop.layout(outer.left, outer.top, inner.right, inner.top, surfaceOrigin); mLeft.layout(outer.left, inner.top, inner.left, outer.bottom, surfaceOrigin); mBottom.layout(inner.left, inner.bottom, outer.right, outer.bottom, surfaceOrigin); mRight.layout(inner.right, outer.top, outer.right, inner.bottom, surfaceOrigin); mTop.layout(outer.left, outer.top, outer.right, inner.top, surfaceOrigin); mLeft.layout(outer.left, outer.top, inner.left, outer.bottom, surfaceOrigin); mBottom.layout(outer.left, inner.bottom, outer.right, outer.bottom, surfaceOrigin); mRight.layout(inner.right, outer.top, outer.right, outer.bottom, surfaceOrigin); } Loading @@ -101,17 +101,29 @@ public class Letterbox { } /** * Returns true if any part of the letterbox overlaps with the given {@code rect}. * Returns {@code true} if the letterbox does not overlap with the bar, or the letterbox can * fully cover the window frame. * * @param rect The area of the window frame. */ public boolean isOverlappingWith(Rect rect) { boolean notIntersectsOrFullyContains(Rect rect) { int emptyCount = 0; int noOverlappingCount = 0; for (LetterboxSurface surface : mSurfaces) { if (surface.isOverlappingWith(rect)) { final Rect surfaceRect = surface.mLayoutFrameGlobal; if (surfaceRect.isEmpty()) { // empty letterbox emptyCount++; } else if (!Rect.intersects(surfaceRect, rect)) { // no overlapping noOverlappingCount++; } else if (surfaceRect.contains(rect)) { // overlapping and covered return true; } } return false; return (emptyCount + noOverlappingCount) == mSurfaces.length; } /** * Hides the letterbox. * Loading Loading @@ -282,17 +294,6 @@ public class Letterbox { return Math.max(0, mLayoutFrameGlobal.height()); } /** * Returns if the given {@code rect} overlaps with this letterbox piece. * @param rect the area to check for overlap in global coordinates */ public boolean isOverlappingWith(Rect rect) { if (mLayoutFrameGlobal.isEmpty()) { return false; } return Rect.intersects(rect, mLayoutFrameGlobal); } public void applySurfaceChanges(SurfaceControl.Transaction t) { if (mSurfaceFrameRelative.equals(mLayoutFrameRelative)) { // Nothing changed. Loading
services/core/java/com/android/server/wm/WindowState.java +6 −3 Original line number Diff line number Diff line Loading @@ -3660,9 +3660,12 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP return mActivityRecord.getBounds().equals(mTmpRect); } @Override public boolean isLetterboxedOverlappingWith(Rect rect) { return mActivityRecord != null && mActivityRecord.isLetterboxOverlappingWith(rect); /** * @see Letterbox#notIntersectsOrFullyContains(Rect) */ boolean letterboxNotIntersectsOrFullyContains(Rect rect) { return mActivityRecord == null || mActivityRecord.letterboxNotIntersectsOrFullyContains(rect); } boolean isDragResizeChanged() { Loading