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

Commit c21e6de9 authored by wilsonshih's avatar wilsonshih
Browse files

Prevent KeyguardPresentation been dismissed.

By default Presentation can be dismiss if DisplayMetrics has changed.
However, even when DisplayMetrics has changed, we should still show
KeyguardPresentation on secondary display.

Bug: 149004025
Test: follow issue description.
Test: atest MultiDisplayKeyguardTests
Change-Id: Icf7f5726648bc8b8037bbdd31eac3f0b1cbd5945
parent 8a48bc0b
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -72,11 +72,12 @@ public class KeyguardDisplayManager {
        @Override
        public void onDisplayChanged(int displayId) {
            if (displayId == DEFAULT_DISPLAY) return;
            final Display display = mDisplayService.getDisplay(displayId);
            if (display != null && mShowing) {
            final Presentation presentation = mPresentations.get(displayId);
                if (presentation != null && !presentation.getDisplay().equals(display)) {
            if (presentation != null && mShowing) {
                hidePresentation(displayId);
                // update DisplayInfo.
                final Display display = mDisplayService.getDisplay(displayId);
                if (display != null) {
                    showPresentation(display);
                }
            }
@@ -265,6 +266,11 @@ public class KeyguardDisplayManager {
            setCancelable(false);
        }

        @Override
        public void cancel() {
            // Do not allow anything to cancel KeyguardPresetation except KeyguardDisplayManager.
        }

        @Override
        public void onDetachedFromWindow() {
            mClock.removeCallbacks(mMoveTextRunnable);