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

Commit 32a87b8c authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Fix unable to resume activity with dismiss-keyguard flag

When the activity with dismiss-keyguard is becoming top because
the other top non-show-when-lock activities are gone, the occluded
state may not been updated that causes activity state stays at
stopped and visible.

Bug: 117859366
Test: atest CtsActivityManagerDeviceTestCases:KeyguardTests# \
            testResumeDismissKeyguardActivityFromBackground

Change-Id: I1dc975a3a45094b163043f0592f422142fb4fc43
parent 627ffa90
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -2473,12 +2473,17 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
            // If the current top activity may be able to occlude keyguard but the occluded state
            // has not been set, update visibility and check again if we should continue to resume.
            boolean nothingToResume = true;
            if (!mService.mShuttingDown && !mTopActivityOccludesKeyguard
                    && next.canShowWhenLocked()) {
            if (!mService.mShuttingDown) {
                final boolean canShowWhenLocked = !mTopActivityOccludesKeyguard
                        && next.canShowWhenLocked();
                final boolean mayDismissKeyguard = mTopDismissingKeyguardActivity != next
                        && next.hasDismissKeyguardWindows();
                if (canShowWhenLocked || mayDismissKeyguard) {
                    ensureActivitiesVisibleLocked(null /* starting */, 0 /* configChanges */,
                            !PRESERVE_WINDOWS);
                    nothingToResume = shouldSleepActivities();
                }
            }
            if (nothingToResume) {
                // Make sure we have executed any pending transitions, since there
                // should be nothing left to do at this point.