diff options
| author | 2022-04-28 22:53:00 +0800 | |
|---|---|---|
| committer | 2022-04-28 22:53:00 +0800 | |
| commit | 4b66a8a8ad0897e48475d13e865285f210701bb7 (patch) | |
| tree | 80d2de1d05c3bc7ddd24602ff04673ce1608a46d | |
| parent | e06bd5862f9ad4c74b35a0e2e7dfbe4727301c1c (diff) | |
Initialize transition layer of wallpaper at bottom
Otherwise the wallpaper may be shown above the app during
transition. The case may happen when performing seamless
display change transition with visible wallpaper.
Bug: 229701688
Test: atest com.android.server.wm.flicker.launch.OpenAppColdTest
Change-Id: Ib7b448caec6d1c1f1383b7e4229394437afd1b58
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java index e4c94264be2c..273237846156 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java @@ -309,13 +309,14 @@ public class Transitions implements RemoteCallable<Transitions> { if (info.getRootLeash().isValid()) { t.show(info.getRootLeash()); } + final int numChanges = info.getChanges().size(); // Put animating stuff above this line and put static stuff below it. - int zSplitLine = info.getChanges().size(); + final int zSplitLine = numChanges + 1; // changes should be ordered top-to-bottom in z - for (int i = info.getChanges().size() - 1; i >= 0; --i) { + for (int i = numChanges - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); final SurfaceControl leash = change.getLeash(); - final int mode = info.getChanges().get(i).getMode(); + final int mode = change.getMode(); // Don't reparent anything that isn't independent within its parents if (!TransitionInfo.isIndependent(change, info)) { @@ -329,26 +330,31 @@ public class Transitions implements RemoteCallable<Transitions> { t.setPosition(leash, change.getStartAbsBounds().left - info.getRootOffset().x, change.getStartAbsBounds().top - info.getRootOffset().y); } + final int layer; // Put all the OPEN/SHOW on top - if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) { + if ((change.getFlags() & FLAG_IS_WALLPAPER) != 0) { + // Wallpaper is always at the bottom. + layer = 0; + } else if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) { if (isOpening) { // put on top - t.setLayer(leash, zSplitLine + info.getChanges().size() - i); + layer = zSplitLine + numChanges - i; } else { // put on bottom - t.setLayer(leash, zSplitLine - i); + layer = zSplitLine - i; } } else if (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK) { if (isOpening) { // put on bottom and leave visible - t.setLayer(leash, zSplitLine - i); + layer = zSplitLine - i; } else { // put on top - t.setLayer(leash, zSplitLine + info.getChanges().size() - i); + layer = zSplitLine + numChanges - i; } } else { // CHANGE or other - t.setLayer(leash, zSplitLine + info.getChanges().size() - i); + layer = zSplitLine + numChanges - i; } + t.setLayer(leash, layer); } } |