From 9840bdaa13cd3cc4c2462dac88409dfb1bfdfb0f Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Mon, 20 Jun 2022 16:36:03 +0800 Subject: [PATCH] [Shell Transition]Fix live tile be hidden by wallpaper leash. A generic fix to specific layers for live tiles/wallpaper. Because there cannot sure the absolutely z-order of recents surface, we can always set wallpaper layer to bottom, and set the z-order of live tiles to either MAX or MIN + 1, so live tile can always above wallpaper, also the live tile can be show above/below recents surface based on mDrawsBelowRecents. Test: enable shell transition, open app then entering recents, verify the live tile stay visible when entering recents. And the shared indicators visible when state transition complete. Test: also verify above test for legacy transition. Bug: 236410500 Change-Id: I0f86d7617af1d96c28783320248af64f576bd570 --- .../android/quickstep/util/TaskViewSimulator.java | 2 +- .../com/android/quickstep/util/TransformParams.java | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index 1acdec1d12..8c48443ef3 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -391,7 +391,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { .withCornerRadius(getCurrentCornerRadius()); if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - builder.withLayer(mDrawsBelowRecents ? Integer.MIN_VALUE : 0); + builder.withLayer(mDrawsBelowRecents ? Integer.MIN_VALUE + 1 : Integer.MAX_VALUE); } } diff --git a/quickstep/src/com/android/quickstep/util/TransformParams.java b/quickstep/src/com/android/quickstep/util/TransformParams.java index 75d6001afd..a7f25d40ef 100644 --- a/quickstep/src/com/android/quickstep/util/TransformParams.java +++ b/quickstep/src/com/android/quickstep/util/TransformParams.java @@ -139,10 +139,12 @@ public class TransformParams { public SurfaceParams[] createSurfaceParams(BuilderProxy proxy) { RemoteAnimationTargets targets = mTargetSet; - SurfaceParams[] surfaceParams = new SurfaceParams[targets.unfilteredApps.length]; + final int appLength = targets.unfilteredApps.length; + final int wallpaperLength = targets.wallpapers != null ? targets.wallpapers.length : 0; + SurfaceParams[] surfaceParams = new SurfaceParams[appLength + wallpaperLength]; mRecentsSurface = getRecentsSurface(targets); - for (int i = 0; i < targets.unfilteredApps.length; i++) { + for (int i = 0; i < appLength; i++) { RemoteAnimationTargetCompat app = targets.unfilteredApps[i]; SurfaceParams.Builder builder = new SurfaceParams.Builder(app.leash); @@ -166,6 +168,12 @@ public class TransformParams { } surfaceParams[i] = builder.build(); } + // always put wallpaper layer to bottom. + for (int i = 0; i < wallpaperLength; i++) { + RemoteAnimationTargetCompat wallpaper = targets.wallpapers[i]; + surfaceParams[appLength + i] = new SurfaceParams.Builder(wallpaper.leash) + .withLayer(Integer.MIN_VALUE).build(); + } return surfaceParams; }