Merge "Fix locked second screen on boot" into rvc-dev

This commit is contained in:
Chris Li
2020-03-31 16:06:24 +00:00
committed by Android (Google) Code Review

View File

@@ -126,12 +126,14 @@ public class KeyguardDisplayManager {
final int displayId = display.getDisplayId(); final int displayId = display.getDisplayId();
Presentation presentation = mPresentations.get(displayId); Presentation presentation = mPresentations.get(displayId);
if (presentation == null) { if (presentation == null) {
presentation = new KeyguardPresentation(mContext, display, mInjectableInflater); final Presentation newPresentation =
presentation.setOnDismissListener(dialog -> { new KeyguardPresentation(mContext, display, mInjectableInflater);
if (null != mPresentations.get(displayId)) { newPresentation.setOnDismissListener(dialog -> {
if (newPresentation.equals(mPresentations.get(displayId))) {
mPresentations.remove(displayId); mPresentations.remove(displayId);
} }
}); });
presentation = newPresentation;
try { try {
presentation.show(); presentation.show();
} catch (WindowManager.InvalidDisplayException ex) { } catch (WindowManager.InvalidDisplayException ex) {