Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aabd1baa authored by Jordan Demeulenaere's avatar Jordan Demeulenaere Committed by Automerger Merge Worker
Browse files

Merge "Make DialogLaunchAnimator.showFromDialog more lenient" into tm-qpr-dev...

Merge "Make DialogLaunchAnimator.showFromDialog more lenient" into tm-qpr-dev am: 0d5d95b0 am: f9f31bd6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21295778



Change-Id: I2a5e2553d2da59ab8de4270527f41f6918975252
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1099c4c7 f9f31bd6
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -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,
+6 −0
Original line number Diff line number Diff line
@@ -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 {