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

Commit 10e3a7a3 authored by chelseahao's avatar chelseahao Committed by Chelsea Hao
Browse files

Dismiss the dialog manually if controller is null (e.g, when the dialog is...

Dismiss the dialog manually if controller is null (e.g, when the dialog is triggered from search box or the screen is locked).

Bug: 338410079
Flag: EXEMPT bugfix
Test: manual and atest
Change-Id: I6be85ef37725f461234a198c8f80f72dbe5db281
parent b352e190
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -288,11 +288,13 @@ constructor(
    private fun startSettingsActivity(intent: Intent, view: View) {
        if (job?.isActive == true) {
            intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
            activityStarter.postStartActivityDismissingKeyguard(
                intent,
                0,
                dialogTransitionAnimator.createActivityTransitionController(view)
            )
            val controller = dialogTransitionAnimator.createActivityTransitionController(view)
            // The controller will be null when the screen is locked and going to show the
            // primary bouncer. In this case we dismiss the dialog manually.
            if (controller == null) {
                cancelJob()
            }
            activityStarter.postStartActivityDismissingKeyguard(intent, 0, controller)
        }
    }