diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java index 50e50bc7356bb..a207a96f46635 100644 --- a/services/core/java/com/android/server/input/InputManagerService.java +++ b/services/core/java/com/android/server/input/InputManagerService.java @@ -235,10 +235,6 @@ public class InputManagerService extends IInputManager.Stub IInputFilter mInputFilter; // guarded by mInputFilterLock InputFilterHost mInputFilterHost; // guarded by mInputFilterLock - private final Object mGestureMonitorPidsLock = new Object(); - @GuardedBy("mGestureMonitorPidsLock") - private final ArrayMap mGestureMonitorPidsByToken = new ArrayMap<>(); - // The associations of input devices to displays by port. Maps from input device port (String) // to display id (int). Currently only accessed by InputReader. private final Map mStaticAssociations; @@ -640,9 +636,6 @@ public class InputManagerService extends IInputManager.Stub InputChannel inputChannel = nativeCreateInputMonitor( mPtr, displayId, true /*isGestureMonitor*/, inputChannelName, pid); InputMonitorHost host = new InputMonitorHost(inputChannel.getToken()); - synchronized (mGestureMonitorPidsLock) { - mGestureMonitorPidsByToken.put(inputChannel.getToken(), pid); - } return new InputMonitor(inputChannel, host); } finally { Binder.restoreCallingIdentity(ident); @@ -666,9 +659,6 @@ public class InputManagerService extends IInputManager.Stub if (connectionToken == null) { throw new IllegalArgumentException("connectionToken must not be null."); } - synchronized (mGestureMonitorPidsLock) { - mGestureMonitorPidsByToken.remove(connectionToken); - } nativeRemoveInputChannel(mPtr, connectionToken); } @@ -2167,7 +2157,6 @@ public class InputManagerService extends IInputManager.Stub if (dumpStr != null) { pw.println(dumpStr); dumpAssociations(pw); - dumpGestureMonitorPidsByToken(pw); } } @@ -2191,19 +2180,6 @@ public class InputManagerService extends IInputManager.Stub } } - private void dumpGestureMonitorPidsByToken(PrintWriter pw) { - synchronized (mGestureMonitorPidsLock) { - if (!mGestureMonitorPidsByToken.isEmpty()) { - pw.println("Gesture monitor pids by token:"); - for (int i = 0; i < mGestureMonitorPidsByToken.size(); i++) { - pw.print(" " + i + ": "); - pw.print(" token: " + mGestureMonitorPidsByToken.keyAt(i)); - pw.println(" pid: " + mGestureMonitorPidsByToken.valueAt(i)); - } - } - } - } - private boolean checkCallingPermission(String permission, String func) { // Quick check: if the calling permission is me, it's all okay. if (Binder.getCallingPid() == Process.myPid()) { @@ -2226,7 +2202,6 @@ public class InputManagerService extends IInputManager.Stub public void monitor() { synchronized (mInputFilterLock) { } synchronized (mAssociationsLock) { /* Test if blocked by associations lock. */} - synchronized (mGestureMonitorPidsLock) { /* Test if blocked by gesture monitor pids lock */} synchronized (mLidSwitchLock) { /* Test if blocked by lid switch lock. */ } nativeMonitor(mPtr); } @@ -2296,9 +2271,6 @@ public class InputManagerService extends IInputManager.Stub // Native callback. private void notifyInputChannelBroken(IBinder token) { - synchronized (mGestureMonitorPidsLock) { - mGestureMonitorPidsByToken.remove(token); - } mWindowManagerCallbacks.notifyInputChannelBroken(token); }