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

Commit aa4bf788 authored by Chris Li's avatar Chris Li
Browse files

Fix locked second screen on boot

Before, when hid and showed a different keyguard presentation, the
onDismissListener would remove the newly added one, which caused the
later presentation existence check to return the incorrect value. Now,
we add a check to only remove the dismissed presentation.

Bug: 152253158
Test: MultiDisplayKeyguardTests#testUnlockScreen_secondDisplayChanged_dismissesKeyguardOnUnlock
      MultiDisplayKeyguardTests#testUnlockScreen_decoredSystemDisplayChanged_dismissesKeyguardOnUnlock
Change-Id: I9dabc15e1228cc9417ed24981b332b8f1af818c8
parent c2ba1873
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -126,12 +126,14 @@ public class KeyguardDisplayManager {
        final int displayId = display.getDisplayId();
        Presentation presentation = mPresentations.get(displayId);
        if (presentation == null) {
            presentation = new KeyguardPresentation(mContext, display, mInjectableInflater);
            presentation.setOnDismissListener(dialog -> {
                if (null != mPresentations.get(displayId)) {
            final Presentation newPresentation =
                    new KeyguardPresentation(mContext, display, mInjectableInflater);
            newPresentation.setOnDismissListener(dialog -> {
                if (newPresentation.equals(mPresentations.get(displayId))) {
                    mPresentations.remove(displayId);
                }
            });
            presentation = newPresentation;
            try {
                presentation.show();
            } catch (WindowManager.InvalidDisplayException ex) {