diff options
| author | Dianne Hackborn <hackbod@google.com> | 2012-05-08 18:53:51 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2012-05-09 14:53:20 -0700 |
| commit | a53de0629f3b94472c0f160f5bbe1090b020feab (patch) | |
| tree | d3816b90689fee8b1aee48cdc834ce0f597e99d3 /core/java/android/view/ViewRootImpl.java | |
| parent | 8b2e37e5a0e10d234ffe6815e9a462283cad3d78 (diff) | |
Add callback hack to find out when to load system properties.
Use this to reload the trace and layout bounds properties.
This is ONLY for debugging.
Change-Id: I1c4bdb52c823520c352c5bac45fa9ee31160793c
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 5f295cb4b010..6e6fab20b6db 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -408,6 +408,7 @@ public final class ViewRootImpl implements ViewParent, PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); mAttachInfo.mScreenOn = powerManager.isScreenOn(); + loadSystemProperties(); } /** @@ -846,6 +847,16 @@ public final class ViewRootImpl implements ViewParent, scheduleTraversals(); } + void invalidateWorld(View view) { + view.invalidate(); + if (view instanceof ViewGroup) { + ViewGroup parent = (ViewGroup)view; + for (int i=0; i<parent.getChildCount(); i++) { + invalidateWorld(parent.getChildAt(i)); + } + } + } + public void invalidateChild(View child, Rect dirty) { invalidateChildInParent(null, dirty); } @@ -2730,6 +2741,7 @@ public final class ViewRootImpl implements ViewParent, private final static int MSG_INVALIDATE_DISPLAY_LIST = 21; private final static int MSG_CLEAR_ACCESSIBILITY_FOCUS_HOST = 22; private final static int MSG_DISPATCH_DONE_ANIMATING = 23; + private final static int MSG_INVALIDATE_WORLD = 24; final class ViewRootHandler extends Handler { @Override @@ -2997,6 +3009,9 @@ public final class ViewRootImpl implements ViewParent, case MSG_DISPATCH_DONE_ANIMATING: { handleDispatchDoneAnimating(); } break; + case MSG_INVALIDATE_WORLD: { + invalidateWorld(mView); + } break; } } } @@ -4016,6 +4031,17 @@ public final class ViewRootImpl implements ViewParent, mHandler.sendMessage(msg); } + public void loadSystemProperties() { + boolean layout = SystemProperties.getBoolean( + View.DEBUG_LAYOUT_PROPERTY, false); + if (layout != mAttachInfo.mDebugLayout) { + mAttachInfo.mDebugLayout = layout; + if (!mHandler.hasMessages(MSG_INVALIDATE_WORLD)) { + mHandler.sendEmptyMessageDelayed(MSG_INVALIDATE_WORLD, 200); + } + } + } + private void destroyHardwareRenderer() { AttachInfo attachInfo = mAttachInfo; HardwareRenderer hardwareRenderer = attachInfo.mHardwareRenderer; |
