Merge "Lost the race."
diff --git a/core/java/android/hardware/input/InputManager.java b/core/java/android/hardware/input/InputManager.java
index b39b823..5ba1850 100755
--- a/core/java/android/hardware/input/InputManager.java
+++ b/core/java/android/hardware/input/InputManager.java
@@ -268,6 +268,8 @@
         synchronized (mInputDevicesLock) {
             int index = findInputDeviceListenerLocked(listener);
             if (index >= 0) {
+                InputDeviceListenerDelegate d = mInputDeviceListeners.get(index);
+                d.removeCallbacksAndMessages(null);
                 mInputDeviceListeners.remove(index);
             }
         }