Loading core/proto/android/server/windowmanagerservice.proto +25 −8 Original line number Diff line number Diff line Loading @@ -289,9 +289,10 @@ message WindowStateProto { optional .android.view.WindowLayoutParamsProto attributes = 5; optional .android.graphics.RectProto given_content_insets = 6; optional .android.graphics.RectProto frame = 7; optional .android.graphics.RectProto containing_frame = 8; optional .android.graphics.RectProto parent_frame = 9; optional .android.graphics.RectProto content_frame = 10; reserved 8 to 10; // optional .android.graphics.RectProto containing_frame = 8; // optional .android.graphics.RectProto parent_frame = 9; // optional .android.graphics.RectProto content_frame = 10; optional .android.graphics.RectProto content_insets = 11; optional .android.graphics.RectProto surface_insets = 12; optional WindowStateAnimatorProto animator = 13; Loading @@ -304,11 +305,12 @@ message WindowStateProto { optional int32 system_ui_visibility = 21; optional bool has_surface = 22; optional bool is_ready_for_display = 23; optional .android.graphics.RectProto display_frame = 24; optional .android.graphics.RectProto overscan_frame = 25; optional .android.graphics.RectProto visible_frame = 26; optional .android.graphics.RectProto decor_frame = 27; optional .android.graphics.RectProto outset_frame = 28; reserved 24 to 28; // optional .android.graphics.RectProto display_frame = 24; // optional .android.graphics.RectProto overscan_frame = 25; // optional .android.graphics.RectProto visible_frame = 26; // optional .android.graphics.RectProto decor_frame = 27; // optional .android.graphics.RectProto outset_frame = 28; optional .android.graphics.RectProto overscan_insets = 29; optional .android.graphics.RectProto visible_insets = 30; optional .android.graphics.RectProto stable_insets = 31; Loading @@ -321,6 +323,7 @@ message WindowStateProto { optional bool is_visible = 38; optional bool pending_forced_seamless_rotation = 39; optional int64 finished_forced_seamless_rotation_frame = 40; optional WindowFramesProto window_frames = 41; } message IdentifierProto { Loading Loading @@ -382,3 +385,17 @@ message ConfigurationContainerProto { optional .android.content.ConfigurationProto full_configuration = 2; optional .android.content.ConfigurationProto merged_override_configuration = 3; } /* represents WindowFrames */ message WindowFramesProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; optional .android.graphics.RectProto containing_frame = 1; optional .android.graphics.RectProto content_frame = 2; optional .android.graphics.RectProto decor_frame = 3; optional .android.graphics.RectProto display_frame = 4; optional .android.graphics.RectProto outset_frame = 5; optional .android.graphics.RectProto overscan_frame = 6; optional .android.graphics.RectProto parent_frame = 7; optional .android.graphics.RectProto visible_frame = 8; } services/core/java/com/android/server/policy/PhoneWindowManager.java +54 −61 Original line number Diff line number Diff line Loading @@ -288,6 +288,7 @@ import com.android.server.wm.ActivityTaskManagerInternal; import com.android.server.wm.ActivityTaskManagerInternal.SleepToken; import com.android.server.wm.AppTransition; import com.android.server.wm.DisplayFrames; import com.android.server.wm.WindowFrames; import com.android.server.wm.WindowManagerInternal; import com.android.server.wm.WindowManagerInternal.AppTransitionListener; import com.android.server.wm.utils.InsetUtils; Loading Loading @@ -665,15 +666,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { InputConsumer mInputConsumer = null; static final Rect mTmpParentFrame = new Rect(); static final Rect mTmpDisplayFrame = new Rect(); static final Rect mTmpOverscanFrame = new Rect(); static final Rect mTmpContentFrame = new Rect(); static final Rect mTmpVisibleFrame = new Rect(); static final Rect mTmpDecorFrame = new Rect(); static final Rect mTmpStableFrame = new Rect(); static final Rect mTmpNavigationFrame = new Rect(); static final Rect mTmpOutsetFrame = new Rect(); private final WindowFrames mWindowFrames = new WindowFrames(); private static final Rect mTmpDisplayCutoutSafeExceptMaybeBarsRect = new Rect(); private static final Rect mTmpRect = new Rect(); Loading Loading @@ -4643,18 +4636,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { mDockLayer = 0x10000000; mStatusBarLayer = -1; // start with the current dock rect, which will be (0,0,displayWidth,displayHeight) final Rect pf = mTmpParentFrame; final Rect df = mTmpDisplayFrame; final Rect of = mTmpOverscanFrame; final Rect vf = mTmpVisibleFrame; final Rect dcf = mTmpDecorFrame; vf.set(displayFrames.mDock); of.set(displayFrames.mDock); df.set(displayFrames.mDock); pf.set(displayFrames.mDock); dcf.setEmpty(); // Decor frame N/A for system bars. if (displayFrames.mDisplayId == DEFAULT_DISPLAY) { // For purposes of putting out fake window up to steal focus, we will // drive nav being hidden only by whether it is requested. Loading Loading @@ -4695,16 +4676,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { // be hidden (because of the screen aspect ratio), then take that into account. navVisible |= !canHideNavigationBar(); boolean updateSysUiVisibility = layoutNavigationBar(displayFrames, uiMode, dcf, navVisible, navTranslucent, navAllowedHidden, statusBarExpandedNotKeyguard); boolean updateSysUiVisibility = layoutNavigationBar(displayFrames, uiMode, navVisible, navTranslucent, navAllowedHidden, statusBarExpandedNotKeyguard); if (DEBUG_LAYOUT) Slog.i(TAG, "mDock rect:" + displayFrames.mDock); updateSysUiVisibility |= layoutStatusBar( displayFrames, pf, df, of, vf, dcf, sysui, isKeyguardShowing); updateSysUiVisibility |= layoutStatusBar(displayFrames, sysui, isKeyguardShowing); if (updateSysUiVisibility) { updateSystemUiVisibilityLw(); } } layoutScreenDecorWindows(displayFrames, pf, df, dcf); layoutScreenDecorWindows(displayFrames); if (displayFrames.mDisplayCutoutSafe.top > displayFrames.mUnrestricted.top) { // Make sure that the zone we're avoiding for the cutout is at least as tall as the Loading @@ -4715,11 +4695,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } private void layoutScreenDecorWindows(DisplayFrames displayFrames, Rect pf, Rect df, Rect dcf) { private void layoutScreenDecorWindows(DisplayFrames displayFrames) { if (mScreenDecorWindows.isEmpty()) { return; } mTmpRect.setEmpty(); mWindowFrames.setFrames(displayFrames.mDock /* parentFrame */, displayFrames.mDock /* displayFrame */, displayFrames.mDock /* overscanFrame */, displayFrames.mDock /* contentFrame */, displayFrames.mDock /* visibleFrame */, mTmpRect /* decorFrame */, displayFrames.mDock /* stableFrame */, displayFrames.mDock /* outsetFrame */); final int displayId = displayFrames.mDisplayId; final Rect dockFrame = displayFrames.mDock; final int displayHeight = displayFrames.mDisplayHeight; Loading @@ -4732,9 +4719,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { continue; } w.computeFrameLw(pf /* parentFrame */, df /* displayFrame */, df /* overlayFrame */, df /* contentFrame */, df /* visibleFrame */, dcf /* decorFrame */, df /* stableFrame */, df /* outsetFrame */, displayFrames.mDisplayCutout, w.computeFrameLw(mWindowFrames, displayFrames.mDisplayCutout, false /* parentFrameWasClippedByDisplayCutout */); final Rect frame = w.getFrameLw(); Loading Loading @@ -4780,25 +4765,25 @@ public class PhoneWindowManager implements WindowManagerPolicy { displayFrames.mRestrictedOverscan.set(dockFrame); } private boolean layoutStatusBar(DisplayFrames displayFrames, Rect pf, Rect df, Rect of, Rect vf, Rect dcf, int sysui, boolean isKeyguardShowing) { private boolean layoutStatusBar(DisplayFrames displayFrames, int sysui, boolean isKeyguardShowing) { // decide where the status bar goes ahead of time if (mStatusBar == null) { return false; } // apply any navigation bar insets of.set(displayFrames.mUnrestricted); df.set(displayFrames.mUnrestricted); pf.set(displayFrames.mUnrestricted); vf.set(displayFrames.mStable); mTmpRect.setEmpty(); mWindowFrames.setFrames(displayFrames.mUnrestricted /* parentFrame */, displayFrames.mUnrestricted /* displayFrame */, displayFrames.mStable /* overscanFrame */, displayFrames.mStable /* contentFrame */, displayFrames.mStable /* visibleFrame */, mTmpRect /* decorFrame */, displayFrames.mStable /* stableFrame */, displayFrames.mStable /* outsetFrame */); mStatusBarLayer = mStatusBar.getSurfaceLayer(); // Let the status bar determine its size. mStatusBar.computeFrameLw(pf /* parentFrame */, df /* displayFrame */, vf /* overlayFrame */, vf /* contentFrame */, vf /* visibleFrame */, dcf /* decorFrame */, vf /* stableFrame */, vf /* outsetFrame */, displayFrames.mDisplayCutout, false /* parentFrameWasClippedByDisplayCutout */); mStatusBar.computeFrameLw(mWindowFrames, displayFrames.mDisplayCutout, false /* parentFrameWasClippedByDisplayCutout */); // For layout, the status bar is always at the top with our fixed height. displayFrames.mStable.top = displayFrames.mUnrestricted.top Loading Loading @@ -4845,12 +4830,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { return mStatusBarController.checkHiddenLw(); } private boolean layoutNavigationBar(DisplayFrames displayFrames, int uiMode, Rect dcf, boolean navVisible, boolean navTranslucent, boolean navAllowedHidden, private boolean layoutNavigationBar(DisplayFrames displayFrames, int uiMode, boolean navVisible, boolean navTranslucent, boolean navAllowedHidden, boolean statusBarExpandedNotKeyguard) { if (mNavigationBar == null) { return false; } final Rect navigationFrame = mWindowFrames.mParentFrame; boolean transientNavBarShowing = mNavigationBarController.isTransientShowing(); // Force the navigation bar to its appropriate place and size. We need to do this directly, // instead of relying on it to bubble up from the nav bar, because this needs to change Loading @@ -4869,7 +4856,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // It's a system nav bar or a portrait screen; nav bar goes on bottom. final int top = cutoutSafeUnrestricted.bottom - getNavigationBarHeight(rotation, uiMode); mTmpNavigationFrame.set(0, top, displayWidth, displayFrames.mUnrestricted.bottom); navigationFrame.set(0, top, displayWidth, displayFrames.mUnrestricted.bottom); displayFrames.mStable.bottom = displayFrames.mStableFullscreen.bottom = top; if (transientNavBarShowing) { mNavigationBarController.setBarShowingLw(true); Loading @@ -4892,7 +4879,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Landscape screen; nav bar goes to the right. final int left = cutoutSafeUnrestricted.right - getNavigationBarWidth(rotation, uiMode); mTmpNavigationFrame.set(left, 0, displayFrames.mUnrestricted.right, displayHeight); navigationFrame.set(left, 0, displayFrames.mUnrestricted.right, displayHeight); displayFrames.mStable.right = displayFrames.mStableFullscreen.right = left; if (transientNavBarShowing) { mNavigationBarController.setBarShowingLw(true); Loading @@ -4915,7 +4902,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Seascape screen; nav bar goes to the left. final int right = cutoutSafeUnrestricted.left + getNavigationBarWidth(rotation, uiMode); mTmpNavigationFrame.set(displayFrames.mUnrestricted.left, 0, right, displayHeight); navigationFrame.set(displayFrames.mUnrestricted.left, 0, right, displayHeight); displayFrames.mStable.left = displayFrames.mStableFullscreen.left = right; if (transientNavBarShowing) { mNavigationBarController.setBarShowingLw(true); Loading Loading @@ -4943,13 +4930,19 @@ public class PhoneWindowManager implements WindowManagerPolicy { displayFrames.mContent.set(dockFrame); mStatusBarLayer = mNavigationBar.getSurfaceLayer(); // And compute the final frame. mNavigationBar.computeFrameLw(mTmpNavigationFrame, mTmpNavigationFrame, mTmpNavigationFrame, displayFrames.mDisplayCutoutSafe, mTmpNavigationFrame, dcf, mTmpNavigationFrame, displayFrames.mDisplayCutoutSafe, displayFrames.mDisplayCutout, false /* parentFrameWasClippedByDisplayCutout */); mTmpRect.setEmpty(); mWindowFrames.setFrames(navigationFrame /* parentFrame */, navigationFrame /* displayFrame */, navigationFrame /* overscanFrame */, displayFrames.mDisplayCutoutSafe /* contentFrame */, navigationFrame /* visibleFrame */, mTmpRect /* decorFrame */, navigationFrame /* stableFrame */, displayFrames.mDisplayCutoutSafe /* outsetFrame */); mNavigationBar.computeFrameLw(mWindowFrames, displayFrames.mDisplayCutout, false /* parentFrameWasClippedByDisplayCutout */); mNavigationBarController.setContentFrame(mNavigationBar.getContentFrameLw()); if (DEBUG_LAYOUT) Slog.i(TAG, "mNavigationBar frame: " + mTmpNavigationFrame); if (DEBUG_LAYOUT) Slog.i(TAG, "mNavigationBar frame: " + navigationFrame); return mNavigationBarController.checkHiddenLw(); } Loading Loading @@ -5077,15 +5070,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { final int requestedSysUiFl = PolicyControl.getSystemUiVisibility(null, attrs); final int sysUiFl = requestedSysUiFl | getImpliedSysUiFlagsForLayout(attrs); final Rect pf = mTmpParentFrame; final Rect df = mTmpDisplayFrame; final Rect of = mTmpOverscanFrame; final Rect cf = mTmpContentFrame; final Rect vf = mTmpVisibleFrame; final Rect dcf = mTmpDecorFrame; final Rect sf = mTmpStableFrame; Rect osf = null; final Rect pf = mWindowFrames.mParentFrame; final Rect df = mWindowFrames.mDisplayFrame; final Rect of = mWindowFrames.mOverscanFrame; final Rect cf = mWindowFrames.mContentFrame; final Rect vf = mWindowFrames.mVisibleFrame; final Rect dcf = mWindowFrames.mDecorFrame; final Rect sf = mWindowFrames.mStableFrame; dcf.setEmpty(); mWindowFrames.mOutsetFrame.setEmpty(); final boolean hasNavBar = (isDefaultDisplay && mHasNavigationBar && mNavigationBar != null && mNavigationBar.isVisibleLw()); Loading Loading @@ -5484,7 +5477,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // apply the outsets to floating dialogs, because they wouldn't make sense there. final boolean useOutsets = shouldUseOutsets(attrs, fl); if (isDefaultDisplay && useOutsets) { osf = mTmpOutsetFrame; final Rect osf = mWindowFrames.mOutsetFrame; osf.set(cf.left, cf.top, cf.right, cf.bottom); int outset = ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources()); if (outset > 0) { Loading Loading @@ -5512,9 +5505,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { + " cf=" + cf.toShortString() + " vf=" + vf.toShortString() + " dcf=" + dcf.toShortString() + " sf=" + sf.toShortString() + " osf=" + (osf == null ? "null" : osf.toShortString())); + " osf=" + mWindowFrames.mOutsetFrame.toShortString()); win.computeFrameLw(pf, df, of, cf, vf, dcf, sf, osf, displayFrames.mDisplayCutout, win.computeFrameLw(mWindowFrames, displayFrames.mDisplayCutout, parentFrameWasClippedByDisplayCutout); // Dock windows carve out the bottom of the screen, so normal windows // can't appear underneath them. Loading services/core/java/com/android/server/policy/WindowManagerPolicy.java +4 −24 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ import android.view.animation.Animation; import com.android.internal.policy.IKeyguardDismissCallback; import com.android.internal.policy.IShortcutService; import com.android.server.wm.DisplayFrames; import com.android.server.wm.WindowFrames; import com.android.server.wm.utils.WmDisplayCutout; import java.io.PrintWriter; Loading Loading @@ -197,34 +198,13 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { * getFrame() if so desired. Must be called with the window manager * lock held. * * @param parentFrame The frame of the parent container this window * is in, used for computing its basic position. * @param displayFrame The frame of the overall display in which this * window can appear, used for constraining the overall dimensions * of the window. * @param overlayFrame The frame within the display that is inside * of the overlay region. * @param contentFrame The frame within the display in which we would * like active content to appear. This will cause windows behind to * be resized to match the given content frame. * @param visibleFrame The frame within the display that the window * is actually visible, used for computing its visible insets to be * given to windows behind. * This can be used as a hint for scrolling (avoiding resizing) * the window to make certain that parts of its content * are visible. * @param decorFrame The decor frame specified by policy specific to this window, * to use for proper cropping during animation. * @param stableFrame The frame around which stable system decoration is positioned. * @param outsetFrame The frame that includes areas that aren't part of the surface but we * want to treat them as such. * @param windowFrames Container for all the window frames that affect how the window is * laid out. * @param displayCutout the display cutout * @param parentFrameWasClippedByDisplayCutout true if the parent frame would have been * different if there was no display cutout. */ public void computeFrameLw(Rect parentFrame, Rect displayFrame, Rect overlayFrame, Rect contentFrame, Rect visibleFrame, Rect decorFrame, Rect stableFrame, @Nullable Rect outsetFrame, WmDisplayCutout displayCutout, public void computeFrameLw(WindowFrames windowFrames, WmDisplayCutout displayCutout, boolean parentFrameWasClippedByDisplayCutout); /** Loading services/core/java/com/android/server/wm/AppWindowToken.java +1 −1 Original line number Diff line number Diff line Loading @@ -1816,7 +1816,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // animation target (which will be different than the task bounds) frame.set(getTask().getParent().getBounds()); } else { frame.set(win.mContainingFrame); frame.set(win.getContainingFrame()); } surfaceInsets = win.getAttrs().surfaceInsets; // XXX(b/72757033): These are insets relative to the window frame, but we're really Loading services/core/java/com/android/server/wm/DisplayContent.java +4 −4 Original line number Diff line number Diff line Loading @@ -580,8 +580,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } if (DEBUG_LAYOUT) Slog.v(TAG, " LAYOUT: mFrame=" + w.mFrame + " mContainingFrame=" + w.mContainingFrame + " mDisplayFrame=" + w.mDisplayFrame); + " mContainingFrame=" + w.getContainingFrame() + " mDisplayFrame=" + w.getDisplayFrameLw()); } } }; Loading @@ -608,8 +608,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mService.mPolicy.layoutWindowLw(w, w.getParentWindow(), mDisplayFrames); w.mLayoutSeq = mLayoutSeq; if (DEBUG_LAYOUT) Slog.v(TAG, " LAYOUT: mFrame=" + w.mFrame + " mContainingFrame=" + w.mContainingFrame + " mDisplayFrame=" + w.mDisplayFrame); + " mContainingFrame=" + w.getContainingFrame() + " mDisplayFrame=" + w.getDisplayFrameLw()); } } else if (w.mAttrs.type == TYPE_DREAM) { // Don't layout windows behind a dream, so that if it does stuff like hide the Loading Loading
core/proto/android/server/windowmanagerservice.proto +25 −8 Original line number Diff line number Diff line Loading @@ -289,9 +289,10 @@ message WindowStateProto { optional .android.view.WindowLayoutParamsProto attributes = 5; optional .android.graphics.RectProto given_content_insets = 6; optional .android.graphics.RectProto frame = 7; optional .android.graphics.RectProto containing_frame = 8; optional .android.graphics.RectProto parent_frame = 9; optional .android.graphics.RectProto content_frame = 10; reserved 8 to 10; // optional .android.graphics.RectProto containing_frame = 8; // optional .android.graphics.RectProto parent_frame = 9; // optional .android.graphics.RectProto content_frame = 10; optional .android.graphics.RectProto content_insets = 11; optional .android.graphics.RectProto surface_insets = 12; optional WindowStateAnimatorProto animator = 13; Loading @@ -304,11 +305,12 @@ message WindowStateProto { optional int32 system_ui_visibility = 21; optional bool has_surface = 22; optional bool is_ready_for_display = 23; optional .android.graphics.RectProto display_frame = 24; optional .android.graphics.RectProto overscan_frame = 25; optional .android.graphics.RectProto visible_frame = 26; optional .android.graphics.RectProto decor_frame = 27; optional .android.graphics.RectProto outset_frame = 28; reserved 24 to 28; // optional .android.graphics.RectProto display_frame = 24; // optional .android.graphics.RectProto overscan_frame = 25; // optional .android.graphics.RectProto visible_frame = 26; // optional .android.graphics.RectProto decor_frame = 27; // optional .android.graphics.RectProto outset_frame = 28; optional .android.graphics.RectProto overscan_insets = 29; optional .android.graphics.RectProto visible_insets = 30; optional .android.graphics.RectProto stable_insets = 31; Loading @@ -321,6 +323,7 @@ message WindowStateProto { optional bool is_visible = 38; optional bool pending_forced_seamless_rotation = 39; optional int64 finished_forced_seamless_rotation_frame = 40; optional WindowFramesProto window_frames = 41; } message IdentifierProto { Loading Loading @@ -382,3 +385,17 @@ message ConfigurationContainerProto { optional .android.content.ConfigurationProto full_configuration = 2; optional .android.content.ConfigurationProto merged_override_configuration = 3; } /* represents WindowFrames */ message WindowFramesProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; optional .android.graphics.RectProto containing_frame = 1; optional .android.graphics.RectProto content_frame = 2; optional .android.graphics.RectProto decor_frame = 3; optional .android.graphics.RectProto display_frame = 4; optional .android.graphics.RectProto outset_frame = 5; optional .android.graphics.RectProto overscan_frame = 6; optional .android.graphics.RectProto parent_frame = 7; optional .android.graphics.RectProto visible_frame = 8; }
services/core/java/com/android/server/policy/PhoneWindowManager.java +54 −61 Original line number Diff line number Diff line Loading @@ -288,6 +288,7 @@ import com.android.server.wm.ActivityTaskManagerInternal; import com.android.server.wm.ActivityTaskManagerInternal.SleepToken; import com.android.server.wm.AppTransition; import com.android.server.wm.DisplayFrames; import com.android.server.wm.WindowFrames; import com.android.server.wm.WindowManagerInternal; import com.android.server.wm.WindowManagerInternal.AppTransitionListener; import com.android.server.wm.utils.InsetUtils; Loading Loading @@ -665,15 +666,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { InputConsumer mInputConsumer = null; static final Rect mTmpParentFrame = new Rect(); static final Rect mTmpDisplayFrame = new Rect(); static final Rect mTmpOverscanFrame = new Rect(); static final Rect mTmpContentFrame = new Rect(); static final Rect mTmpVisibleFrame = new Rect(); static final Rect mTmpDecorFrame = new Rect(); static final Rect mTmpStableFrame = new Rect(); static final Rect mTmpNavigationFrame = new Rect(); static final Rect mTmpOutsetFrame = new Rect(); private final WindowFrames mWindowFrames = new WindowFrames(); private static final Rect mTmpDisplayCutoutSafeExceptMaybeBarsRect = new Rect(); private static final Rect mTmpRect = new Rect(); Loading Loading @@ -4643,18 +4636,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { mDockLayer = 0x10000000; mStatusBarLayer = -1; // start with the current dock rect, which will be (0,0,displayWidth,displayHeight) final Rect pf = mTmpParentFrame; final Rect df = mTmpDisplayFrame; final Rect of = mTmpOverscanFrame; final Rect vf = mTmpVisibleFrame; final Rect dcf = mTmpDecorFrame; vf.set(displayFrames.mDock); of.set(displayFrames.mDock); df.set(displayFrames.mDock); pf.set(displayFrames.mDock); dcf.setEmpty(); // Decor frame N/A for system bars. if (displayFrames.mDisplayId == DEFAULT_DISPLAY) { // For purposes of putting out fake window up to steal focus, we will // drive nav being hidden only by whether it is requested. Loading Loading @@ -4695,16 +4676,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { // be hidden (because of the screen aspect ratio), then take that into account. navVisible |= !canHideNavigationBar(); boolean updateSysUiVisibility = layoutNavigationBar(displayFrames, uiMode, dcf, navVisible, navTranslucent, navAllowedHidden, statusBarExpandedNotKeyguard); boolean updateSysUiVisibility = layoutNavigationBar(displayFrames, uiMode, navVisible, navTranslucent, navAllowedHidden, statusBarExpandedNotKeyguard); if (DEBUG_LAYOUT) Slog.i(TAG, "mDock rect:" + displayFrames.mDock); updateSysUiVisibility |= layoutStatusBar( displayFrames, pf, df, of, vf, dcf, sysui, isKeyguardShowing); updateSysUiVisibility |= layoutStatusBar(displayFrames, sysui, isKeyguardShowing); if (updateSysUiVisibility) { updateSystemUiVisibilityLw(); } } layoutScreenDecorWindows(displayFrames, pf, df, dcf); layoutScreenDecorWindows(displayFrames); if (displayFrames.mDisplayCutoutSafe.top > displayFrames.mUnrestricted.top) { // Make sure that the zone we're avoiding for the cutout is at least as tall as the Loading @@ -4715,11 +4695,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } private void layoutScreenDecorWindows(DisplayFrames displayFrames, Rect pf, Rect df, Rect dcf) { private void layoutScreenDecorWindows(DisplayFrames displayFrames) { if (mScreenDecorWindows.isEmpty()) { return; } mTmpRect.setEmpty(); mWindowFrames.setFrames(displayFrames.mDock /* parentFrame */, displayFrames.mDock /* displayFrame */, displayFrames.mDock /* overscanFrame */, displayFrames.mDock /* contentFrame */, displayFrames.mDock /* visibleFrame */, mTmpRect /* decorFrame */, displayFrames.mDock /* stableFrame */, displayFrames.mDock /* outsetFrame */); final int displayId = displayFrames.mDisplayId; final Rect dockFrame = displayFrames.mDock; final int displayHeight = displayFrames.mDisplayHeight; Loading @@ -4732,9 +4719,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { continue; } w.computeFrameLw(pf /* parentFrame */, df /* displayFrame */, df /* overlayFrame */, df /* contentFrame */, df /* visibleFrame */, dcf /* decorFrame */, df /* stableFrame */, df /* outsetFrame */, displayFrames.mDisplayCutout, w.computeFrameLw(mWindowFrames, displayFrames.mDisplayCutout, false /* parentFrameWasClippedByDisplayCutout */); final Rect frame = w.getFrameLw(); Loading Loading @@ -4780,25 +4765,25 @@ public class PhoneWindowManager implements WindowManagerPolicy { displayFrames.mRestrictedOverscan.set(dockFrame); } private boolean layoutStatusBar(DisplayFrames displayFrames, Rect pf, Rect df, Rect of, Rect vf, Rect dcf, int sysui, boolean isKeyguardShowing) { private boolean layoutStatusBar(DisplayFrames displayFrames, int sysui, boolean isKeyguardShowing) { // decide where the status bar goes ahead of time if (mStatusBar == null) { return false; } // apply any navigation bar insets of.set(displayFrames.mUnrestricted); df.set(displayFrames.mUnrestricted); pf.set(displayFrames.mUnrestricted); vf.set(displayFrames.mStable); mTmpRect.setEmpty(); mWindowFrames.setFrames(displayFrames.mUnrestricted /* parentFrame */, displayFrames.mUnrestricted /* displayFrame */, displayFrames.mStable /* overscanFrame */, displayFrames.mStable /* contentFrame */, displayFrames.mStable /* visibleFrame */, mTmpRect /* decorFrame */, displayFrames.mStable /* stableFrame */, displayFrames.mStable /* outsetFrame */); mStatusBarLayer = mStatusBar.getSurfaceLayer(); // Let the status bar determine its size. mStatusBar.computeFrameLw(pf /* parentFrame */, df /* displayFrame */, vf /* overlayFrame */, vf /* contentFrame */, vf /* visibleFrame */, dcf /* decorFrame */, vf /* stableFrame */, vf /* outsetFrame */, displayFrames.mDisplayCutout, false /* parentFrameWasClippedByDisplayCutout */); mStatusBar.computeFrameLw(mWindowFrames, displayFrames.mDisplayCutout, false /* parentFrameWasClippedByDisplayCutout */); // For layout, the status bar is always at the top with our fixed height. displayFrames.mStable.top = displayFrames.mUnrestricted.top Loading Loading @@ -4845,12 +4830,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { return mStatusBarController.checkHiddenLw(); } private boolean layoutNavigationBar(DisplayFrames displayFrames, int uiMode, Rect dcf, boolean navVisible, boolean navTranslucent, boolean navAllowedHidden, private boolean layoutNavigationBar(DisplayFrames displayFrames, int uiMode, boolean navVisible, boolean navTranslucent, boolean navAllowedHidden, boolean statusBarExpandedNotKeyguard) { if (mNavigationBar == null) { return false; } final Rect navigationFrame = mWindowFrames.mParentFrame; boolean transientNavBarShowing = mNavigationBarController.isTransientShowing(); // Force the navigation bar to its appropriate place and size. We need to do this directly, // instead of relying on it to bubble up from the nav bar, because this needs to change Loading @@ -4869,7 +4856,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // It's a system nav bar or a portrait screen; nav bar goes on bottom. final int top = cutoutSafeUnrestricted.bottom - getNavigationBarHeight(rotation, uiMode); mTmpNavigationFrame.set(0, top, displayWidth, displayFrames.mUnrestricted.bottom); navigationFrame.set(0, top, displayWidth, displayFrames.mUnrestricted.bottom); displayFrames.mStable.bottom = displayFrames.mStableFullscreen.bottom = top; if (transientNavBarShowing) { mNavigationBarController.setBarShowingLw(true); Loading @@ -4892,7 +4879,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Landscape screen; nav bar goes to the right. final int left = cutoutSafeUnrestricted.right - getNavigationBarWidth(rotation, uiMode); mTmpNavigationFrame.set(left, 0, displayFrames.mUnrestricted.right, displayHeight); navigationFrame.set(left, 0, displayFrames.mUnrestricted.right, displayHeight); displayFrames.mStable.right = displayFrames.mStableFullscreen.right = left; if (transientNavBarShowing) { mNavigationBarController.setBarShowingLw(true); Loading @@ -4915,7 +4902,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Seascape screen; nav bar goes to the left. final int right = cutoutSafeUnrestricted.left + getNavigationBarWidth(rotation, uiMode); mTmpNavigationFrame.set(displayFrames.mUnrestricted.left, 0, right, displayHeight); navigationFrame.set(displayFrames.mUnrestricted.left, 0, right, displayHeight); displayFrames.mStable.left = displayFrames.mStableFullscreen.left = right; if (transientNavBarShowing) { mNavigationBarController.setBarShowingLw(true); Loading Loading @@ -4943,13 +4930,19 @@ public class PhoneWindowManager implements WindowManagerPolicy { displayFrames.mContent.set(dockFrame); mStatusBarLayer = mNavigationBar.getSurfaceLayer(); // And compute the final frame. mNavigationBar.computeFrameLw(mTmpNavigationFrame, mTmpNavigationFrame, mTmpNavigationFrame, displayFrames.mDisplayCutoutSafe, mTmpNavigationFrame, dcf, mTmpNavigationFrame, displayFrames.mDisplayCutoutSafe, displayFrames.mDisplayCutout, false /* parentFrameWasClippedByDisplayCutout */); mTmpRect.setEmpty(); mWindowFrames.setFrames(navigationFrame /* parentFrame */, navigationFrame /* displayFrame */, navigationFrame /* overscanFrame */, displayFrames.mDisplayCutoutSafe /* contentFrame */, navigationFrame /* visibleFrame */, mTmpRect /* decorFrame */, navigationFrame /* stableFrame */, displayFrames.mDisplayCutoutSafe /* outsetFrame */); mNavigationBar.computeFrameLw(mWindowFrames, displayFrames.mDisplayCutout, false /* parentFrameWasClippedByDisplayCutout */); mNavigationBarController.setContentFrame(mNavigationBar.getContentFrameLw()); if (DEBUG_LAYOUT) Slog.i(TAG, "mNavigationBar frame: " + mTmpNavigationFrame); if (DEBUG_LAYOUT) Slog.i(TAG, "mNavigationBar frame: " + navigationFrame); return mNavigationBarController.checkHiddenLw(); } Loading Loading @@ -5077,15 +5070,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { final int requestedSysUiFl = PolicyControl.getSystemUiVisibility(null, attrs); final int sysUiFl = requestedSysUiFl | getImpliedSysUiFlagsForLayout(attrs); final Rect pf = mTmpParentFrame; final Rect df = mTmpDisplayFrame; final Rect of = mTmpOverscanFrame; final Rect cf = mTmpContentFrame; final Rect vf = mTmpVisibleFrame; final Rect dcf = mTmpDecorFrame; final Rect sf = mTmpStableFrame; Rect osf = null; final Rect pf = mWindowFrames.mParentFrame; final Rect df = mWindowFrames.mDisplayFrame; final Rect of = mWindowFrames.mOverscanFrame; final Rect cf = mWindowFrames.mContentFrame; final Rect vf = mWindowFrames.mVisibleFrame; final Rect dcf = mWindowFrames.mDecorFrame; final Rect sf = mWindowFrames.mStableFrame; dcf.setEmpty(); mWindowFrames.mOutsetFrame.setEmpty(); final boolean hasNavBar = (isDefaultDisplay && mHasNavigationBar && mNavigationBar != null && mNavigationBar.isVisibleLw()); Loading Loading @@ -5484,7 +5477,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // apply the outsets to floating dialogs, because they wouldn't make sense there. final boolean useOutsets = shouldUseOutsets(attrs, fl); if (isDefaultDisplay && useOutsets) { osf = mTmpOutsetFrame; final Rect osf = mWindowFrames.mOutsetFrame; osf.set(cf.left, cf.top, cf.right, cf.bottom); int outset = ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources()); if (outset > 0) { Loading Loading @@ -5512,9 +5505,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { + " cf=" + cf.toShortString() + " vf=" + vf.toShortString() + " dcf=" + dcf.toShortString() + " sf=" + sf.toShortString() + " osf=" + (osf == null ? "null" : osf.toShortString())); + " osf=" + mWindowFrames.mOutsetFrame.toShortString()); win.computeFrameLw(pf, df, of, cf, vf, dcf, sf, osf, displayFrames.mDisplayCutout, win.computeFrameLw(mWindowFrames, displayFrames.mDisplayCutout, parentFrameWasClippedByDisplayCutout); // Dock windows carve out the bottom of the screen, so normal windows // can't appear underneath them. Loading
services/core/java/com/android/server/policy/WindowManagerPolicy.java +4 −24 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ import android.view.animation.Animation; import com.android.internal.policy.IKeyguardDismissCallback; import com.android.internal.policy.IShortcutService; import com.android.server.wm.DisplayFrames; import com.android.server.wm.WindowFrames; import com.android.server.wm.utils.WmDisplayCutout; import java.io.PrintWriter; Loading Loading @@ -197,34 +198,13 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { * getFrame() if so desired. Must be called with the window manager * lock held. * * @param parentFrame The frame of the parent container this window * is in, used for computing its basic position. * @param displayFrame The frame of the overall display in which this * window can appear, used for constraining the overall dimensions * of the window. * @param overlayFrame The frame within the display that is inside * of the overlay region. * @param contentFrame The frame within the display in which we would * like active content to appear. This will cause windows behind to * be resized to match the given content frame. * @param visibleFrame The frame within the display that the window * is actually visible, used for computing its visible insets to be * given to windows behind. * This can be used as a hint for scrolling (avoiding resizing) * the window to make certain that parts of its content * are visible. * @param decorFrame The decor frame specified by policy specific to this window, * to use for proper cropping during animation. * @param stableFrame The frame around which stable system decoration is positioned. * @param outsetFrame The frame that includes areas that aren't part of the surface but we * want to treat them as such. * @param windowFrames Container for all the window frames that affect how the window is * laid out. * @param displayCutout the display cutout * @param parentFrameWasClippedByDisplayCutout true if the parent frame would have been * different if there was no display cutout. */ public void computeFrameLw(Rect parentFrame, Rect displayFrame, Rect overlayFrame, Rect contentFrame, Rect visibleFrame, Rect decorFrame, Rect stableFrame, @Nullable Rect outsetFrame, WmDisplayCutout displayCutout, public void computeFrameLw(WindowFrames windowFrames, WmDisplayCutout displayCutout, boolean parentFrameWasClippedByDisplayCutout); /** Loading
services/core/java/com/android/server/wm/AppWindowToken.java +1 −1 Original line number Diff line number Diff line Loading @@ -1816,7 +1816,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // animation target (which will be different than the task bounds) frame.set(getTask().getParent().getBounds()); } else { frame.set(win.mContainingFrame); frame.set(win.getContainingFrame()); } surfaceInsets = win.getAttrs().surfaceInsets; // XXX(b/72757033): These are insets relative to the window frame, but we're really Loading
services/core/java/com/android/server/wm/DisplayContent.java +4 −4 Original line number Diff line number Diff line Loading @@ -580,8 +580,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } if (DEBUG_LAYOUT) Slog.v(TAG, " LAYOUT: mFrame=" + w.mFrame + " mContainingFrame=" + w.mContainingFrame + " mDisplayFrame=" + w.mDisplayFrame); + " mContainingFrame=" + w.getContainingFrame() + " mDisplayFrame=" + w.getDisplayFrameLw()); } } }; Loading @@ -608,8 +608,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mService.mPolicy.layoutWindowLw(w, w.getParentWindow(), mDisplayFrames); w.mLayoutSeq = mLayoutSeq; if (DEBUG_LAYOUT) Slog.v(TAG, " LAYOUT: mFrame=" + w.mFrame + " mContainingFrame=" + w.mContainingFrame + " mDisplayFrame=" + w.mDisplayFrame); + " mContainingFrame=" + w.getContainingFrame() + " mDisplayFrame=" + w.getDisplayFrameLw()); } } else if (w.mAttrs.type == TYPE_DREAM) { // Don't layout windows behind a dream, so that if it does stuff like hide the Loading