From c5d4ac74c7b2890d1fcaae8b4654682601b8f751 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Wed, 9 Jun 2021 10:22:40 +0800 Subject: [PATCH] Using rotate split layout while split active While startEnterSplit, if mRotateSplitLayout is exist then it means we got rotation changed but still not update mSplitLayout until onDisplayConfigurationChanged callback. We should using mRotateSplitLayout on this case to ensure the DisplayLayout is right. Fix: 190028155 Test: close auto-rotation, open landscape app then enable split screen Change-Id: I68cf0ca3d10ed500100af843e7ed5afdc090b8fc --- .../legacysplitscreen/LegacySplitScreenController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java index ee2202a48bf2e..261ff2f8de838 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java @@ -550,12 +550,14 @@ public class LegacySplitScreenController implements DisplayController.OnDisplays update(mDisplayController.getDisplayContext( mContext.getDisplayId()).getResources().getConfiguration()); // Set resizable directly here because applyEnterSplit already resizes home stack. - mHomeStackResizable = mWindowManagerProxy.applyEnterSplit(mSplits, mSplitLayout); + mHomeStackResizable = mWindowManagerProxy.applyEnterSplit(mSplits, + mRotateSplitLayout != null ? mRotateSplitLayout : mSplitLayout); } public void prepareEnterSplitTransition(WindowContainerTransaction outWct) { // Set resizable directly here because buildEnterSplit already resizes home stack. - mHomeStackResizable = mWindowManagerProxy.buildEnterSplit(outWct, mSplits, mSplitLayout); + mHomeStackResizable = mWindowManagerProxy.buildEnterSplit(outWct, mSplits, + mRotateSplitLayout != null ? mRotateSplitLayout : mSplitLayout); } public void finishEnterSplitTransition(boolean minimized) {