diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt index 9a9236be9c8a0..a3ed0856c60ae 100644 --- a/packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt @@ -237,13 +237,17 @@ constructor( openedDialogs.firstOrNull { it.dialog.window.decorView.viewRootImpl == controller.viewRoot } - val animateFrom = + val controller = animatedParent?.dialogContentWithBackground?.let { Controller.fromView(it, controller.cuj) } ?: controller - if (animatedParent == null && animateFrom !is LaunchableView) { + if ( + animatedParent == null && + controller is ViewDialogLaunchAnimatorController && + controller.source !is LaunchableView + ) { // Make sure the View we launch from implements LaunchableView to avoid visibility // issues. Given that we don't own dialog decorViews so we can't enforce it for launches // from a dialog. @@ -272,7 +276,7 @@ constructor( launchAnimator, callback, interactionJankMonitor, - animateFrom, + controller, onDialogDismissed = { openedDialogs.remove(it) }, dialog = dialog, animateBackgroundBoundsChange, diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/ViewDialogLaunchAnimatorController.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/ViewDialogLaunchAnimatorController.kt index 46d5a5c0af8c0..9257f99efe966 100644 --- a/packages/SystemUI/animation/src/com/android/systemui/animation/ViewDialogLaunchAnimatorController.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/ViewDialogLaunchAnimatorController.kt @@ -25,7 +25,7 @@ import com.android.internal.jank.InteractionJankMonitor /** A [DialogLaunchAnimator.Controller] that can animate a [View] from/to a dialog. */ class ViewDialogLaunchAnimatorController internal constructor( - private val source: View, + internal val source: View, override val cuj: DialogCuj?, ) : DialogLaunchAnimator.Controller { override val viewRoot: ViewRootImpl?