Merge "docs: Add gen. dumpsys article, rename and update input."
diff --git a/src/devices/devices_toc.cs b/src/devices/devices_toc.cs
index b82c4ad..2f5d0e4 100644
--- a/src/devices/devices_toc.cs
+++ b/src/devices/devices_toc.cs
@@ -1,5 +1,5 @@
 <!--
-    Copyright 2014 The Android Open Source Project
+    Copyright 2015 The Android Open Source Project
 
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -126,7 +126,7 @@
           <li><a href="<?cs var:toroot ?>devices/input/migration-guide.html">Migration Guide</a></li>
           <li><a href="<?cs var:toroot ?>devices/input/keyboard-devices.html">Keyboard Devices</a></li>
           <li><a href="<?cs var:toroot ?>devices/input/touch-devices.html">Touch Devices</a></li>
-          <li><a href="<?cs var:toroot ?>devices/input/dumpsys.html">Dumpsys</a></li>
+          <li><a href="<?cs var:toroot ?>devices/input/diagnostics.html">Diagnostics</a></li>
           <li><a href="<?cs var:toroot ?>devices/input/getevent.html">Getevent</a></li>
           <li><a href="<?cs var:toroot ?>devices/input/validate-keymaps.html">Validate Keymaps</a></li>
         </ul>
@@ -250,6 +250,8 @@
         <ul>
           <li><a href="<?cs var:toroot ?>devices/tech/debug/tuning.html">Performance Tuning</a></li>
           <li><a href="<?cs var:toroot ?>devices/tech/debug/native-memory.html">Native Memory Usage</a></li>
+          <li><a href="<?cs var:toroot ?>devices/tech/debug/dumpsys.html">Dumpsys</a></li>
+
         </ul>
       </li>
 
@@ -278,13 +280,13 @@
               <a href="<?cs var:toroot ?>devices/tech/ota/index.html">
                 <span class="en">OTA Updates</span>
               </a>
-	    </div>
-	    <ul>
+    </div>
+            <ul>
               <li><a href="<?cs var:toroot ?>devices/tech/ota/tools.html">OTA Tools</a></li>
               <li><a href="<?cs var:toroot ?>devices/tech/ota/block.html">Block-based OTA</a></li>
-	      <li><a href="<?cs var:toroot ?>devices/tech/ota/inside_packages.html">Inside OTA Packages</a></li>
-	      <li><a href="<?cs var:toroot ?>devices/tech/ota/device_code.html">Device-Specific Code</a></li>
-	      <li><a href="<?cs var:toroot ?>devices/tech/ota/sign_builds.html">Signing Builds for Release</a></li>
+              <li><a href="<?cs var:toroot ?>devices/tech/ota/inside_packages.html">Inside OTA Packages</a></li>
+              <li><a href="<?cs var:toroot ?>devices/tech/ota/device_code.html">Device-Specific Code</a></li>
+              <li><a href="<?cs var:toroot ?>devices/tech/ota/sign_builds.html">Signing Builds for Release</a></li>
             </ul>
       </li>
 
