Fix bug with phantom input windows.

Add dumpsys integration for the native input dispatcher.
Add some InputDevice API stubs.
Add an appendFormat helper method to String8 for printf style
string formatting mainly for debugging purposes.
Use generic ArrayList<WindowState> everywhere in WindowManagerService
to eliminate unnecessary casts all over.

Change-Id: I9d1e3bd90eb7222d10620200477f11b7bfd25e44
This commit is contained in:
Jeff Brown
2010-07-15 23:54:05 -07:00
parent bd623daff1
commit e33348ba54
9 changed files with 539 additions and 147 deletions

View File

@@ -56,8 +56,6 @@ public class InputManager {
private final Callbacks mCallbacks;
private final Context mContext;
private final WindowManagerService mWindowManagerService;
private final PowerManager mPowerManager;
private final PowerManagerService mPowerManagerService;
private int mTouchScreenConfig;
private int mKeyboardConfig;
@@ -85,6 +83,7 @@ public class InputManager {
private static native void nativeSetInputDispatchMode(boolean enabled, boolean frozen);
private static native void nativeSetFocusedApplication(InputApplication application);
private static native void nativePreemptInputDispatch();
private static native String nativeDump();
// Device class as defined by EventHub.
private static final int CLASS_KEYBOARD = 0x00000001;
@@ -100,14 +99,9 @@ public class InputManager {
static final int INPUT_EVENT_INJECTION_FAILED = 2;
static final int INPUT_EVENT_INJECTION_TIMED_OUT = 3;
public InputManager(Context context,
WindowManagerService windowManagerService,
PowerManager powerManager,
PowerManagerService powerManagerService) {
public InputManager(Context context, WindowManagerService windowManagerService) {
this.mContext = context;
this.mWindowManagerService = windowManagerService;
this.mPowerManager = powerManager;
this.mPowerManagerService = powerManagerService;
this.mCallbacks = new Callbacks();
@@ -297,7 +291,10 @@ public class InputManager {
}
public void dump(PrintWriter pw) {
// TODO
String dumpStr = nativeDump();
if (dumpStr != null) {
pw.println(dumpStr);
}
}
private static final class VirtualKeyDefinition {