From 15f66ce1b37cb208e1479b45ffe21b9ac2f5d8e7 Mon Sep 17 00:00:00 2001 From: Christian Petersson Date: Thu, 3 Jun 2010 11:16:39 +0200 Subject: [PATCH] Fix that InputDeviceReaderThread that got killed during startup InputDeviceReaderThread could be killed if a key or touch event was received before initiation made by PolicyThread was made. To solve this, the start call for the InputDeviceReader thread was delayed until initalization of the PolicyThread was done in the WindowManagerService. Change-Id: Ifa7de7ccfadd66ecc2b14c6273e9be32b8e0cb4a --- services/java/com/android/server/KeyInputQueue.java | 2 ++ services/java/com/android/server/WindowManagerService.java | 1 + 2 files changed, 3 insertions(+) diff --git a/services/java/com/android/server/KeyInputQueue.java b/services/java/com/android/server/KeyInputQueue.java index 1bb897b7042e5..e05c800b3e0c5 100644 --- a/services/java/com/android/server/KeyInputQueue.java +++ b/services/java/com/android/server/KeyInputQueue.java @@ -299,7 +299,9 @@ public abstract class KeyInputQueue { mLast = new QueuedEvent(); mFirst.next = mLast; mLast.prev = mFirst; + } + void start() { mThread.start(); } diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index b90b03bea7032..4bad5b486321b 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -621,6 +621,7 @@ public class WindowManagerService extends IWindowManager.Stub } mInputThread.start(); + mQueue.start(); // Add ourself to the Watchdog monitors. Watchdog.getInstance().addMonitor(this);