summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wei Sheng Shih <wilsonshih@google.com> 2023-05-11 08:52:24 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-05-11 08:52:24 +0000
commit181bcdba086a88531bf8b97f5f959e157f62566e (patch)
tree56958784627bce460bc52e289dfd09b8fbae7ca5
parent891069268592d00c80d905d456cb3999054622e0 (diff)
parent79a873095806c2b93264f5216ff121b3639f1dff (diff)
Merge "Apply root task for launch activity animation." into udc-dev
-rw-r--r--packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt23
1 files changed, 21 insertions, 2 deletions
diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt
index 4037fd4a09d8..764a8556a54d 100644
--- a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt
+++ b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt
@@ -508,6 +508,26 @@ class ActivityLaunchAnimator(
startAnimation(apps, nonApps, callback)
}
+ private fun findRootTaskIfPossible(
+ apps: Array<out RemoteAnimationTarget>?
+ ): RemoteAnimationTarget? {
+ if (apps == null) {
+ return null
+ }
+ var candidate: RemoteAnimationTarget? = null
+ for (it in apps) {
+ if (it.mode == RemoteAnimationTarget.MODE_OPENING) {
+ if (it.taskInfo != null && !it.hasAnimatingParent) {
+ return it
+ }
+ if (candidate == null) {
+ candidate = it
+ }
+ }
+ }
+ return candidate
+ }
+
private fun startAnimation(
apps: Array<out RemoteAnimationTarget>?,
nonApps: Array<out RemoteAnimationTarget>?,
@@ -517,8 +537,7 @@ class ActivityLaunchAnimator(
Log.d(TAG, "Remote animation started")
}
- val window = apps?.firstOrNull { it.mode == RemoteAnimationTarget.MODE_OPENING }
-
+ val window = findRootTaskIfPossible(apps)
if (window == null) {
Log.i(TAG, "Aborting the animation as no window is opening")
removeTimeout()