From d436036b23a27d66ee04755a7a01a878849b33fa Mon Sep 17 00:00:00 2001 From: Chris Li Date: Wed, 23 Nov 2022 16:02:53 +0800 Subject: [PATCH] Handle ActivityEmbedding container in remote transition adapter 1. When embedded TaskFragment is open/close with Task, we should only animate the Task. 2. When there is only a non-fullscreen embedded TaskFragment in the transition, we don't want to animate it, otherwise it may only animate partial of the Task. Fix: 260156661 Test: verify with opening Settings from quick settings. Change-Id: I6f3ae7c880ddbb17b33040c9ba19beb4d865fc35 --- .../systemui/animation/RemoteTransitionAdapter.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/RemoteTransitionAdapter.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/RemoteTransitionAdapter.kt index f9c6841f96b56..86d4b12ea082a 100644 --- a/packages/SystemUI/animation/src/com/android/systemui/animation/RemoteTransitionAdapter.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/RemoteTransitionAdapter.kt @@ -195,8 +195,16 @@ class RemoteTransitionAdapter { val out = ArrayList() for (i in info.changes.indices) { val change = info.changes[i] - val changeIsWallpaper = change.flags and TransitionInfo.FLAG_IS_WALLPAPER != 0 - if (wallpapers != changeIsWallpaper) continue + if (change.hasFlags(TransitionInfo.FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY)) { + // For embedded container, when the parent Task is also in the transition, we + // should only animate the parent Task. + if (change.parent != null) continue + // For embedded container without parent, we should only animate if it fills + // the Task. Otherwise we may animate only partial of the Task. + if (!change.hasFlags(TransitionInfo.FLAG_FILLS_TASK)) continue + } + // Check if it is wallpaper + if (wallpapers != change.hasFlags(TransitionInfo.FLAG_IS_WALLPAPER)) continue out.add(createTarget(change, info.changes.size - i, info, t)) if (leashMap != null) { leashMap[change.leash] = out[out.size - 1].leash