Clear VISIBLE_FOR_USER flag when isHiddenFromUser is true

The current code was clearing the LEGACY_POLICY_VISIBILITY flag when
isHiddenFromUser was returning true. This was causing issues since there was no
path to add that flag when the Window was visible for that user. The correct
way is to clear the VISIBLE_FOR_USER flag since that flag will get added again
when the window is visible for that user.

Fixes: 133235040
Test: Switch from one user to another and back. Launcher is visible.
Change-Id: I5161dd83a7a0811a7e3a6ab2af439f352f967a6c
This commit is contained in:
chaviw
2019-05-28 17:05:28 -07:00
parent 0c1f41d303
commit bb6bd8ac18

View File

@@ -1447,10 +1447,12 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
void clearPolicyVisibilityFlag(int policyVisibilityFlag) {
mPolicyVisibility &= ~policyVisibilityFlag;
mWmService.scheduleAnimationLocked();
}
void setPolicyVisibilityFlag(int policyVisibilityFlag) {
mPolicyVisibility |= policyVisibilityFlag;
mWmService.scheduleAnimationLocked();
}
private boolean isLegacyPolicyVisibility() {
@@ -3889,7 +3891,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
boolean performShowLocked() {
if (isHiddenFromUserLocked()) {
if (DEBUG_VISIBILITY) Slog.w(TAG, "hiding " + this + ", belonging to " + mOwnerUid);
hideLw(false);
clearPolicyVisibilityFlag(VISIBLE_FOR_USER);
return false;
}