summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2022-01-21 08:24:35 -0800
committer Prabir Pradhan <prabirmsp@google.com> 2022-02-01 14:09:06 -0800
commitd35d4543ca81a80ce8afba8c519dddea99329856 (patch)
tree4b6b19e6fb99293baf93dfdcf7812f5259f85b05
parent16308e0a67cf7608fd6401cc4d00a9620878fc84 (diff)
InputManagerService: Remove gesture monitor implementation
Bug: 162194035 Test: manual Change-Id: I8a2649f168f76aa56e3a1cb44d85516bebfc6342
-rw-r--r--services/core/java/com/android/server/input/InputManagerService.java18
-rw-r--r--services/core/jni/com_android_server_input_InputManagerService.cpp13
2 files changed, 9 insertions, 22 deletions
diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
index bfaa7b37fa33..354d1838709d 100644
--- a/services/core/java/com/android/server/input/InputManagerService.java
+++ b/services/core/java/com/android/server/input/InputManagerService.java
@@ -150,8 +150,6 @@ public class InputManagerService extends IInputManager.Stub
static final String TAG = "InputManager";
static final boolean DEBUG = false;
- private static final boolean USE_SPY_WINDOW_GESTURE_MONITORS = true;
-
private static final String EXCLUDED_DEVICES_PATH = "etc/excluded-input-devices.xml";
private static final String PORT_ASSOCIATIONS_PATH = "etc/input-port-associations.xml";
@@ -303,7 +301,7 @@ public class InputManagerService extends IInputManager.Stub
int locationKeyCode);
private static native InputChannel nativeCreateInputChannel(long ptr, String name);
private static native InputChannel nativeCreateInputMonitor(long ptr, int displayId,
- boolean isGestureMonitor, String name, int pid);
+ String name, int pid);
private static native void nativeRemoveInputChannel(long ptr, IBinder connectionToken);
private static native void nativePilferPointers(long ptr, IBinder token);
private static native void nativeSetInputFilterEnabled(long ptr, boolean enable);
@@ -720,8 +718,7 @@ public class InputManagerService extends IInputManager.Stub
throw new IllegalArgumentException("displayId must >= 0.");
}
- return nativeCreateInputMonitor(mPtr, displayId, false /* isGestureMonitor */,
- inputChannelName, Binder.getCallingPid());
+ return nativeCreateInputMonitor(mPtr, displayId, inputChannelName, Binder.getCallingPid());
}
@NonNull
@@ -790,10 +787,7 @@ public class InputManagerService extends IInputManager.Stub
final long ident = Binder.clearCallingIdentity();
try {
final InputChannel inputChannel =
- USE_SPY_WINDOW_GESTURE_MONITORS
- ? createSpyWindowGestureMonitor(monitorToken, name, displayId, pid, uid)
- : nativeCreateInputMonitor(mPtr, displayId, true /*isGestureMonitor*/,
- requestedName, pid);
+ createSpyWindowGestureMonitor(monitorToken, name, displayId, pid, uid);
return new InputMonitor(inputChannel, new InputMonitorHost(inputChannel.getToken()));
} finally {
Binder.restoreCallingIdentity(ident);
@@ -3375,11 +3369,7 @@ public class InputManagerService extends IInputManager.Stub
@Override
public void dispose() {
- if (USE_SPY_WINDOW_GESTURE_MONITORS) {
- removeSpyWindowGestureMonitor(mInputChannelToken);
- return;
- }
- nativeRemoveInputChannel(mPtr, mInputChannelToken);
+ removeSpyWindowGestureMonitor(mInputChannelToken);
}
}
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index 8cb27e179c19..e5529f1997a3 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -265,7 +265,6 @@ public:
base::Result<std::unique_ptr<InputChannel>> createInputChannel(JNIEnv* env,
const std::string& name);
base::Result<std::unique_ptr<InputChannel>> createInputMonitor(JNIEnv* env, int32_t displayId,
- bool isGestureMonitor,
const std::string& name,
int32_t pid);
status_t removeInputChannel(JNIEnv* env, const sp<IBinder>& connectionToken);
@@ -522,11 +521,9 @@ base::Result<std::unique_ptr<InputChannel>> NativeInputManager::createInputChann
}
base::Result<std::unique_ptr<InputChannel>> NativeInputManager::createInputMonitor(
- JNIEnv* /* env */, int32_t displayId, bool isGestureMonitor, const std::string& name,
- int32_t pid) {
+ JNIEnv* /* env */, int32_t displayId, const std::string& name, int32_t pid) {
ATRACE_CALL();
- return mInputManager->getDispatcher().createInputMonitor(displayId, isGestureMonitor, name,
- pid);
+ return mInputManager->getDispatcher().createInputMonitor(displayId, name, pid);
}
status_t NativeInputManager::removeInputChannel(JNIEnv* /* env */,
@@ -1659,7 +1656,7 @@ static jobject nativeCreateInputChannel(JNIEnv* env, jclass /* clazz */, jlong p
}
static jobject nativeCreateInputMonitor(JNIEnv* env, jclass /* clazz */, jlong ptr, jint displayId,
- jboolean isGestureMonitor, jstring nameObj, jint pid) {
+ jstring nameObj, jint pid) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
if (displayId == ADISPLAY_ID_NONE) {
@@ -1672,7 +1669,7 @@ static jobject nativeCreateInputMonitor(JNIEnv* env, jclass /* clazz */, jlong p
std::string name = nameChars.c_str();
base::Result<std::unique_ptr<InputChannel>> inputChannel =
- im->createInputMonitor(env, displayId, isGestureMonitor, name, pid);
+ im->createInputMonitor(env, displayId, name, pid);
if (!inputChannel.ok()) {
std::string message = inputChannel.error().message();
@@ -2381,7 +2378,7 @@ static const JNINativeMethod gInputManagerMethods[] = {
{"nativeGetKeyCodeForKeyLocation", "(JII)I", (void*)nativeGetKeyCodeForKeyLocation},
{"nativeCreateInputChannel", "(JLjava/lang/String;)Landroid/view/InputChannel;",
(void*)nativeCreateInputChannel},
- {"nativeCreateInputMonitor", "(JIZLjava/lang/String;I)Landroid/view/InputChannel;",
+ {"nativeCreateInputMonitor", "(JILjava/lang/String;I)Landroid/view/InputChannel;",
(void*)nativeCreateInputMonitor},
{"nativeRemoveInputChannel", "(JLandroid/os/IBinder;)V", (void*)nativeRemoveInputChannel},
{"nativePilferPointers", "(JLandroid/os/IBinder;)V", (void*)nativePilferPointers},