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

Commit 3319d020 authored by Louis Chang's avatar Louis Chang
Browse files

Fix activities cannot be resumed when non-secure keyguard shown

Activities were unable to show on secondary displays with
FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD flag because the AOD
was showing on default display.

Bug: 128248976
Test: atest KeyguardTests
Test: atest ActivityManagerMultiDisplayTests

Change-Id: Ifcbc06106c306aca897d280f84d19fb7fb8a6582
parent 4c3a6b68
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -95,13 +95,15 @@ class KeyguardController {
    }

    /**
     * @return {@code true} if 1) Keyguard is showing, not going away, and not being occluded on the
     *         given display, or 2) AOD is showing, {@code false} otherwise.
     * @return {@code true} for default display when AOD is showing. Otherwise, same as
     *         {@link #isKeyguardOrAodShowing(int)}
     * TODO(b/125198167): Replace isKeyguardOrAodShowing() by this logic.
     */
    boolean isKeyguardUnoccludedOrAodShowing(int displayId) {
        return (mKeyguardShowing && !mKeyguardGoingAway && !isDisplayOccluded(displayId))
                || mAodShowing;
        if (displayId == DEFAULT_DISPLAY && mAodShowing) {
            return true;
        }
        return isKeyguardOrAodShowing(displayId);
    }

    /**