Respect always unlocked displays when keyguard is shown. When keyguard is shown on the default display, all secondary displays report mHasContent=false, even if these displays are created with FLAG_ALWAYS_UNLOCKED (in practice this means that these displays belong to an always unlocked virtual device). Setting mHasContent=false on such displays is wrong - any windows there are visible and interactive. This also does not propagate display changes to these windows, which causes a bug when the display is rotated. Fix: 285141170 Test: m (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1df55100cf2546c257b3722531a4668d193d3a1e) Merged-In: Ief1fa2db10c234ba179ba741434ce3d6ebef290e Change-Id: Ief1fa2db10c234ba179ba741434ce3d6ebef290e
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java index 54fec3e..d9a954f 100644 --- a/services/core/java/com/android/server/wm/RootWindowContainer.java +++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -1061,8 +1061,10 @@ displayHasContent = true; } else if (displayContent != null && (!mObscureApplicationContentOnSecondaryDisplays + || displayContent.isKeyguardAlwaysUnlocked() || (obscured && type == TYPE_KEYGUARD_DIALOG))) { - // Allow full screen keyguard presentation dialogs to be seen. + // Allow full screen keyguard presentation dialogs to be seen, or simply ignore the + // keyguard if this display is always unlocked. displayHasContent = true; } if ((privateflags & PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE) != 0) {