Skip to content

Commit 3fe38c0

Browse files
author
Craig Mautner
committed
Retain current visibility when copying layoutparam
The LayoutParams members, systemUiVisibility and subtreeSystemUiVisibility are derived values rather than app-generated values. When copying LayoutParams members make sure these values are not overwritten. Overwriting them was causing the STATUS_BAR_DISABLE_XXX flags to be overwritten exposing elements that should have remained hidden. Fixes bug b6374541. Change-Id: Iaae4b4167e1b148bbdba4d05f473844f7fa3bf8d
1 parent 232301b commit 3fe38c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/java/android/view/ViewRootImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,9 @@ void setLayoutParams(WindowManager.LayoutParams attrs, boolean newView) {
763763
// preserve compatible window flag if exists.
764764
int compatibleWindowFlag =
765765
mWindowAttributes.flags & WindowManager.LayoutParams.FLAG_COMPATIBLE_WINDOW;
766+
// transfer over system UI visibility values as they carry current state.
767+
attrs.systemUiVisibility = mWindowAttributes.systemUiVisibility;
768+
attrs.subtreeSystemUiVisibility = mWindowAttributes.subtreeSystemUiVisibility;
766769
mWindowAttributesChangesFlag = mWindowAttributes.copyFrom(attrs);
767770
mWindowAttributes.flags |= compatibleWindowFlag;
768771

0 commit comments

Comments
 (0)