Loading core/java/android/view/InputMonitor.java +7 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,13 @@ import android.os.Parcelable; import android.os.RemoteException; /** * An {@code InputMonitor} allows privileged applications and components to monitor streams of * {@link InputEvent}s without having to be the designated recipient for the event. * * For example, focus dispatched events would normally only go to the focused window on the * targeted display, but an {@code InputMonitor} will also receive a copy of that event if they're * registered to monitor that type of event on the targeted display. * * @hide */ public final class InputMonitor implements Parcelable { Loading services/core/java/com/android/server/input/InputManagerService.java +11 −5 Original line number Diff line number Diff line Loading @@ -523,11 +523,17 @@ public class InputManagerService extends IInputManager.Stub } final long ident = Binder.clearCallingIdentity(); try { InputChannel[] inputChannels = InputChannel.openInputChannelPair(inputChannelName); InputMonitorHost host = new InputMonitorHost(inputChannels[0]); inputChannels[0].setToken(host.asBinder()); nativeRegisterInputMonitor(mPtr, inputChannels[0], displayId, true /*isGestureMonitor*/); nativeRegisterInputMonitor(mPtr, inputChannels[0], displayId, true /*isGestureMonitor*/); return new InputMonitor(inputChannelName, inputChannels[1], host); } finally { Binder.restoreCallingIdentity(ident); } } /** Loading Loading
core/java/android/view/InputMonitor.java +7 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,13 @@ import android.os.Parcelable; import android.os.RemoteException; /** * An {@code InputMonitor} allows privileged applications and components to monitor streams of * {@link InputEvent}s without having to be the designated recipient for the event. * * For example, focus dispatched events would normally only go to the focused window on the * targeted display, but an {@code InputMonitor} will also receive a copy of that event if they're * registered to monitor that type of event on the targeted display. * * @hide */ public final class InputMonitor implements Parcelable { Loading
services/core/java/com/android/server/input/InputManagerService.java +11 −5 Original line number Diff line number Diff line Loading @@ -523,11 +523,17 @@ public class InputManagerService extends IInputManager.Stub } final long ident = Binder.clearCallingIdentity(); try { InputChannel[] inputChannels = InputChannel.openInputChannelPair(inputChannelName); InputMonitorHost host = new InputMonitorHost(inputChannels[0]); inputChannels[0].setToken(host.asBinder()); nativeRegisterInputMonitor(mPtr, inputChannels[0], displayId, true /*isGestureMonitor*/); nativeRegisterInputMonitor(mPtr, inputChannels[0], displayId, true /*isGestureMonitor*/); return new InputMonitor(inputChannelName, inputChannels[1], host); } finally { Binder.restoreCallingIdentity(ident); } } /** Loading