Loading services/core/java/com/android/server/input/InputManagerService.java +4 −4 Original line number Diff line number Diff line Loading @@ -2523,9 +2523,9 @@ public class InputManagerService extends IInputManager.Stub // Native callback. @SuppressWarnings("unused") private int interceptMotionBeforeQueueingNonInteractive(int displayId, long whenNanos, int policyFlags) { int source, int action, long whenNanos, int policyFlags) { return mWindowManagerCallbacks.interceptMotionBeforeQueueingNonInteractive( displayId, whenNanos, policyFlags); displayId, source, action, whenNanos, policyFlags); } // Native callback. Loading Loading @@ -2901,8 +2901,8 @@ public class InputManagerService extends IInputManager.Stub * processing when the device is in a non-interactive state since these events are normally * dropped. */ int interceptMotionBeforeQueueingNonInteractive(int displayId, long whenNanos, int policyFlags); int interceptMotionBeforeQueueingNonInteractive(int displayId, int source, int action, long whenNanos, int policyFlags); /** * This callback is invoked just before the key is about to be sent to an application. Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -5201,8 +5201,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { // TODO(b/117479243): handle it in InputPolicy /** {@inheritDoc} */ @Override public int interceptMotionBeforeQueueingNonInteractive(int displayId, long whenNanos, int policyFlags) { public int interceptMotionBeforeQueueingNonInteractive(int displayId, int source, int action, long whenNanos, int policyFlags) { if ((policyFlags & FLAG_WAKE) != 0) { if (wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotion, PowerManager.WAKE_REASON_WAKE_MOTION, "android.policy:MOTION")) { Loading services/core/java/com/android/server/policy/WindowManagerPolicy.java +4 −2 Original line number Diff line number Diff line Loading @@ -706,12 +706,14 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { * Generally, it's best to keep as little as possible in the queue thread * because it's the most fragile. * @param displayId The display ID of the motion event. * @param source the {@link InputDevice} source that caused the motion. * @param action the {@link MotionEvent} action for the motion. * @param policyFlags The policy flags associated with the motion. * * @return Actions flags: may be {@link #ACTION_PASS_TO_USER}. */ int interceptMotionBeforeQueueingNonInteractive(int displayId, long whenNanos, int policyFlags); int interceptMotionBeforeQueueingNonInteractive(int displayId, int source, int action, long whenNanos, int policyFlags); /** * Called from the input dispatcher thread before a key is dispatched to a window. Loading services/core/java/com/android/server/wm/InputManagerCallback.java +3 −3 Original line number Diff line number Diff line Loading @@ -167,10 +167,10 @@ final class InputManagerCallback implements InputManagerService.WindowManagerCal /** {@inheritDoc} */ @Override public int interceptMotionBeforeQueueingNonInteractive(int displayId, long whenNanos, int policyFlags) { public int interceptMotionBeforeQueueingNonInteractive(int displayId, int source, int action, long whenNanos, int policyFlags) { return mService.mPolicy.interceptMotionBeforeQueueingNonInteractive( displayId, whenNanos, policyFlags); displayId, source, action, whenNanos, policyFlags); } /** Loading services/core/jni/com_android_server_input_InputManagerService.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -358,8 +358,8 @@ public: void notifyVibratorState(int32_t deviceId, bool isOn) override; bool filterInputEvent(const InputEvent& inputEvent, uint32_t policyFlags) override; void interceptKeyBeforeQueueing(const KeyEvent& keyEvent, uint32_t& policyFlags) override; void interceptMotionBeforeQueueing(int32_t displayId, nsecs_t when, uint32_t& policyFlags) override; void interceptMotionBeforeQueueing(int32_t displayId, uint32_t source, int32_t action, nsecs_t when, uint32_t& policyFlags) override; nsecs_t interceptKeyBeforeDispatching(const sp<IBinder>& token, const KeyEvent& keyEvent, uint32_t policyFlags) override; std::optional<KeyEvent> dispatchUnhandledKey(const sp<IBinder>& token, const KeyEvent& keyEvent, Loading Loading @@ -1496,7 +1496,8 @@ void NativeInputManager::interceptKeyBeforeQueueing(const KeyEvent& keyEvent, handleInterceptActions(wmActions, when, /*byref*/ policyFlags); } void NativeInputManager::interceptMotionBeforeQueueing(int32_t displayId, nsecs_t when, void NativeInputManager::interceptMotionBeforeQueueing(int32_t displayId, uint32_t source, int32_t action, nsecs_t when, uint32_t& policyFlags) { ATRACE_CALL(); // Policy: Loading Loading @@ -1525,7 +1526,7 @@ void NativeInputManager::interceptMotionBeforeQueueing(int32_t displayId, nsecs_ const jint wmActions = env->CallIntMethod(mServiceObj, gServiceClassInfo.interceptMotionBeforeQueueingNonInteractive, displayId, when, policyFlags); displayId, source, action, when, policyFlags); if (checkAndClearExceptionFromCallback(env, "interceptMotionBeforeQueueingNonInteractive")) { return; } Loading Loading @@ -2943,7 +2944,7 @@ int register_android_server_InputManager(JNIEnv* env) { "interceptKeyBeforeQueueing", "(Landroid/view/KeyEvent;I)I"); GET_METHOD_ID(gServiceClassInfo.interceptMotionBeforeQueueingNonInteractive, clazz, "interceptMotionBeforeQueueingNonInteractive", "(IJI)I"); "interceptMotionBeforeQueueingNonInteractive", "(IIIJI)I"); GET_METHOD_ID(gServiceClassInfo.interceptKeyBeforeDispatching, clazz, "interceptKeyBeforeDispatching", Loading Loading
services/core/java/com/android/server/input/InputManagerService.java +4 −4 Original line number Diff line number Diff line Loading @@ -2523,9 +2523,9 @@ public class InputManagerService extends IInputManager.Stub // Native callback. @SuppressWarnings("unused") private int interceptMotionBeforeQueueingNonInteractive(int displayId, long whenNanos, int policyFlags) { int source, int action, long whenNanos, int policyFlags) { return mWindowManagerCallbacks.interceptMotionBeforeQueueingNonInteractive( displayId, whenNanos, policyFlags); displayId, source, action, whenNanos, policyFlags); } // Native callback. Loading Loading @@ -2901,8 +2901,8 @@ public class InputManagerService extends IInputManager.Stub * processing when the device is in a non-interactive state since these events are normally * dropped. */ int interceptMotionBeforeQueueingNonInteractive(int displayId, long whenNanos, int policyFlags); int interceptMotionBeforeQueueingNonInteractive(int displayId, int source, int action, long whenNanos, int policyFlags); /** * This callback is invoked just before the key is about to be sent to an application. Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -5201,8 +5201,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { // TODO(b/117479243): handle it in InputPolicy /** {@inheritDoc} */ @Override public int interceptMotionBeforeQueueingNonInteractive(int displayId, long whenNanos, int policyFlags) { public int interceptMotionBeforeQueueingNonInteractive(int displayId, int source, int action, long whenNanos, int policyFlags) { if ((policyFlags & FLAG_WAKE) != 0) { if (wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotion, PowerManager.WAKE_REASON_WAKE_MOTION, "android.policy:MOTION")) { Loading
services/core/java/com/android/server/policy/WindowManagerPolicy.java +4 −2 Original line number Diff line number Diff line Loading @@ -706,12 +706,14 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { * Generally, it's best to keep as little as possible in the queue thread * because it's the most fragile. * @param displayId The display ID of the motion event. * @param source the {@link InputDevice} source that caused the motion. * @param action the {@link MotionEvent} action for the motion. * @param policyFlags The policy flags associated with the motion. * * @return Actions flags: may be {@link #ACTION_PASS_TO_USER}. */ int interceptMotionBeforeQueueingNonInteractive(int displayId, long whenNanos, int policyFlags); int interceptMotionBeforeQueueingNonInteractive(int displayId, int source, int action, long whenNanos, int policyFlags); /** * Called from the input dispatcher thread before a key is dispatched to a window. Loading
services/core/java/com/android/server/wm/InputManagerCallback.java +3 −3 Original line number Diff line number Diff line Loading @@ -167,10 +167,10 @@ final class InputManagerCallback implements InputManagerService.WindowManagerCal /** {@inheritDoc} */ @Override public int interceptMotionBeforeQueueingNonInteractive(int displayId, long whenNanos, int policyFlags) { public int interceptMotionBeforeQueueingNonInteractive(int displayId, int source, int action, long whenNanos, int policyFlags) { return mService.mPolicy.interceptMotionBeforeQueueingNonInteractive( displayId, whenNanos, policyFlags); displayId, source, action, whenNanos, policyFlags); } /** Loading
services/core/jni/com_android_server_input_InputManagerService.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -358,8 +358,8 @@ public: void notifyVibratorState(int32_t deviceId, bool isOn) override; bool filterInputEvent(const InputEvent& inputEvent, uint32_t policyFlags) override; void interceptKeyBeforeQueueing(const KeyEvent& keyEvent, uint32_t& policyFlags) override; void interceptMotionBeforeQueueing(int32_t displayId, nsecs_t when, uint32_t& policyFlags) override; void interceptMotionBeforeQueueing(int32_t displayId, uint32_t source, int32_t action, nsecs_t when, uint32_t& policyFlags) override; nsecs_t interceptKeyBeforeDispatching(const sp<IBinder>& token, const KeyEvent& keyEvent, uint32_t policyFlags) override; std::optional<KeyEvent> dispatchUnhandledKey(const sp<IBinder>& token, const KeyEvent& keyEvent, Loading Loading @@ -1496,7 +1496,8 @@ void NativeInputManager::interceptKeyBeforeQueueing(const KeyEvent& keyEvent, handleInterceptActions(wmActions, when, /*byref*/ policyFlags); } void NativeInputManager::interceptMotionBeforeQueueing(int32_t displayId, nsecs_t when, void NativeInputManager::interceptMotionBeforeQueueing(int32_t displayId, uint32_t source, int32_t action, nsecs_t when, uint32_t& policyFlags) { ATRACE_CALL(); // Policy: Loading Loading @@ -1525,7 +1526,7 @@ void NativeInputManager::interceptMotionBeforeQueueing(int32_t displayId, nsecs_ const jint wmActions = env->CallIntMethod(mServiceObj, gServiceClassInfo.interceptMotionBeforeQueueingNonInteractive, displayId, when, policyFlags); displayId, source, action, when, policyFlags); if (checkAndClearExceptionFromCallback(env, "interceptMotionBeforeQueueingNonInteractive")) { return; } Loading Loading @@ -2943,7 +2944,7 @@ int register_android_server_InputManager(JNIEnv* env) { "interceptKeyBeforeQueueing", "(Landroid/view/KeyEvent;I)I"); GET_METHOD_ID(gServiceClassInfo.interceptMotionBeforeQueueingNonInteractive, clazz, "interceptMotionBeforeQueueingNonInteractive", "(IJI)I"); "interceptMotionBeforeQueueingNonInteractive", "(IIIJI)I"); GET_METHOD_ID(gServiceClassInfo.interceptKeyBeforeDispatching, clazz, "interceptKeyBeforeDispatching", Loading