diff --git a/src/devices/input/diagnostics.jd b/src/devices/input/diagnostics.jd
new file mode 100644
index 0000000..0fc7a3e
--- /dev/null
+++ b/src/devices/input/diagnostics.jd
@@ -0,0 +1,490 @@
+page.title=Dumpsys Input Diagnostics
+@jd:body
+
+<!--
+    Copyright 2015 The Android Open Source Project
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<div id="qv-wrapper">
+  <div id="qv">
+    <h2>In this document</h2>
+    <ol id="auto-toc">
+    </ol>
+  </div>
+</div>
+
+<p>The <code>dumpsys</code> input command dumps the state of the
+system’s input devices, such as keyboards and touchscreens, and the
+processing of input events.</p>
+
+<h2 id="input">Input</h2>
+<p>To dump the input system’s state, run the following command:</p>
+<pre>
+$ adb shell dumpsys input
+</pre>
+
+<h2 id="output">Output</h2>
+
+<p>The set of information reported varies depending on the version of Android
+but consists of three sections:</p>
+
+<ul>
+  <li> Event Hub State
+  <li> Input Reader State
+  <li> Input Dispatcher State
+</ul>
+
+<h3 id="event_hub_state">Event Hub State</h3>
+
+<pre><code>
+INPUT MANAGER (dumpsys input)
+
+Event Hub State:
+  BuiltInKeyboardId: -2
+  Devices:
+    -1: Virtual
+      Classes: 0x40000023
+      Path: <virtual>
+      Descriptor: a718a782d34bc767f4689c232d64d527998ea7fd
+      Location:
+      ControllerNumber: 0
+      UniqueId: <virtual>
+      Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
+      KeyLayoutFile: /system/usr/keylayout/Generic.kl
+      KeyCharacterMapFile: /system/usr/keychars/Virtual.kcm
+      ConfigurationFile:
+      HaveKeyboardLayoutOverlay: false
+    1: msm8974-taiko-mtp-snd-card Headset Jack
+      Classes: 0x00000080
+      Path: /dev/input/event5
+      Descriptor: c8e3782483b4837ead6602e20483c46ff801112c
+      Location: ALSA
+      ControllerNumber: 0
+      UniqueId:
+      Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
+      KeyLayoutFile:
+      KeyCharacterMapFile:
+      ConfigurationFile:
+      HaveKeyboardLayoutOverlay: false
+    2: msm8974-taiko-mtp-snd-card Button Jack
+      Classes: 0x00000001
+      Path: /dev/input/event4
+      Descriptor: 96fe62b244c555351ec576b282232e787fb42bab
+      Location: ALSA
+      ControllerNumber: 0
+      UniqueId:
+      Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
+      KeyLayoutFile: /system/usr/keylayout/msm8974-taiko-mtp-snd-card_Button_Jack.kl
+      KeyCharacterMapFile: /system/usr/keychars/msm8974-taiko-mtp-snd-card_Button_Jack.kcm
+      ConfigurationFile:
+      HaveKeyboardLayoutOverlay: false
+    3: hs_detect
+      Classes: 0x00000081
+      Path: /dev/input/event3
+      Descriptor: 485d69228e24f5e46da1598745890b214130dbc4
+      Location:
+      ControllerNumber: 0
+      UniqueId:
+      Identifier: bus=0x0000, vendor=0x0001, product=0x0001, version=0x0001
+      KeyLayoutFile: /system/usr/keylayout/hs_detect.kl
+      KeyCharacterMapFile: /system/usr/keychars/hs_detect.kcm
+      ConfigurationFile:
+      HaveKeyboardLayoutOverlay: false
+    4: touch_dev
+      Classes: 0x00000014
+      Path: /dev/input/event1
+      Descriptor: 4e2720e99bd2b59adae8529881343531fff7c98e
+      Location:
+      ControllerNumber: 0
+      UniqueId:
+      Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
+      KeyLayoutFile:
+      KeyCharacterMapFile:
+      ConfigurationFile: /system/usr/idc/touch_dev.idc
+      HaveKeyboardLayoutOverlay: false
+    5: qpnp_pon
+      Classes: 0x00000001
+      Path: /dev/input/event0
+      Descriptor: fb60d4f4370f5dbe8267b63d38dea852987571ab
+      Location: qpnp_pon/input0
+      ControllerNumber: 0
+      UniqueId:
+      Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
+      KeyLayoutFile: /system/usr/keylayout/qpnp_pon.kl
+      KeyCharacterMapFile: /system/usr/keychars/qpnp_pon.kcm
+      ConfigurationFile:
+      HaveKeyboardLayoutOverlay: false
+    6: gpio-keys
+      Classes: 0x00000081
+      Path: /dev/input/event2
+      Descriptor: d2c52ff0f656fac4cd7b7a118d575e0109a9fe1c
+      Location: gpio-keys/input0
+      ControllerNumber: 0
+      UniqueId:
+      Identifier: bus=0x0019, vendor=0x0001, product=0x0001, version=0x0100
+      KeyLayoutFile: /system/usr/keylayout/gpio-keys.kl
+      KeyCharacterMapFile: /system/usr/keychars/gpio-keys.kcm
+      ConfigurationFile:
+      HaveKeyboardLayoutOverlay: false
+</code></pre>
+
+<h4 id="things-to-look-for">Things to check</h4>
+
+<ul>
+  <li> All of the expected input devices are present.</li>
+
+  <li> Each input device has an appropriate key layout file, key character map
+  file and input device configuration file.  If the files are missing or contain
+  syntax errors, then they will not be loaded.</li>
+
+  <li> Each input device is being classified correctly.  The bits in the
+  <code>Classes</code> field correspond to flags in <code>EventHub.h</code> such
+  as <code>INPUT_DEVICE_CLASS_TOUCH_MT</code>.</li>
+
+  <li> The <code>BuiltInKeyboardId</code> is correct.  If the device does not
+  have a built-in keyboard, then the id must be <code>-2</code>, otherwise it
+  should be the id of the built-in keyboard.</li>
+
+  <li>If you observe that the <code>BuiltInKeyboardId</code> is not
+  <code>-2</code> but it should be, then you are missing a key character map file
+  for a special function keypad somewhere.  Special function keypad devices
+  should have key character map files that contain just the line <code>type
+  SPECIAL_FUNCTION</code> (that's what in the <code>tuna-gpio-keykad.kcm</code>
+  file we see mentioned above).</li>
+</ul>
+
+<h3 id="input-reader-state">Input Reader State</h3>
+<p>The <code>InputReader</code> is responsible for decoding input events from the kernel.
+Its state dump shows information about how each input device is configured
+and recent state changes that have occurred, such as key presses or touches on
+the touch screen.</p>
+
+<p>As an example, this is what a special function keypad looks like:</p>
+
+<pre>
+Input Reader State
+...
+  Device 3: tuna-gpio-keypad
+    IsExternal: false
+    Sources: 0x00000101
+    KeyboardType: 1
+    Keyboard Input Mapper:
+      Parameters:
+        AssociatedDisplayId: -1
+        OrientationAware: false
+      KeyboardType: 1
+      Orientation: 0
+      KeyDowns: 0 keys currently down
+      MetaState: 0x0
+      DownTime: 75816923828000
+</pre>
+
+<p>Here is a touch screen.  Notice all of the information about the resolution of
+the device and the calibration parameters that were used.</p>
+
+<pre>
+Input Reader State
+...
+  Device 6: Melfas MMSxxx Touchscreen
+      IsExternal: false
+      Sources: 0x00001002
+      KeyboardType: 0
+      Motion Ranges:
+        X: source=0x00001002, min=0.000, max=719.001, flat=0.000, fuzz=0.999
+        Y: source=0x00001002, min=0.000, max=1279.001, flat=0.000, fuzz=0.999
+        PRESSURE: source=0x00001002, min=0.000, max=1.000, flat=0.000, fuzz=0.000
+        SIZE: source=0x00001002, min=0.000, max=1.000, flat=0.000, fuzz=0.000
+        TOUCH_MAJOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
+        TOUCH_MINOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
+        TOOL_MAJOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
+        TOOL_MINOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
+      Touch Input Mapper:
+        Parameters:
+          GestureMode: spots
+          DeviceType: touchScreen
+          AssociatedDisplay: id=0, isExternal=false
+          OrientationAware: true
+        Raw Touch Axes:
+          X: min=0, max=720, flat=0, fuzz=0, resolution=0
+          Y: min=0, max=1280, flat=0, fuzz=0, resolution=0
+          Pressure: min=0, max=255, flat=0, fuzz=0, resolution=0
+          TouchMajor: min=0, max=30, flat=0, fuzz=0, resolution=0
+          TouchMinor: unknown range
+          ToolMajor: unknown range
+          ToolMinor: unknown range
+          Orientation: unknown range
+          Distance: unknown range
+          TiltX: unknown range
+          TiltY: unknown range
+          TrackingId: min=0, max=65535, flat=0, fuzz=0, resolution=0
+          Slot: min=0, max=9, flat=0, fuzz=0, resolution=0
+        Calibration:
+          touch.size.calibration: diameter
+          touch.size.scale: 10.000
+          touch.size.bias: 0.000
+          touch.size.isSummed: false
+          touch.pressure.calibration: amplitude
+          touch.pressure.scale: 0.005
+          touch.orientation.calibration: none
+          touch.distance.calibration: none
+        SurfaceWidth: 720px
+        SurfaceHeight: 1280px
+        SurfaceOrientation: 0
+        Translation and Scaling Factors:
+          XScale: 0.999
+          YScale: 0.999
+          XPrecision: 1.001
+          YPrecision: 1.001
+          GeometricScale: 0.999
+          PressureScale: 0.005
+          SizeScale: 0.033
+          OrientationCenter: 0.000
+          OrientationScale: 0.000
+          DistanceScale: 0.000
+          HaveTilt: false
+          TiltXCenter: 0.000
+          TiltXScale: 0.000
+          TiltYCenter: 0.000
+          TiltYScale: 0.000
+        Last Button State: 0x00000000
+        Last Raw Touch: pointerCount=0
+        Last Cooked Touch: pointerCount=0
+</pre>
+
+<p>Here is an external keyboard / mouse combo HID device.  (This device doesn't actually
+have a mouse but its HID descriptor says it does.)</p>
+
+<pre><code>  Device 7: Motorola Bluetooth Wireless Keyboard
+    IsExternal: true
+    Sources: 0x00002103
+    KeyboardType: 2
+    Motion Ranges:
+      X: source=0x00002002, min=0.000, max=719.000, flat=0.000, fuzz=0.000
+      Y: source=0x00002002, min=0.000, max=1279.000, flat=0.000, fuzz=0.000
+      PRESSURE: source=0x00002002, min=0.000, max=1.000, flat=0.000, fuzz=0.000
+      VSCROLL: source=0x00002002, min=-1.000, max=1.000, flat=0.000, fuzz=0.000
+    Keyboard Input Mapper:
+      Parameters:
+        AssociatedDisplayId: -1
+        OrientationAware: false
+      KeyboardType: 2
+      Orientation: 0
+      KeyDowns: 0 keys currently down
+      MetaState: 0x0
+      DownTime: 75868832946000
+    Cursor Input Mapper:
+      Parameters:
+        AssociatedDisplayId: 0
+        Mode: pointer
+        OrientationAware: false
+      XScale: 1.000
+      YScale: 1.000
+      XPrecision: 1.000
+      YPrecision: 1.000
+      HaveVWheel: true
+      HaveHWheel: false
+      VWheelScale: 1.000
+      HWheelScale: 1.000
+      Orientation: 0
+      ButtonState: 0x00000000
+      Down: false
+      DownTime: 0
+</code></pre>
+<p>Here is a joystick.  Notice how all of the axes have been scaled to a normalized
+range.  The axis mapping can be configured using key layout files.</p>
+<pre><code>Device 18: Logitech Logitech Cordless RumblePad 2
+    IsExternal: true
+    Sources: 0x01000511
+    KeyboardType: 1
+    Motion Ranges:
+      X: source=0x01000010, min=-1.000, max=1.000, flat=0.118, fuzz=0.000
+      Y: source=0x01000010, min=-1.000, max=1.000, flat=0.118, fuzz=0.000
+      Z: source=0x01000010, min=-1.000, max=1.000, flat=0.118, fuzz=0.000
+      RZ: source=0x01000010, min=-1.000, max=1.000, flat=0.118, fuzz=0.000
+      HAT_X: source=0x01000010, min=-1.000, max=1.000, flat=0.000, fuzz=0.000
+      HAT_Y: source=0x01000010, min=-1.000, max=1.000, flat=0.000, fuzz=0.000
+    Keyboard Input Mapper:
+      Parameters:
+        AssociatedDisplayId: -1
+        OrientationAware: false
+      KeyboardType: 1
+      Orientation: 0
+      KeyDowns: 0 keys currently down
+      MetaState: 0x0
+      DownTime: 675270841000
+    Joystick Input Mapper:
+      Axes:
+        X: min=-1.00000, max=1.00000, flat=0.11765, fuzz=0.00000
+          scale=0.00784, offset=-1.00000, highScale=0.00784, highOffset=-1.00000
+          rawAxis=0, rawMin=0, rawMax=255, rawFlat=15, rawFuzz=0, rawResolution=0
+        Y: min=-1.00000, max=1.00000, flat=0.11765, fuzz=0.00000
+          scale=0.00784, offset=-1.00000, highScale=0.00784, highOffset=-1.00000
+          rawAxis=1, rawMin=0, rawMax=255, rawFlat=15, rawFuzz=0, rawResolution=0
+        Z: min=-1.00000, max=1.00000, flat=0.11765, fuzz=0.00000
+          scale=0.00784, offset=-1.00000, highScale=0.00784, highOffset=-1.00000
+          rawAxis=2, rawMin=0, rawMax=255, rawFlat=15, rawFuzz=0, rawResolution=0
+        RZ: min=-1.00000, max=1.00000, flat=0.11765, fuzz=0.00000
+          scale=0.00784, offset=-1.00000, highScale=0.00784, highOffset=-1.00000
+          rawAxis=5, rawMin=0, rawMax=255, rawFlat=15, rawFuzz=0, rawResolution=0
+        HAT_X: min=-1.00000, max=1.00000, flat=0.00000, fuzz=0.00000
+          scale=1.00000, offset=0.00000, highScale=1.00000, highOffset=0.00000
+          rawAxis=16, rawMin=-1, rawMax=1, rawFlat=0, rawFuzz=0, rawResolution=0
+        HAT_Y: min=-1.00000, max=1.00000, flat=0.00000, fuzz=0.00000
+          scale=1.00000, offset=0.00000, highScale=1.00000, highOffset=0.00000
+          rawAxis=17, rawMin=-1, rawMax=1, rawFlat=0, rawFuzz=0, rawResolution=0
+</code></pre>
+<p>At the end of the input reader dump there is some information about global configuration
+parameters such as the mouse pointer speed.</p>
+<pre><code>  Configuration:
+    ExcludedDeviceNames: []
+    VirtualKeyQuietTime: 0.0ms
+    PointerVelocityControlParameters: scale=1.000, lowThreshold=500.000, highThreshold=3000.000, acceleration=3.000
+    WheelVelocityControlParameters: scale=1.000, lowThreshold=15.000, highThreshold=50.000, acceleration=4.000
+    PointerGesture:
+      Enabled: true
+      QuietInterval: 100.0ms
+      DragMinSwitchSpeed: 50.0px/s
+      TapInterval: 150.0ms
+      TapDragInterval: 300.0ms
+      TapSlop: 20.0px
+      MultitouchSettleInterval: 100.0ms
+      MultitouchMinDistance: 15.0px
+      SwipeTransitionAngleCosine: 0.3
+      SwipeMaxWidthRatio: 0.2
+      MovementSpeedRatio: 0.8
+      ZoomSpeedRatio: 0.3
+</code></pre>
+<h4 id="things-to-look-for_1">Things To Look For</h4>
+<ol>
+<li>
+<p>All of the expected input devices are present.</p>
+</li>
+<li>
+<p>Each input device has been configured appropriately.  Especially check the
+    touch screen and joystick axes.</p>
+</li>
+</ol>
+<h3 id="input-dispatcher-state">Input Dispatcher State</h3>
+<p>The <code>InputDispatcher</code> is responsible for sending input events to applications.
+Its state dump shows information about which window is being touched, the
+state of the input queue, whether an ANR is in progress, and so on.</p>
+<pre>
+Input Dispatcher State:
+  DispatchEnabled: 1
+  DispatchFrozen: 0
+  FocusedApplication: &lt;null&gt;
+  FocusedWindow: name='Window{3fb06dc3 u0 StatusBar}'
+  TouchStates: &lt;no displays touched&gt;
+  Windows:
+    0: name='Window{357bbbfe u0 SearchPanel}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01820100, type=0x000007e8, layer=211000, frame=[0,0][1080,1920], scale=1.000000, touchableRegion=[0,0][1080,1920], inputFeatures=0x00000000, ownerPid=22674, ownerUid=10020, dispatchingTimeout=5000.000ms
+    1: name='Window{3b14c0ca u0 NavigationBar}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01840068, type=0x000007e3, layer=201000, frame=[0,1776][1080,1920], scale=1.000000, touchableRegion=[0,1776][1080,1920], inputFeatures=0x00000000, ownerPid=22674, ownerUid=10020, dispatchingTimeout=5000.000ms
+    2: name='Window{2c7e849c u0 com.vito.lux}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys=false, flags=0x0089031a, type=0x000007d6, layer=191000, frame=[-495,-147][1575,1923], scale=1.000000, touchableRegion=[-495,-147][1575,1923], inputFeatures=0x00000000, ownerPid=4697, ownerUid=10084, dispatchingTimeout=5000.000ms
+    3: name='Window{31c9f22 u0 Heads Up}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01820328, type=0x000007de, layer=161000, frame=[0,0][1794,750], scale=1.000000, touchableRegion=[0,0][1794,192], inputFeatures=0x00000000, ownerPid=22674, ownerUid=10020, dispatchingTimeout=5000.000ms
+    4: name='Window{3fb06dc3 u0 StatusBar}', displayId=0, paused=false, hasFocus=true, hasWallpaper=false, visible=true, canReceiveKeys=true, flags=0x81960040, type=0x000007d0, layer=151000, frame=[0,0][1080,1920], scale=1.000000, touchableRegion=[0,0][1080,1920], inputFeatures=0x00000004, ownerPid=22674, ownerUid=10020, dispatchingTimeout=5000.000ms
+    5: name='Window{278c1d65 u0 KeyguardScrim}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01110900, type=0x000007ed, layer=131000, frame=[0,0][1080,1776], scale=1.000000, touchableRegion=[0,0][1080,1776], inputFeatures=0x00000000, ownerPid=745, ownerUid=1000, dispatchingTimeout=5000.000ms
+    6: name='Window{869f213 u0 com.android.systemui.ImageWallpaper}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys=false, flags=0x00000318, type=0x000007dd, layer=21025, frame=[0,0][2328,1920], scale=1.000000, touchableRegion=[0,0][2328,1920], inputFeatures=0x00000000, ownerPid=22674, ownerUid=10020, dispatchingTimeout=5000.000ms
+    7: name='Window{16ab6320 u0 InputMethod}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01800108, type=0x000007db, layer=21020, frame=[0,75][1080,1920], scale=1.000000, touchableRegion=[0,986][1080,1920], inputFeatures=0x00000000, ownerPid=8409, ownerUid=10056, dispatchingTimeout=5000.000ms
+    8: name='Window{cf4ff0b u0 com.google.android.googlequicksearchbox/com.google.android.launcher.GEL}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x81910120, type=0x00000001, layer=21015, frame=[0,0][1080,1920], scale=1.000000, touchableRegion=[0,0][1080,1920], inputFeatures=0x00000000, ownerPid=14722, ownerUid=10022, dispatchingTimeout=5000.000ms
+    9: name='Window{1a7be08a u0 com.android.systemui/com.android.systemui.recents.RecentsActivity EXITING}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x81910120, type=0x00000001, layer=21010, frame=[0,0][1080,1920], scale=1.000000, touchableRegion=[0,0][1080,1920], inputFeatures=0x00000000, ownerPid=22674, ownerUid=10020, dispatchingTimeout=5000.000ms
+    10: name='Window{2280455f u0 com.google.android.gm/com.google.android.gm.ConversationListActivityGmail}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x81810120, type=0x00000001, layer=21005, frame=[0,0][1080,1920], scale=1.000000, touchableRegion=[0,0][1080,1920], inputFeatures=0x00000000, ownerPid=9897, ownerUid=10070, dispatchingTimeout=5000.000ms
+    11: name='Window{657fee5 u0 com.mobilityware.freecell/com.mobilityware.freecell.FreeCell}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01810520, type=0x00000001, layer=21000, frame=[0,0][1080,1776], scale=1.000000, touchableRegion=[0,0][1080,1920], inputFeatures=0x00000000, ownerPid=3189, ownerUid=10085, dispatchingTimeout=5000.000ms
+  MonitoringChannels:
+    0: 'WindowManager (server)'
+  RecentQueue: length=10
+    MotionEvent(deviceId=4, source=0x00001002, action=2, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (335.0, 1465.0)]), policyFlags=0x62000000, age=217264.0ms
+    MotionEvent(deviceId=4, source=0x00001002, action=1, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (335.0, 1465.0)]), policyFlags=0x62000000, age=217255.7ms
+    MotionEvent(deviceId=4, source=0x00001002, action=0, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (330.0, 1283.0)]), policyFlags=0x62000000, age=216805.0ms
+    MotionEvent(deviceId=4, source=0x00001002, action=2, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (330.0, 1287.0)]), policyFlags=0x62000000, age=216788.3ms
+    MotionEvent(deviceId=4, source=0x00001002, action=2, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (331.0, 1297.0)]), policyFlags=0x62000000, age=216780.0ms
+    MotionEvent(deviceId=4, source=0x00001002, action=2, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (332.0, 1316.0)]), policyFlags=0x62000000, age=216771.6ms
+    MotionEvent(deviceId=4, source=0x00001002, action=2, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (333.0, 1340.0)]), policyFlags=0x62000000, age=216763.3ms
+    MotionEvent(deviceId=4, source=0x00001002, action=2, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (333.0, 1362.0)]), policyFlags=0x62000000, age=216755.0ms
+    MotionEvent(deviceId=4, source=0x00001002, action=2, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (332.0, 1384.0)]), policyFlags=0x62000000, age=216747.2ms
+    MotionEvent(deviceId=4, source=0x00001002, action=1, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (332.0, 1384.0)]), policyFlags=0x62000000, age=216738.9ms
+  PendingEvent: &lt;none&gt;
+  InboundQueue: &lt;empty&gt;
+  ReplacedKeys: &lt;empty&gt;
+  Connections:
+    0: channelName='WindowManager (server)', windowName='monitor', status=NORMAL, monitor=true, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    1: channelName='278c1d65 KeyguardScrim (server)', windowName='Window{278c1d65 u0 KeyguardScrim}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    2: channelName='357bbbfe SearchPanel (server)', windowName='Window{357bbbfe u0 SearchPanel}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    3: channelName='869f213 com.android.systemui.ImageWallpaper (server)', windowName='Window{869f213 u0 com.android.systemui.ImageWallpaper}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    4: channelName='3fb06dc3 StatusBar (server)', windowName='Window{3fb06dc3 u0 StatusBar}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    5: channelName='2c7e849c  (server)', windowName='Window{2c7e849c u0 com.vito.lux}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    6: channelName='cf4ff0b com.google.android.googlequicksearchbox/com.google.android.launcher.GEL (server)', windowName='Window{cf4ff0b 
+u0 com.google.android.googlequicksearchbox/com.google.android.launcher.GEL}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    7: channelName='2280455f com.google.android.gm/com.google.android.gm.ConversationListActivityGmail (server)', windowName='Window{2280455f u0 com.google.android.gm/com.google.android.gm.ConversationListActivityGmail}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    8: channelName='1a7be08a com.android.systemui/com.android.systemui.recents.RecentsActivity (server)', windowName='Window{1a7be08a u0 com.android.systemui/com.android.systemui.recents.RecentsActivity EXITING}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    9: channelName='3b14c0ca NavigationBar (server)', windowName='Window{3b14c0ca u0 NavigationBar}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    10: channelName='16ab6320 InputMethod (server)', windowName='Window{16ab6320 u0 InputMethod}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    11: channelName='657fee5 com.mobilityware.freecell/com.mobilityware.freecell.FreeCell (server)', windowName='Window{657fee5 u0 com.mobilityware.freecell/com.mobilityware.freecell.FreeCell}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    12: channelName='31c9f22 Heads Up (server)', windowName='Window{31c9f22 u0 Heads Up}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+  AppSwitch: not pending
+    7: channelName='2280455f com.google.android.gm/com.google.android.gm.ConversationListActivityGmail (server)', windowName='Window{2280455f u0 com.google.android.gm/com.google.android.gm.ConversationListActivityGmail}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    8: channelName='1a7be08a com.android.systemui/com.android.systemui.recents.RecentsActivity (server)', windowName='Window{1a7be08a u0 com.android.systemui/com.android.systemui.recents.RecentsActivity EXITING}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    9: channelName='3b14c0ca NavigationBar (server)', windowName='Window{3b14c0ca u0 NavigationBar}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    10: channelName='16ab6320 InputMethod (server)', windowName='Window{16ab6320 u0 InputMethod}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    11: channelName='657fee5 com.mobilityware.freecell/com.mobilityware.freecell.FreeCell (server)', windowName='Window{657fee5 u0 com.mobilityware.freecell/com.mobilityware.freecell.FreeCell}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+    12: channelName='31c9f22 Heads Up (server)', windowName='Window{31c9f22 u0 Heads Up}', status=NORMAL, monitor=false, inputPublisherBlocked=false
+      OutboundQueue: &lt;empty&gt;
+      WaitQueue: &lt;empty&gt;
+  AppSwitch: not pending
+  Configuration:
+    KeyRepeatDelay: 50.0ms
+    KeyRepeatTimeout: 500.0ms
+</pre>
+<h4 id="things-to-look-for_2">Things To Look For</h4>
+<ol>
+  <li> In general, all input events are being processed as expected.  </li>
+  <li> If you touch the touch screen and run dumpsys at the same time,
+  then the <code>TouchStates</code> line should show the window that
+  you are touching.  </li>
+</ol>
+
diff --git a/src/devices/input/dumpsys.jd b/src/devices/input/dumpsys.jd
deleted file mode 100644
index 21ae764..0000000
--- a/src/devices/input/dumpsys.jd
+++ /dev/null
@@ -1,344 +0,0 @@
-page.title=Dumpsys
-@jd:body
-
-<!--
-    Copyright 2013 The Android Open Source Project
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-<p>The <code>dumpsys</code> tool runs on the device and dumps interesting information
-about the status of system services.</p>
-<h2 id="usage">Usage</h2>
-<p>The input system is part of the window manager.  To dump its state,
-run the following command.</p>
-<pre><code>$ adb shell su -- dumpsys window
-
-WINDOW MANAGER INPUT (dumpsys window input)
-Event Hub State:
-  BuiltInKeyboardId: -1
-  Devices:
-...
-</code></pre>
-<p>The set of information that is reported varies depending on the version of Android.</p>
-<h3 id="event-hub-state">Event Hub State</h3>
-<p>The <code>EventHub</code> component is responsible for communicating with the kernel device
-drivers and identifying device capabilities.  Accordingly, its state shows
-information about how devices are configured.</p>
-<pre><code>Event Hub State:
-  BuiltInKeyboardId: -1
-  Devices:
-    3: tuna-gpio-keypad
-      Classes: 0x00000001
-      Path: /dev/input/event2
-      Location:
-      UniqueId:
-      Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
-      KeyLayoutFile: /system/usr/keylayout/tuna-gpio-keypad.kl
-      KeyCharacterMapFile: /system/usr/keychars/tuna-gpio-keypad.kcm
-      ConfigurationFile:
-    5: Tuna Headset Jack
-      Classes: 0x00000080
-      Path: /dev/input/event5
-      Location: ALSA
-      UniqueId:
-      Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
-      KeyLayoutFile:
-      KeyCharacterMapFile:
-      ConfigurationFile:
-    6: Melfas MMSxxx Touchscreen
-      Classes: 0x00000014
-      Path: /dev/input/event1
-      Location: 3-0048/input0
-      UniqueId:
-      Identifier: bus=0x0018, vendor=0x0000, product=0x0000, version=0x0000
-      KeyLayoutFile:
-      KeyCharacterMapFile:
-      ConfigurationFile: /system/usr/idc/Melfas_MMSxxx_Touchscreen.idc
-    7: Motorola Bluetooth Wireless Keyboard
-      Classes: 0x8000000b
-      Path: /dev/input/event6
-      Location: 0C:DF:A4:B3:2D:BA
-      UniqueId: 00:0F:F6:80:02:CD
-      Identifier: bus=0x0005, vendor=0x22b8, product=0x093d, version=0x0288
-      KeyLayoutFile: /system/usr/keylayout/Vendor_22b8_Product_093d.kl
-      KeyCharacterMapFile: /system/usr/keychars/Generic.kcm
-      ConfigurationFile:
-</code></pre>
-<h4 id="things-to-look-for">Things To Look For</h4>
-<ol>
-<li>
-<p>All of the expected input devices are present.</p>
-</li>
-<li>
-<p>Each input device has an appropriate key layout file, key character map file
-    and input device configuration file.  If the files are missing or contain
-    syntax errors, then they will not be loaded.</p>
-</li>
-<li>
-<p>Each input device is being classified correctly.  The bits in the <code>Classes</code>
-    field correspond to flags in <code>EventHub.h</code> such as <code>INPUT_DEVICE_CLASS_TOUCH_MT</code>.</p>
-</li>
-<li>
-<p>The <code>BuiltInKeyboardId</code> is correct.  If the device does not have a built-in keyboard,
-    then the id must be <code>-1</code>, otherwise it should be the id of the built-in keyboard.</p>
-<p>If you observe that the <code>BuiltInKeyboardId</code> is not <code>-1</code> but it should be, then
-you are missing a key character map file for a special function keypad somewhere.
-Special function keypad devices should have key character map files that contain
-just the line <code>type SPECIAL_FUNCTION</code> (that's what in the <code>tuna-gpio-keykad.kcm</code>
-file we see mentioned above).</p>
-</li>
-</ol>
-<h3 id="input-reader-state">Input Reader State</h3>
-<p>The <code>InputReader</code> is responsible for decoding input events from the kernel.
-Its state dump shows information about how each input device is configured
-and recent state changes that occurred, such as key presses or touches on
-the touch screen.</p>
-<p>This is what a special function keypad looks like:</p>
-<pre><code>Input Reader State:
-  Device 3: tuna-gpio-keypad
-    IsExternal: false
-    Sources: 0x00000101
-    KeyboardType: 1
-    Keyboard Input Mapper:
-      Parameters:
-        AssociatedDisplayId: -1
-        OrientationAware: false
-      KeyboardType: 1
-      Orientation: 0
-      KeyDowns: 0 keys currently down
-      MetaState: 0x0
-      DownTime: 75816923828000
-</code></pre>
-<p>Here is a touch screen.  Notice all of the information about the resolution of
-the device and the calibration parameters that were used.</p>
-<pre><code>  Device 6: Melfas MMSxxx Touchscreen
-    IsExternal: false
-    Sources: 0x00001002
-    KeyboardType: 0
-    Motion Ranges:
-      X: source=0x00001002, min=0.000, max=719.001, flat=0.000, fuzz=0.999
-      Y: source=0x00001002, min=0.000, max=1279.001, flat=0.000, fuzz=0.999
-      PRESSURE: source=0x00001002, min=0.000, max=1.000, flat=0.000, fuzz=0.000
-      SIZE: source=0x00001002, min=0.000, max=1.000, flat=0.000, fuzz=0.000
-      TOUCH_MAJOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
-      TOUCH_MINOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
-      TOOL_MAJOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
-      TOOL_MINOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
-    Touch Input Mapper:
-      Parameters:
-        GestureMode: spots
-        DeviceType: touchScreen
-        AssociatedDisplay: id=0, isExternal=false
-        OrientationAware: true
-      Raw Touch Axes:
-        X: min=0, max=720, flat=0, fuzz=0, resolution=0
-        Y: min=0, max=1280, flat=0, fuzz=0, resolution=0
-        Pressure: min=0, max=255, flat=0, fuzz=0, resolution=0
-        TouchMajor: min=0, max=30, flat=0, fuzz=0, resolution=0
-        TouchMinor: unknown range
-        ToolMajor: unknown range
-        ToolMinor: unknown range
-        Orientation: unknown range
-        Distance: unknown range
-        TiltX: unknown range
-        TiltY: unknown range
-        TrackingId: min=0, max=65535, flat=0, fuzz=0, resolution=0
-        Slot: min=0, max=9, flat=0, fuzz=0, resolution=0
-      Calibration:
-        touch.size.calibration: diameter
-        touch.size.scale: 10.000
-        touch.size.bias: 0.000
-        touch.size.isSummed: false
-        touch.pressure.calibration: amplitude
-        touch.pressure.scale: 0.005
-        touch.orientation.calibration: none
-        touch.distance.calibration: none
-      SurfaceWidth: 720px
-      SurfaceHeight: 1280px
-      SurfaceOrientation: 0
-      Translation and Scaling Factors:
-        XScale: 0.999
-        YScale: 0.999
-        XPrecision: 1.001
-        YPrecision: 1.001
-        GeometricScale: 0.999
-        PressureScale: 0.005
-        SizeScale: 0.033
-        OrientationCenter: 0.000
-        OrientationScale: 0.000
-        DistanceScale: 0.000
-        HaveTilt: false
-        TiltXCenter: 0.000
-        TiltXScale: 0.000
-        TiltYCenter: 0.000
-        TiltYScale: 0.000
-      Last Button State: 0x00000000
-      Last Raw Touch: pointerCount=0
-      Last Cooked Touch: pointerCount=0
-</code></pre>
-<p>Here is an external keyboard / mouse combo HID device.  (This device doesn't actually
-have a mouse but its HID descriptor says it does.)</p>
-<pre><code>  Device 7: Motorola Bluetooth Wireless Keyboard
-    IsExternal: true
-    Sources: 0x00002103
-    KeyboardType: 2
-    Motion Ranges:
-      X: source=0x00002002, min=0.000, max=719.000, flat=0.000, fuzz=0.000
-      Y: source=0x00002002, min=0.000, max=1279.000, flat=0.000, fuzz=0.000
-      PRESSURE: source=0x00002002, min=0.000, max=1.000, flat=0.000, fuzz=0.000
-      VSCROLL: source=0x00002002, min=-1.000, max=1.000, flat=0.000, fuzz=0.000
-    Keyboard Input Mapper:
-      Parameters:
-        AssociatedDisplayId: -1
-        OrientationAware: false
-      KeyboardType: 2
-      Orientation: 0
-      KeyDowns: 0 keys currently down
-      MetaState: 0x0
-      DownTime: 75868832946000
-    Cursor Input Mapper:
-      Parameters:
-        AssociatedDisplayId: 0
-        Mode: pointer
-        OrientationAware: false
-      XScale: 1.000
-      YScale: 1.000
-      XPrecision: 1.000
-      YPrecision: 1.000
-      HaveVWheel: true
-      HaveHWheel: false
-      VWheelScale: 1.000
-      HWheelScale: 1.000
-      Orientation: 0
-      ButtonState: 0x00000000
-      Down: false
-      DownTime: 0
-</code></pre>
-<p>Here is a joystick.  Notice how all of the axes have been scaled to a normalized
-range.  The axis mapping can be configured using key layout files.</p>
-<pre><code>Device 18: Logitech Logitech Cordless RumblePad 2
-    IsExternal: true
-    Sources: 0x01000511
-    KeyboardType: 1
-    Motion Ranges:
-      X: source=0x01000010, min=-1.000, max=1.000, flat=0.118, fuzz=0.000
-      Y: source=0x01000010, min=-1.000, max=1.000, flat=0.118, fuzz=0.000
-      Z: source=0x01000010, min=-1.000, max=1.000, flat=0.118, fuzz=0.000
-      RZ: source=0x01000010, min=-1.000, max=1.000, flat=0.118, fuzz=0.000
-      HAT_X: source=0x01000010, min=-1.000, max=1.000, flat=0.000, fuzz=0.000
-      HAT_Y: source=0x01000010, min=-1.000, max=1.000, flat=0.000, fuzz=0.000
-    Keyboard Input Mapper:
-      Parameters:
-        AssociatedDisplayId: -1
-        OrientationAware: false
-      KeyboardType: 1
-      Orientation: 0
-      KeyDowns: 0 keys currently down
-      MetaState: 0x0
-      DownTime: 675270841000
-    Joystick Input Mapper:
-      Axes:
-        X: min=-1.00000, max=1.00000, flat=0.11765, fuzz=0.00000
-          scale=0.00784, offset=-1.00000, highScale=0.00784, highOffset=-1.00000
-          rawAxis=0, rawMin=0, rawMax=255, rawFlat=15, rawFuzz=0, rawResolution=0
-        Y: min=-1.00000, max=1.00000, flat=0.11765, fuzz=0.00000
-          scale=0.00784, offset=-1.00000, highScale=0.00784, highOffset=-1.00000
-          rawAxis=1, rawMin=0, rawMax=255, rawFlat=15, rawFuzz=0, rawResolution=0
-        Z: min=-1.00000, max=1.00000, flat=0.11765, fuzz=0.00000
-          scale=0.00784, offset=-1.00000, highScale=0.00784, highOffset=-1.00000
-          rawAxis=2, rawMin=0, rawMax=255, rawFlat=15, rawFuzz=0, rawResolution=0
-        RZ: min=-1.00000, max=1.00000, flat=0.11765, fuzz=0.00000
-          scale=0.00784, offset=-1.00000, highScale=0.00784, highOffset=-1.00000
-          rawAxis=5, rawMin=0, rawMax=255, rawFlat=15, rawFuzz=0, rawResolution=0
-        HAT_X: min=-1.00000, max=1.00000, flat=0.00000, fuzz=0.00000
-          scale=1.00000, offset=0.00000, highScale=1.00000, highOffset=0.00000
-          rawAxis=16, rawMin=-1, rawMax=1, rawFlat=0, rawFuzz=0, rawResolution=0
-        HAT_Y: min=-1.00000, max=1.00000, flat=0.00000, fuzz=0.00000
-          scale=1.00000, offset=0.00000, highScale=1.00000, highOffset=0.00000
-          rawAxis=17, rawMin=-1, rawMax=1, rawFlat=0, rawFuzz=0, rawResolution=0
-</code></pre>
-<p>At the end of the input reader dump there is some information about global configuration
-parameters such as the mouse pointer speed.</p>
-<pre><code>  Configuration:
-    ExcludedDeviceNames: []
-    VirtualKeyQuietTime: 0.0ms
-    PointerVelocityControlParameters: scale=1.000, lowThreshold=500.000, highThreshold=3000.000, acceleration=3.000
-    WheelVelocityControlParameters: scale=1.000, lowThreshold=15.000, highThreshold=50.000, acceleration=4.000
-    PointerGesture:
-      Enabled: true
-      QuietInterval: 100.0ms
-      DragMinSwitchSpeed: 50.0px/s
-      TapInterval: 150.0ms
-      TapDragInterval: 300.0ms
-      TapSlop: 20.0px
-      MultitouchSettleInterval: 100.0ms
-      MultitouchMinDistance: 15.0px
-      SwipeTransitionAngleCosine: 0.3
-      SwipeMaxWidthRatio: 0.2
-      MovementSpeedRatio: 0.8
-      ZoomSpeedRatio: 0.3
-</code></pre>
-<h4 id="things-to-look-for_1">Things To Look For</h4>
-<ol>
-<li>
-<p>All of the expected input devices are present.</p>
-</li>
-<li>
-<p>Each input device has been configured appropriately.  Especially check the
-    touch screen and joystick axes.</p>
-</li>
-</ol>
-<h3 id="input-dispatcher-state">Input Dispatcher State</h3>
-<p>The <code>InputDispatcher</code> is responsible for sending input events to applications.
-Its state dump shows information about which window is being touched, the
-state of the input queue, whether an ANR is in progress, and so on.</p>
-<pre><code>Input Dispatcher State:
-  DispatchEnabled: 1
-  DispatchFrozen: 0
-  FocusedApplication: name='AppWindowToken{41b03a10 token=Token{41bdcf78 ActivityRecord{418ab728 com.android.settings/.Settings}}}', dispatchingTimeout=5000.000ms
-  FocusedWindow: name='Window{41908458 Keyguard paused=false}'
-  TouchDown: false
-  TouchSplit: false
-  TouchDeviceId: -1
-  TouchSource: 0x00000000
-  TouchedWindows: &lt;none&gt;
-  Windows:
-    0: name='Window{41bd5b18 NavigationBar paused=false}', paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys=false, flags=0x05800068, type=0x000007e3, layer=181000, frame=[0,1184][720,1280], scale=1.000000, touchableRegion=[0,1184][720,1280], inputFeatures=0x00000000, ownerPid=306, ownerUid=1000, dispatchingTimeout=5000.000ms
-    1: name='Window{41a19770 RecentsPanel paused=false}', paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01820100, type=0x000007de, layer=151000, frame=[0,0][720,1184], scale=1.000000, touchableRegion=[0,0][720,1184], inputFeatures=0x00000000, ownerPid=306, ownerUid=1000, dispatchingTimeout=5000.000ms
-    2: name='Window{41a78768 StatusBar paused=false}', paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys=false, flags=0x00800048, type=0x000007d0, layer=141000, frame=[0,0][720,50], scale=1.000000, touchableRegion=[0,0][720,50], inputFeatures=0x00000000, ownerPid=306, ownerUid=1000, dispatchingTimeout=5000.000ms
-    3: name='Window{41877570 StatusBarExpanded paused=false}', paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys=false, flags=0x01811328, type=0x000007e1, layer=131005, frame=[0,-1184][720,-114], scale=1.000000, touchableRegion=[0,-1184][720,-114], inputFeatures=0x00000000, ownerPid=306, ownerUid=1000, dispatchingTimeout=5000.000ms
-    4: name='Window{41bedf20 TrackingView paused=false}', paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01020300, type=0x000007e1, layer=131000, frame=[0,-1032][720,102], scale=1.000000, touchableRegion=[0,-1032][720,102], inputFeatures=0x00000000, ownerPid=306, ownerUid=1000, dispatchingTimeout=5000.000ms
-    5: name='Window{41908458 Keyguard paused=false}', paused=false, hasFocus=true, hasWallpaper=false, visible=true, canReceiveKeys=true, flags=0x15120800, type=0x000007d4, layer=111000, frame=[0,50][720,1184], scale=1.000000, touchableRegion=[0,50][720,1184], inputFeatures=0x00000000, ownerPid=205, ownerUid=1000, dispatchingTimeout=5000.000ms
-    6: name='Window{4192cc30 com.android.phasebeam.PhaseBeamWallpaper paused=false}', paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys=false, flags=0x00000308, type=0x000007dd, layer=21010, frame=[0,0][720,1184], scale=1.000000, touchableRegion=[0,0][720,1184], inputFeatures=0x00000000, ownerPid=429, ownerUid=10046, dispatchingTimeout=5000.000ms
-    7: name='Window{41866c00 com.android.settings/com.android.settings.Settings paused=false}', paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01810100, type=0x00000001, layer=21005, frame=[0,0][720,1184], scale=1.000000, touchableRegion=[0,0][720,1184], inputFeatures=0x00000000, ownerPid=19000, ownerUid=1000, dispatchingTimeout=5000.000ms
-    8: name='Window{4197c858 com.android.launcher/com.android.launcher2.Launcher paused=false}', paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01910100, type=0x00000001, layer=21000, frame=[0,0][720,1184], scale=1.000000, touchableRegion=[0,0][720,1184], inputFeatures=0x00000000, ownerPid=515, ownerUid=10032, dispatchingTimeout=5000.000ms
-  MonitoringChannels: &lt;none&gt;
-  InboundQueue: length=0
-  ActiveConnections: &lt;none&gt;
-  AppSwitch: not pending
-  Configuration:
-    MaxEventsPerSecond: 90
-    KeyRepeatDelay: 50.0ms
-    KeyRepeatTimeout: 500.0ms
-</code></pre>
-<h4 id="things-to-look-for_2">Things To Look For</h4>
-<ol>
-<li>
-<p>In general, all input events are being processed as expected.</p>
-</li>
-<li>
-<p>If you touch the touch screen and run dumpsys at the same time, then the <code>TouchedWindows</code>
-    line should show the window that you are touching.</p>
-</li>
-</ol>
-
diff --git a/src/devices/tech/debug/dumpsys.jd b/src/devices/tech/debug/dumpsys.jd
new file mode 100644
index 0000000..959385e
--- /dev/null
+++ b/src/devices/tech/debug/dumpsys.jd
@@ -0,0 +1,105 @@
+page.title=Dumpsys System Diagnostics
+@jd:body
+
+<!--
+    Copyright 2015 The Android Open Source Project
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<div id="qv-wrapper">
+  <div id="qv">
+    <h2>In this document</h2>
+    <ol id="auto-toc">
+    </ol>
+  </div>
+</div>
+
+<p>The <code>dumpsys</code> tool runs on the device and provides information about the status
+of system services.  </p>
+
+<h2 id=how_to_use_dumpsys>How to use dumpsys</h2>
+
+<p>If you run <code>adb shell dumpsys</code>, you’ll get diagnostic output for
+all system services, which is usually more than you want.  For more manageable
+output, specify the service you would like to examine.  </p>
+
+<p>For example, the following command:</p>
+
+<pre>
+$ adb shell dumpsys input
+</pre>
+
+<p>provides system data for input components such as touchscreens or built-in
+keyboards.</p>
+
+<h2 id=list_of_system_services>List of system services</h2>
+
+
+<p>For a complete list of system services that you can use with dumpsys, try the
+following command:</p>
+
+<pre class="no-pretty-print">
+$ adb shell dumpsys -l
+Currently running services:
+  DockObserver
+  SurfaceFlinger
+  accessibility
+  account
+  activity
+  alarm
+  android.security.keystore
+  appops
+  appwidget
+  assetatlas
+  audio
+  backup
+  battery
+  batteryproperties
+  batterystats
+  bluetooth_manager
+  clipboard
+  commontime_management
+  connectivity
+  consumer_ir
+  content
+  country_detector
+  cpuinfo
+  dbinfo
+...
+</pre>
+
+<h2 id=dumpsys_command-line_options>Dumpsys command-line options</h2>
+
+<p>Command-line options are different for different services.  Here are a few
+common ones:</p>
+
+<ul>
+  <li> For many services, you can append <code>-h</code> to see the help
+text.
+  <li> For some services, you can append <code>-c</code> to view the data in
+a machine-friendly format.  </ul>
+
+<h2 id=understanding_diagnostic_output>Understanding diagnostic output</h2>
+
+<p>For details on some of the most commonly used  dumpsys services, see the
+following articles:</p>
+
+<ul>
+  <li> <a href="{@docRoot}devices/input/diagnostics.html">Input Diagnostics</a>
+<!--  To add in upcoming CLs
+  <li> <a href="{@docRoot}devices/tech/ram/procstats.html">Procstats</a>
+  <li> <a href="{@docRoot}devices/tech/power/batterystats.html">Batterystats</a>
+  <li> <a href="{@docRoot}devices/tech/datausage/netstats.html">Dumpsys Netstats</a>
+-->
+</ul>
+