From 9074e9c3ee51a5c52372319c4d673835869f83e9 Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Wed, 2 Mar 2022 16:33:31 -0800 Subject: [PATCH] When doing activity->activity transfer, use abort instead of finish Otherwise, it can be interpretted as an accepted merge. Bug: 222109476 Test: monkey Change-Id: Ia5a2259c7ba2909cce14f0a5be63517557eba2d8 --- .../src/com/android/wm/shell/transition/Transitions.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 efb52a5b4644c..610d2cc394454 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 @@ -363,7 +363,9 @@ public class Transitions implements RemoteCallable { return; } - // apply transfer starting window directly if there is no other task change. + // apply transfer starting window directly if there is no other task change. Since this + // is an activity->activity situation, we can detect it by selecting transitions with only + // 2 changes where neither are tasks and one is a starting-window recipient. final int changeSize = info.getChanges().size(); if (changeSize == 2) { boolean nonTaskChange = true; @@ -380,7 +382,9 @@ public class Transitions implements RemoteCallable { } if (nonTaskChange && transferStartingWindow) { t.apply(); - onFinish(transitionToken, null /* wct */, null /* wctCB */); + // Treat this as an abort since we are bypassing any merge logic and effectively + // finishing immediately. + onAbort(transitionToken); return; } }