From ead969a489f92b41ed0abf71ff0b8d84b181dbf9 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Wed, 28 Apr 2021 01:18:40 +0800 Subject: [PATCH] Make sure tasks below home task is invisible while in split While in split mode, home task will be reparented to the secondary split and leaving tasks not supporting split below. Because TaskDisplayArea always adjusts home surface layer to the bottom, this makes sure those tasks below home is invisible and won't occlude home task unexpectedly. Fix: 185872271 Fix: 159767867 Test: dock translucent task to split primary while having task not supporting split in recent, recent app won't be occluded. Change-Id: Ie110ea302a0ec646b6c39f68606b31cd4c26697e --- .../core/java/com/android/server/wm/Task.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 9fad7daa7212e..e589856e115a1 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -4298,11 +4298,21 @@ class Task extends WindowContainer { // the screen are opaque. return TASK_VISIBILITY_INVISIBLE; } - if (isAssistantType && gotRootSplitScreenTask) { - // Assistant stack can't be visible behind split-screen. In addition to this not - // making sense, it also works around an issue here we boost the z-order of the - // assistant window surfaces in window manager whenever it is visible. - return TASK_VISIBILITY_INVISIBLE; + if (gotRootSplitScreenTask) { + if (isAssistantType) { + // Assistant stack can't be visible behind split-screen. In addition to this not + // making sense, it also works around an issue here we boost the z-order of the + // assistant window surfaces in window manager whenever it is visible. + return TASK_VISIBILITY_INVISIBLE; + } + if (other.isHomeOrRecentsRootTask()) { + // While in split mode, home task will be reparented to the secondary split and + // leaving tasks not supporting split below. Due to + // TaskDisplayArea#assignRootTaskOrdering always adjusts home surface layer to + // the bottom, this makes sure those tasks below home is invisible and won't + // occlude home task unexpectedly. + return TASK_VISIBILITY_INVISIBLE; + } } if (other.mAdjacentTask != null) { if (adjacentTasks.contains(other.mAdjacentTask)) {