Added more robust tracking and cancelation of events.
This change fixes several issues where events would be dropped in the
input dispatch pipeline in such a way that the dispatcher could not
accurately track the state of the input device.
Given more robust tracking, we can now also provide robust cancelation
of input events in cases where an application might otherwise become
out of sync with the event stream due to ANR, app switch, policy decisions,
or forced focus transitions.
Pruned some of the input dispatcher log output.
Moved the responsibility for calling intercept*BeforeQueueing into
the input dispatcher instead of the input reader and added support for
early interception of injected events for events coming from trusted
sources. This enables behaviors like injection of media keys while
the screen is off, haptic feedback of injected virtual keys, so injected
events become more "first class" in a way.
Change-Id: Iec6ff1dd21e5f3c7feb80ea4feb5382bd090dbd9
diff --git a/services/java/com/android/server/InputManager.java b/services/java/com/android/server/InputManager.java
index 29ca9a4..ed1243a 100644
--- a/services/java/com/android/server/InputManager.java
+++ b/services/java/com/android/server/InputManager.java
@@ -49,6 +49,8 @@
public class InputManager {
static final String TAG = "InputManager";
+ private static final boolean DEBUG = false;
+
private final Callbacks mCallbacks;
private final Context mContext;
private final WindowManagerService mWindowManagerService;
@@ -129,7 +131,9 @@
throw new IllegalArgumentException("Invalid display id or dimensions.");
}
- Slog.i(TAG, "Setting display #" + displayId + " size to " + width + "x" + height);
+ if (DEBUG) {
+ Slog.d(TAG, "Setting display #" + displayId + " size to " + width + "x" + height);
+ }
nativeSetDisplaySize(displayId, width, height);
}
@@ -138,7 +142,9 @@
throw new IllegalArgumentException("Invalid rotation.");
}
- Slog.i(TAG, "Setting display #" + displayId + " orientation to " + rotation);
+ if (DEBUG) {
+ Slog.d(TAG, "Setting display #" + displayId + " orientation to " + rotation);
+ }
nativeSetDisplayOrientation(displayId, rotation);
}