Loading services/core/java/com/android/server/wm/ActivityRecord.java +0 −8 Original line number Diff line number Diff line Loading @@ -1419,14 +1419,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return mLetterboxUiController.isFullyTransparentBarAllowed(rect); } /** * @return {@code true} if there is a letterbox and any part of that letterbox overlaps with * the given {@code rect}. */ boolean isLetterboxOverlappingWith(Rect rect) { return mLetterboxUiController.isLetterboxOverlappingWith(rect); } static class Token extends IApplicationToken.Stub { private WeakReference<ActivityRecord> weakActivity; private final String name; Loading services/core/java/com/android/server/wm/DisplayPolicy.java +16 −36 Original line number Diff line number Diff line Loading @@ -146,7 +146,6 @@ import android.view.View; import android.view.ViewDebug; import android.view.WindowInsets.Type; import android.view.WindowInsets.Type.InsetsType; import android.view.WindowInsetsController.Appearance; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; import android.view.WindowManagerGlobal; Loading Loading @@ -2495,12 +2494,10 @@ public class DisplayPolicy { mService.getRootTaskBounds(inSplitScreen ? WINDOWING_MODE_SPLIT_SCREEN_SECONDARY : WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_UNDEFINED, mNonDockedRootTaskBounds); final int fullscreenAppearance = updateLightStatusBarLw(0 /* appearance */, mTopFullscreenOpaqueWindowState, mTopFullscreenOpaqueOrDimmingWindowState, mNonDockedRootTaskBounds); final int dockedAppearance = updateLightStatusBarLw(0 /* appearance */, mTopDockedOpaqueWindowState, mTopDockedOpaqueOrDimmingWindowState, mDockedRootTaskBounds); final int fullscreenAppearance = getStatusBarAppearance(mTopFullscreenOpaqueWindowState, mTopFullscreenOpaqueOrDimmingWindowState); final int dockedAppearance = getStatusBarAppearance(mTopDockedOpaqueWindowState, mTopDockedOpaqueOrDimmingWindowState); final int disableFlags = win.getDisableFlags(); final int opaqueAppearance = updateSystemBarsLw(win, disableFlags); final WindowState navColorWin = chooseNavigationColorWindowLw( Loading Loading @@ -2560,30 +2557,12 @@ public class DisplayPolicy { return true; } private int updateLightStatusBarLw(@Appearance int appearance, WindowState opaque, WindowState opaqueOrDimming, Rect rootTaskBounds) { final DisplayRotation displayRotation = mDisplayContent.getDisplayRotation(); final int statusBarHeight = mStatusBarHeightForRotation[displayRotation.getRotation()]; final boolean rootTaskBoundsContainStatusBar = rootTaskBounds.isEmpty() ? false : rootTaskBounds.top < statusBarHeight; private int getStatusBarAppearance(WindowState opaque, WindowState opaqueOrDimming) { final boolean onKeyguard = isKeyguardShowing() && !isKeyguardOccluded(); final WindowState statusColorWin = onKeyguard ? mNotificationShade : opaqueOrDimming; if (rootTaskBoundsContainStatusBar && statusColorWin != null) { if (statusColorWin == opaque || onKeyguard) { // If the top fullscreen-or-dimming window is also the top fullscreen, respect // its light flag. appearance &= ~APPEARANCE_LIGHT_STATUS_BARS; appearance |= statusColorWin.mAttrs.insetsFlags.appearance & APPEARANCE_LIGHT_STATUS_BARS; } else if (statusColorWin.isDimming()) { // Otherwise if it's dimming, clear the light flag. appearance &= ~APPEARANCE_LIGHT_STATUS_BARS; } if (!isLightBarAllowed(statusColorWin, TYPE_STATUS_BAR)) { appearance &= ~APPEARANCE_LIGHT_STATUS_BARS; } } return appearance; final WindowState colorWin = onKeyguard ? mNotificationShade : opaqueOrDimming; return isLightBarAllowed(colorWin, ITYPE_STATUS_BAR) && (colorWin == opaque || onKeyguard) ? (colorWin.mAttrs.insetsFlags.appearance & APPEARANCE_LIGHT_STATUS_BARS) : 0; } @VisibleForTesting Loading Loading @@ -2642,9 +2621,9 @@ public class DisplayPolicy { // Clear the light flag for dimming window. appearance &= ~APPEARANCE_LIGHT_NAVIGATION_BARS; } if (!isLightBarAllowed(navColorWin, TYPE_NAVIGATION_BAR)) { appearance &= ~APPEARANCE_LIGHT_NAVIGATION_BARS; } if (!isLightBarAllowed(navColorWin, ITYPE_NAVIGATION_BAR)) { appearance &= ~APPEARANCE_LIGHT_NAVIGATION_BARS; } return appearance; } Loading Loading @@ -2697,11 +2676,12 @@ public class DisplayPolicy { return appearance; } private boolean isLightBarAllowed(WindowState win, int windowType) { private boolean isLightBarAllowed(WindowState win, @InternalInsetsType int type) { if (win == null) { return true; return false; } return !win.isLetterboxedOverlappingWith(getBarContentFrameForWindow(win, windowType)); final InsetsSource source = win.getInsetsState().peekSource(type); return source != null && Rect.intersects(win.getFrame(), source.getFrame()); } private Rect getBarContentFrameForWindow(WindowState win, int windowType) { Loading services/core/java/com/android/server/wm/Letterbox.java +0 −23 Original line number Diff line number Diff line Loading @@ -149,18 +149,6 @@ public class Letterbox { return (emptyCount + noOverlappingCount) == mSurfaces.length; } /** * Returns true if any part of the letterbox overlaps with the given {@code rect}. */ public boolean isOverlappingWith(Rect rect) { for (LetterboxSurface surface : mSurfaces) { if (surface.isOverlappingWith(rect)) { return true; } } return false; } /** * Hides the letterbox. * Loading Loading @@ -339,17 +327,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 (!needsApplySurfaceChanges()) { // Nothing changed. Loading services/core/java/com/android/server/wm/LetterboxUiController.java +0 −8 Original line number Diff line number Diff line Loading @@ -112,14 +112,6 @@ final class LetterboxUiController { return mLetterbox == null || mLetterbox.notIntersectsOrFullyContains(rect); } /** * @return {@code true} if there is a letterbox and any part of that letterbox overlaps with * the given {@code rect}. */ boolean isLetterboxOverlappingWith(Rect rect) { return mLetterbox != null && mLetterbox.isOverlappingWith(rect); } void updateLetterboxSurface(WindowState winHint) { final WindowState w = mActivityRecord.findMainWindow(); if (w != winHint && winHint != null && w != null) { Loading services/core/java/com/android/server/wm/WindowState.java +0 −4 Original line number Diff line number Diff line Loading @@ -4001,10 +4001,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP return mActivityRecord == null || mActivityRecord.isFullyTransparentBarAllowed(frame); } public boolean isLetterboxedOverlappingWith(Rect rect) { return mActivityRecord != null && mActivityRecord.isLetterboxOverlappingWith(rect); } boolean isDragResizeChanged() { return mDragResizing != computeDragResizing(); } Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +0 −8 Original line number Diff line number Diff line Loading @@ -1419,14 +1419,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return mLetterboxUiController.isFullyTransparentBarAllowed(rect); } /** * @return {@code true} if there is a letterbox and any part of that letterbox overlaps with * the given {@code rect}. */ boolean isLetterboxOverlappingWith(Rect rect) { return mLetterboxUiController.isLetterboxOverlappingWith(rect); } static class Token extends IApplicationToken.Stub { private WeakReference<ActivityRecord> weakActivity; private final String name; Loading
services/core/java/com/android/server/wm/DisplayPolicy.java +16 −36 Original line number Diff line number Diff line Loading @@ -146,7 +146,6 @@ import android.view.View; import android.view.ViewDebug; import android.view.WindowInsets.Type; import android.view.WindowInsets.Type.InsetsType; import android.view.WindowInsetsController.Appearance; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; import android.view.WindowManagerGlobal; Loading Loading @@ -2495,12 +2494,10 @@ public class DisplayPolicy { mService.getRootTaskBounds(inSplitScreen ? WINDOWING_MODE_SPLIT_SCREEN_SECONDARY : WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_UNDEFINED, mNonDockedRootTaskBounds); final int fullscreenAppearance = updateLightStatusBarLw(0 /* appearance */, mTopFullscreenOpaqueWindowState, mTopFullscreenOpaqueOrDimmingWindowState, mNonDockedRootTaskBounds); final int dockedAppearance = updateLightStatusBarLw(0 /* appearance */, mTopDockedOpaqueWindowState, mTopDockedOpaqueOrDimmingWindowState, mDockedRootTaskBounds); final int fullscreenAppearance = getStatusBarAppearance(mTopFullscreenOpaqueWindowState, mTopFullscreenOpaqueOrDimmingWindowState); final int dockedAppearance = getStatusBarAppearance(mTopDockedOpaqueWindowState, mTopDockedOpaqueOrDimmingWindowState); final int disableFlags = win.getDisableFlags(); final int opaqueAppearance = updateSystemBarsLw(win, disableFlags); final WindowState navColorWin = chooseNavigationColorWindowLw( Loading Loading @@ -2560,30 +2557,12 @@ public class DisplayPolicy { return true; } private int updateLightStatusBarLw(@Appearance int appearance, WindowState opaque, WindowState opaqueOrDimming, Rect rootTaskBounds) { final DisplayRotation displayRotation = mDisplayContent.getDisplayRotation(); final int statusBarHeight = mStatusBarHeightForRotation[displayRotation.getRotation()]; final boolean rootTaskBoundsContainStatusBar = rootTaskBounds.isEmpty() ? false : rootTaskBounds.top < statusBarHeight; private int getStatusBarAppearance(WindowState opaque, WindowState opaqueOrDimming) { final boolean onKeyguard = isKeyguardShowing() && !isKeyguardOccluded(); final WindowState statusColorWin = onKeyguard ? mNotificationShade : opaqueOrDimming; if (rootTaskBoundsContainStatusBar && statusColorWin != null) { if (statusColorWin == opaque || onKeyguard) { // If the top fullscreen-or-dimming window is also the top fullscreen, respect // its light flag. appearance &= ~APPEARANCE_LIGHT_STATUS_BARS; appearance |= statusColorWin.mAttrs.insetsFlags.appearance & APPEARANCE_LIGHT_STATUS_BARS; } else if (statusColorWin.isDimming()) { // Otherwise if it's dimming, clear the light flag. appearance &= ~APPEARANCE_LIGHT_STATUS_BARS; } if (!isLightBarAllowed(statusColorWin, TYPE_STATUS_BAR)) { appearance &= ~APPEARANCE_LIGHT_STATUS_BARS; } } return appearance; final WindowState colorWin = onKeyguard ? mNotificationShade : opaqueOrDimming; return isLightBarAllowed(colorWin, ITYPE_STATUS_BAR) && (colorWin == opaque || onKeyguard) ? (colorWin.mAttrs.insetsFlags.appearance & APPEARANCE_LIGHT_STATUS_BARS) : 0; } @VisibleForTesting Loading Loading @@ -2642,9 +2621,9 @@ public class DisplayPolicy { // Clear the light flag for dimming window. appearance &= ~APPEARANCE_LIGHT_NAVIGATION_BARS; } if (!isLightBarAllowed(navColorWin, TYPE_NAVIGATION_BAR)) { appearance &= ~APPEARANCE_LIGHT_NAVIGATION_BARS; } if (!isLightBarAllowed(navColorWin, ITYPE_NAVIGATION_BAR)) { appearance &= ~APPEARANCE_LIGHT_NAVIGATION_BARS; } return appearance; } Loading Loading @@ -2697,11 +2676,12 @@ public class DisplayPolicy { return appearance; } private boolean isLightBarAllowed(WindowState win, int windowType) { private boolean isLightBarAllowed(WindowState win, @InternalInsetsType int type) { if (win == null) { return true; return false; } return !win.isLetterboxedOverlappingWith(getBarContentFrameForWindow(win, windowType)); final InsetsSource source = win.getInsetsState().peekSource(type); return source != null && Rect.intersects(win.getFrame(), source.getFrame()); } private Rect getBarContentFrameForWindow(WindowState win, int windowType) { Loading
services/core/java/com/android/server/wm/Letterbox.java +0 −23 Original line number Diff line number Diff line Loading @@ -149,18 +149,6 @@ public class Letterbox { return (emptyCount + noOverlappingCount) == mSurfaces.length; } /** * Returns true if any part of the letterbox overlaps with the given {@code rect}. */ public boolean isOverlappingWith(Rect rect) { for (LetterboxSurface surface : mSurfaces) { if (surface.isOverlappingWith(rect)) { return true; } } return false; } /** * Hides the letterbox. * Loading Loading @@ -339,17 +327,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 (!needsApplySurfaceChanges()) { // Nothing changed. Loading
services/core/java/com/android/server/wm/LetterboxUiController.java +0 −8 Original line number Diff line number Diff line Loading @@ -112,14 +112,6 @@ final class LetterboxUiController { return mLetterbox == null || mLetterbox.notIntersectsOrFullyContains(rect); } /** * @return {@code true} if there is a letterbox and any part of that letterbox overlaps with * the given {@code rect}. */ boolean isLetterboxOverlappingWith(Rect rect) { return mLetterbox != null && mLetterbox.isOverlappingWith(rect); } void updateLetterboxSurface(WindowState winHint) { final WindowState w = mActivityRecord.findMainWindow(); if (w != winHint && winHint != null && w != null) { Loading
services/core/java/com/android/server/wm/WindowState.java +0 −4 Original line number Diff line number Diff line Loading @@ -4001,10 +4001,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP return mActivityRecord == null || mActivityRecord.isFullyTransparentBarAllowed(frame); } public boolean isLetterboxedOverlappingWith(Rect rect) { return mActivityRecord != null && mActivityRecord.isLetterboxOverlappingWith(rect); } boolean isDragResizeChanged() { return mDragResizing != computeDragResizing(); } Loading