Merge "Propagate systemUiVisibility changes to window manager" into jb-mr1-dev

This commit is contained in:
Craig Mautner
2012-09-13 13:55:50 -07:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 6 deletions

View File

@@ -7436,7 +7436,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
void needGlobalAttributesUpdate(boolean force) {
final AttachInfo ai = mAttachInfo;
if (ai != null) {
if (ai != null && !ai.mRecomputeGlobalAttributes) {
if (force || ai.mKeepScreenOn || (ai.mSystemUiVisibility != 0)
|| ai.mHasSystemUiListeners) {
ai.mRecomputeGlobalAttributes = true;
@@ -11719,6 +11719,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
// If nobody has evaluated the drawable state yet, then do it now.
refreshDrawableState();
}
needGlobalAttributesUpdate(false);
}
void dispatchDetachedFromWindow() {

View File

@@ -1007,17 +1007,15 @@ public final class ViewRootImpl implements ViewParent,
//Log.i(TAG, "Computing view hierarchy attributes!");
attachInfo.mRecomputeGlobalAttributes = false;
boolean oldScreenOn = attachInfo.mKeepScreenOn;
int oldVis = attachInfo.mSystemUiVisibility;
boolean oldHasSystemUiListeners = attachInfo.mHasSystemUiListeners;
attachInfo.mKeepScreenOn = false;
attachInfo.mSystemUiVisibility = 0;
attachInfo.mHasSystemUiListeners = false;
mView.dispatchCollectViewAttributes(attachInfo, 0);
attachInfo.mSystemUiVisibility &= ~attachInfo.mDisabledSystemUiVisibility;
WindowManager.LayoutParams params = mWindowAttributes;
if (attachInfo.mKeepScreenOn != oldScreenOn
|| attachInfo.mSystemUiVisibility != oldVis
|| attachInfo.mHasSystemUiListeners != oldHasSystemUiListeners) {
WindowManager.LayoutParams params = mWindowAttributes;
|| attachInfo.mSystemUiVisibility != params.subtreeSystemUiVisibility
|| attachInfo.mHasSystemUiListeners != params.hasSystemUiListeners) {
applyKeepScreenOnFlag(params);
params.subtreeSystemUiVisibility = attachInfo.mSystemUiVisibility;
params.hasSystemUiListeners = attachInfo.mHasSystemUiListeners;