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

Commit 52ea28e0 authored by lumark's avatar lumark
Browse files

Fix system crash in Atms.notifyKeyguardFlagsChanged.

The crash happened when the external display removed during relayout and post
message to notify keyguard flags changed for updating transition on
this display, and then got NULL activiy display after message received.

Add a null check in notifyKeyguardFlagsChanged to fix this crash.

Bug: 119285175

Test: All existing tests passed.
Change-Id: I1768b1485d20973049fc92f97dcaccde31510499
parent b2117bbc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -5657,8 +5657,12 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {

                // We might change the visibilities here, so prepare an empty app transition which
                // might be overridden later if we actually change visibilities.
                final DisplayWindowController dwc = mStackSupervisor.getActivityDisplay(displayId)
                        .getWindowContainerController();
                final ActivityDisplay activityDisplay =
                        mStackSupervisor.getActivityDisplay(displayId);
                if (activityDisplay == null) {
                    return;
                }
                final DisplayWindowController dwc = activityDisplay.getWindowContainerController();
                final boolean wasTransitionSet = dwc.getPendingAppTransition() != TRANSIT_NONE;
                if (!wasTransitionSet) {
                    dwc.prepareAppTransition(TRANSIT_NONE, false /* alwaysKeepCurrent */);