diff options
| author | 2019-07-31 10:24:57 -0400 | |
|---|---|---|
| committer | 2019-07-31 21:44:02 +0000 | |
| commit | 44742c0ef8608495599c874b26b34b6745d21000 (patch) | |
| tree | c5c3449ad6c18ad5c93af80d3e15c4287edcc7d4 | |
| parent | 5f1fb46ed9cb002303f53a2c70d0baa233bf5153 (diff) | |
Fix application overlay visibility bug
System UI components may set the
SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS flag in
WindowManager.LayoutParams to force application overlays to be
invisible. StatusBarViewController is responsible for setting this when
the user locks their phone, and then removing it when the user unlocks
their phone.
Currently there is a bug where, while StatusBar removes this flag, the
update is not propagated through WindowManagerService. This causes
application overlays to be invisible when they should not be. This
affects all application overlays.
Repro steps:
1) Enable rotation if disabled
2) Enable an application overlay (e.g. Live Caption)
3) In portrait orientation, open e.g. YouTube.
4) Rotate to landscape orientation
5) Turn off the phone screen
6) Rotate to portrait orientation
7) Turn on the phone screen and unlock the phone
Application overlays are now invisible. Rotating again fixes it.
This CL fixes the logic error that was causing this bug.
Bug: 133747592
Test: go/wm-smoke
Change-Id: Idab0629765cbe048fc1eb4413e529464cad876ff
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index f356b51ebb7b..d51a5bb9501e 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -2004,6 +2004,7 @@ public class WindowManagerService extends IWindowManager.Stub int attrChanges = 0; int flagChanges = 0; + int privateFlagChanges = 0; if (attrs != null) { displayPolicy.adjustWindowParamsLw(win, attrs, pid, uid); // if they don't have the permission, mask out the status bar bits @@ -2032,6 +2033,7 @@ public class WindowManagerService extends IWindowManager.Stub } flagChanges = win.mAttrs.flags ^= attrs.flags; + privateFlagChanges = win.mAttrs.privateFlags ^ attrs.privateFlags; attrChanges = win.mAttrs.copyFrom(attrs); if ((attrChanges & (WindowManager.LayoutParams.LAYOUT_CHANGED | WindowManager.LayoutParams.SYSTEM_UI_VISIBILITY_CHANGED)) != 0) { @@ -2049,7 +2051,7 @@ public class WindowManagerService extends IWindowManager.Stub mAccessibilityController.onSomeWindowResizedOrMovedLocked(); } - if ((flagChanges & SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS) != 0) { + if ((privateFlagChanges & SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS) != 0) { updateNonSystemOverlayWindowsVisibilityIfNeeded( win, win.mWinAnimator.getShown()); } @@ -7592,7 +7594,7 @@ public class WindowManagerService extends IWindowManager.Stub return; } final boolean systemAlertWindowsHidden = !mHidingNonSystemOverlayWindows.isEmpty(); - if (surfaceShown) { + if (surfaceShown && win.hideNonSystemOverlayWindowsWhenVisible()) { if (!mHidingNonSystemOverlayWindows.contains(win)) { mHidingNonSystemOverlayWindows.add(win); } |