diff options
author | wilsonshih <wilsonshih@google.com> | 2020-02-14 11:20:51 +0800 |
---|---|---|
committer | wilsonshih <wilsonshih@google.com> | 2020-02-18 13:24:27 +0800 |
commit | c21e6de9085fa0fe6b4755bd5473b2b5ffcdc70f (patch) | |
tree | 88bed005fdb2c7c9368c64fc7ded7844125a0b22 /packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java | |
parent | 8a48bc0b1ffc891404396a2372188d8f91b44562 (diff) |
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
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java index 571c4ae0e386..11bf24d27170 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java @@ -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)) { - hidePresentation(displayId); + final Presentation presentation = mPresentations.get(displayId); + if (presentation != null && mShowing) { + hidePresentation(displayId); + // update DisplayInfo. + final Display display = mDisplayService.getDisplay(displayId); + if (display != null) { showPresentation(display); } } @@ -266,6 +267,11 @@ public class KeyguardDisplayManager { } @Override + public void cancel() { + // Do not allow anything to cancel KeyguardPresetation except KeyguardDisplayManager. + } + + @Override public void onDetachedFromWindow() { mClock.removeCallbacks(mMoveTextRunnable); } |