From 918d95ca8998664dedb2413fb41c666c963e867d Mon Sep 17 00:00:00 2001 From: Tiger Huang Date: Tue, 29 Mar 2022 18:22:03 +0800 Subject: [PATCH] Bring fullscreen backdrop frame back We might need to bring the legacy split-screen back. This CL restores the logic of the fullscreen backdrop frame. Bug: 161810301 Test: Drag the split-screen divider after setting ActivityTaskManager#setSplitScreenResizing to true Change-Id: Ifdc8b7695595e81e381b3311cf0d266f9af4be23 --- core/java/android/view/ViewRootImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 0df8a0bded488..3c00c412da6f0 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -8094,14 +8094,17 @@ public final class ViewRootImpl implements ViewParent, private void setFrame(Rect frame) { mWinFrame.set(frame); + final WindowConfiguration winConfig = getConfiguration().windowConfiguration; + mPendingBackDropFrame.set(mPendingDragResizing && !winConfig.useWindowFrameForBackdrop() + ? winConfig.getMaxBounds() + : frame); // Surface position is now inherited from parent, and BackdropFrameRenderer uses backdrop // frame to position content. Thus, we just keep the size of backdrop frame, and remove the // offset to avoid double offset from display origin. - mPendingBackDropFrame.set(frame); mPendingBackDropFrame.offsetTo(0, 0); mInsetsController.onFrameChanged(mOverrideInsetsFrame != null ? - mOverrideInsetsFrame : frame); + mOverrideInsetsFrame : frame); } /**