Loading packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt +10 −4 Original line number Diff line number Diff line Loading @@ -304,10 +304,16 @@ constructor( ) { val view = openedDialogs.firstOrNull { it.dialog == animateFrom }?.dialogContentWithBackground ?: throw IllegalStateException( "The animateFrom dialog was not animated using " + "DialogLaunchAnimator.showFrom(View|Dialog)" if (view == null) { Log.w( TAG, "Showing dialog $dialog normally as the dialog it is shown from was not shown " + "using DialogLaunchAnimator" ) dialog.show() return } showFromView( dialog, view, Loading packages/SystemUI/tests/src/com/android/systemui/animation/DialogLaunchAnimatorTest.kt +6 −0 Original line number Diff line number Diff line Loading @@ -268,6 +268,12 @@ class DialogLaunchAnimatorTest : SysuiTestCase() { } } @Test fun showFromDialogDoesNotCrashWhenShownFromRandomDialog() { val dialog = createDialogAndShowFromDialog(animateFrom = TestDialog(context)) dialog.dismiss() } private fun createAndShowDialog( animator: DialogLaunchAnimator = dialogLaunchAnimator, ): TestDialog { Loading Loading
packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt +10 −4 Original line number Diff line number Diff line Loading @@ -304,10 +304,16 @@ constructor( ) { val view = openedDialogs.firstOrNull { it.dialog == animateFrom }?.dialogContentWithBackground ?: throw IllegalStateException( "The animateFrom dialog was not animated using " + "DialogLaunchAnimator.showFrom(View|Dialog)" if (view == null) { Log.w( TAG, "Showing dialog $dialog normally as the dialog it is shown from was not shown " + "using DialogLaunchAnimator" ) dialog.show() return } showFromView( dialog, view, Loading
packages/SystemUI/tests/src/com/android/systemui/animation/DialogLaunchAnimatorTest.kt +6 −0 Original line number Diff line number Diff line Loading @@ -268,6 +268,12 @@ class DialogLaunchAnimatorTest : SysuiTestCase() { } } @Test fun showFromDialogDoesNotCrashWhenShownFromRandomDialog() { val dialog = createDialogAndShowFromDialog(animateFrom = TestDialog(context)) dialog.dismiss() } private fun createAndShowDialog( animator: DialogLaunchAnimator = dialogLaunchAnimator, ): TestDialog { Loading