diff options
| author | Joe Onorato <joeo@google.com> | 2011-01-24 13:16:08 -0800 |
|---|---|---|
| committer | Joe Onorato <joeo@google.com> | 2011-01-24 13:16:08 -0800 |
| commit | 10f4126a367071a49f208f10ceb1ed0e1151d48c (patch) | |
| tree | cce461617122e75119f6a33e13cb8702688bfe6e /core/java/android/view/ViewRoot.java | |
| parent | a19ca02ce218b5555b3af1c767e8e989c5d29554 (diff) | |
| parent | faf083ef0b7b893acb871084231d20e08e208f8f (diff) | |
resolved conflicts for merge of faf083ef to master
Change-Id: I316a1b4356f6dba6c3880ccb02dbb2fa00d21a85
Diffstat (limited to 'core/java/android/view/ViewRoot.java')
| -rw-r--r-- | core/java/android/view/ViewRoot.java | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index e73f0dda7a8e..6bc5e8a9289e 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -723,6 +723,7 @@ public final class ViewRoot extends Handler implements ViewParent, attachInfo.mWindowVisibility = viewVisibility; attachInfo.mRecomputeGlobalAttributes = false; attachInfo.mKeepScreenOn = false; + attachInfo.mSystemUiVisibility = 0; viewVisibilityChanged = false; mLastConfiguration.setTo(host.getResources().getConfiguration()); host.dispatchAttachedToWindow(attachInfo, 0); @@ -896,14 +897,17 @@ public final class ViewRoot extends Handler implements ViewParent, } if (attachInfo.mRecomputeGlobalAttributes) { - //Log.i(TAG, "Computing screen on!"); + //Log.i(TAG, "Computing view hierarchy attributes!"); attachInfo.mRecomputeGlobalAttributes = false; - boolean oldVal = attachInfo.mKeepScreenOn; + boolean oldScreenOn = attachInfo.mKeepScreenOn; + int oldVis = attachInfo.mSystemUiVisibility; attachInfo.mKeepScreenOn = false; + attachInfo.mSystemUiVisibility = 0; + attachInfo.mHasSystemUiListeners = false; host.dispatchCollectViewAttributes(0); - if (attachInfo.mKeepScreenOn != oldVal) { + if (attachInfo.mKeepScreenOn != oldScreenOn || + attachInfo.mSystemUiVisibility != oldVis) { params = lp; - //Log.i(TAG, "Keep screen on changed: " + attachInfo.mKeepScreenOn); } } @@ -985,6 +989,8 @@ public final class ViewRoot extends Handler implements ViewParent, if (attachInfo.mKeepScreenOn) { params.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; } + params.systemUiVisibility = attachInfo.mSystemUiVisibility; + params.hasSystemUiListeners = attachInfo.mHasSystemUiListeners; } if (DEBUG_LAYOUT) { Log.i(TAG, "host=w:" + host.getMeasuredWidth() + ", h:" + @@ -1900,7 +1906,8 @@ public final class ViewRoot extends Handler implements ViewParent, public final static int CLOSE_SYSTEM_DIALOGS = 1014; public final static int DISPATCH_DRAG_EVENT = 1015; public final static int DISPATCH_DRAG_LOCATION_EVENT = 1016; - public final static int DISPATCH_GENERIC_MOTION = 1017; + public final static int DISPATCH_SYSTEM_UI_VISIBILITY = 1017; + public final static int DISPATCH_GENERIC_MOTION = 1018; @Override public void handleMessage(Message msg) { @@ -2066,6 +2073,9 @@ public final class ViewRoot extends Handler implements ViewParent, event.mLocalState = mLocalDragState; // only present when this app called startDrag() handleDragEvent(event); } break; + case DISPATCH_SYSTEM_UI_VISIBILITY: { + handleDispatchSystemUiVisibilityChanged(msg.arg1); + } break; } } @@ -2931,6 +2941,11 @@ public final class ViewRoot extends Handler implements ViewParent, event.recycle(); } + public void handleDispatchSystemUiVisibilityChanged(int visibility) { + if (mView == null) return; + mView.dispatchSystemUiVisibilityChanged(visibility); + } + public void getLastTouchPoint(Point outLocation) { outLocation.x = (int) mLastTouchPoint.x; outLocation.y = (int) mLastTouchPoint.y; @@ -3249,6 +3264,10 @@ public final class ViewRoot extends Handler implements ViewParent, sendMessage(msg); } + public void dispatchSystemUiVisibilityChanged(int visibility) { + sendMessage(obtainMessage(DISPATCH_SYSTEM_UI_VISIBILITY, visibility, 0)); + } + /** * The window is getting focus so if there is anything focused/selected * send an {@link AccessibilityEvent} to announce that. @@ -3467,6 +3486,14 @@ public final class ViewRoot extends Handler implements ViewParent, viewRoot.dispatchDragEvent(event); } } + + @Override + public void dispatchSystemUiVisibilityChanged(int visibility) { + final ViewRoot viewRoot = mViewRoot.get(); + if (viewRoot != null) { + viewRoot.dispatchSystemUiVisibilityChanged(visibility); + } + } } /** |
