summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author wilsonshih <wilsonshih@google.com> 2022-08-30 12:33:18 +0800
committer wilsonshih <wilsonshih@google.com> 2022-09-07 11:39:14 +0800
commite252ffde09a55e8fc0680ea8a9d2281f781b8b1d (patch)
tree5fcfce9e14b797276f7439a09d663bce6ff47eb4
parentdd2f290170b9be9449b08254deca3c6ebe628db8 (diff)
Do not create extend surface for transfer starting window change.
There could transfer starting window when launch a trampoline activity, and the trampoline activity could be removed before it add a window. So a possible sequence would be: 1. Activity A start a trampoline activity B, and transfer the starting window to B. 2. B finish itself before add window, so the starting window transfer back to A. And there will create a close transition when finish B, but actually this activity never draw anything on it. So if there attemp to create an edge extend surface for it, that thread would be stuck in Surface.unlockAndPost because nothing will draw. Note: Not sure if above reasoning is correct, but in any case, it should be reasonable to not need to prepare edge extend surface for the surface which could never been drawn. Bug: 244260394 Test: atest ActivityLifecycleTests --rerun-until-failure 10 Change-Id: I31a36398bec86cb439396ad93108487cd6479139
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
index cff60f5e5b6c..4c927b6e84b8 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
@@ -554,6 +554,12 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
private void edgeExtendWindow(TransitionInfo.Change change,
Animation a, SurfaceControl.Transaction startTransaction,
SurfaceControl.Transaction finishTransaction) {
+ // Do not create edge extension surface for transfer starting window change.
+ // The app surface could be empty thus nothing can draw on the hardware renderer, which will
+ // block this thread when calling Surface#unlockCanvasAndPost.
+ if ((change.getFlags() & FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT) != 0) {
+ return;
+ }
final Transformation transformationAtStart = new Transformation();
a.getTransformationAt(0, transformationAtStart);
final Transformation transformationAtEnd = new Transformation();