Skip to content

Commit dcd8c81

Browse files
Craig MautnerAndroid (Google) Code Review
authored andcommitted
Merge "Propagate systemUiVisibility changes to window manager" into jb-mr1-dev
2 parents 79d4566 + 7eac0f5 commit dcd8c81

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

core/java/android/view/View.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7436,7 +7436,7 @@ void performCollectViewAttributes(AttachInfo attachInfo, int visibility) {
74367436

74377437
void needGlobalAttributesUpdate(boolean force) {
74387438
final AttachInfo ai = mAttachInfo;
7439-
if (ai != null) {
7439+
if (ai != null && !ai.mRecomputeGlobalAttributes) {
74407440
if (force || ai.mKeepScreenOn || (ai.mSystemUiVisibility != 0)
74417441
|| ai.mHasSystemUiListeners) {
74427442
ai.mRecomputeGlobalAttributes = true;
@@ -11719,6 +11719,7 @@ void dispatchAttachedToWindow(AttachInfo info, int visibility) {
1171911719
// If nobody has evaluated the drawable state yet, then do it now.
1172011720
refreshDrawableState();
1172111721
}
11722+
needGlobalAttributesUpdate(false);
1172211723
}
1172311724

1172411725
void dispatchDetachedFromWindow() {

core/java/android/view/ViewRootImpl.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,17 +1007,15 @@ private boolean collectViewAttributes() {
10071007
//Log.i(TAG, "Computing view hierarchy attributes!");
10081008
attachInfo.mRecomputeGlobalAttributes = false;
10091009
boolean oldScreenOn = attachInfo.mKeepScreenOn;
1010-
int oldVis = attachInfo.mSystemUiVisibility;
1011-
boolean oldHasSystemUiListeners = attachInfo.mHasSystemUiListeners;
10121010
attachInfo.mKeepScreenOn = false;
10131011
attachInfo.mSystemUiVisibility = 0;
10141012
attachInfo.mHasSystemUiListeners = false;
10151013
mView.dispatchCollectViewAttributes(attachInfo, 0);
10161014
attachInfo.mSystemUiVisibility &= ~attachInfo.mDisabledSystemUiVisibility;
1015+
WindowManager.LayoutParams params = mWindowAttributes;
10171016
if (attachInfo.mKeepScreenOn != oldScreenOn
1018-
|| attachInfo.mSystemUiVisibility != oldVis
1019-
|| attachInfo.mHasSystemUiListeners != oldHasSystemUiListeners) {
1020-
WindowManager.LayoutParams params = mWindowAttributes;
1017+
|| attachInfo.mSystemUiVisibility != params.subtreeSystemUiVisibility
1018+
|| attachInfo.mHasSystemUiListeners != params.hasSystemUiListeners) {
10211019
applyKeepScreenOnFlag(params);
10221020
params.subtreeSystemUiVisibility = attachInfo.mSystemUiVisibility;
10231021
params.hasSystemUiListeners = attachInfo.mHasSystemUiListeners;

0 commit comments

Comments
 (0)