From 6cb85a4e172f428627a86c893b6c3907f28c928b Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Sun, 19 Apr 2020 19:50:07 -0700 Subject: [PATCH] SysUI: Don't try to put non-resizeable task in split-screen WM would just ignore the request anyways. Also, move secondary split task forward when entering split so random non-resizeable task doesn't end up on-top. Test: Repro. steps in bug. Fixes: 154362321 Change-Id: I552f4ebbb132eb1944e42e53563f75a109b25815 --- .../android/systemui/stackdivider/WindowManagerProxy.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/WindowManagerProxy.java b/packages/SystemUI/src/com/android/systemui/stackdivider/WindowManagerProxy.java index 85dcbb6316d04..5aa7946bcb7f4 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/WindowManagerProxy.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/WindowManagerProxy.java @@ -180,12 +180,17 @@ public class WindowManagerProxy { if (isHomeOrRecentTask(rootTask)) { tiles.mHomeAndRecentsSurfaces.add(rootTask.token.getLeash()); } + // Only move resizeable task to split secondary. WM will just ignore this anyways... + if (!rootTask.isResizable()) continue; + // Only move fullscreen tasks to split secondary. if (rootTask.configuration.windowConfiguration.getWindowingMode() != WINDOWING_MODE_FULLSCREEN) { continue; } wct.reparent(rootTask.token, tiles.mSecondary.token, true /* onTop */); } + // Move the secondary split-forward. + wct.reorder(tiles.mSecondary.token, true /* onTop */); boolean isHomeResizable = applyHomeTasksMinimized(layout, null /* parent */, wct); WindowOrganizer.applyTransaction(wct); return isHomeResizable;