Loading services/inputflinger/dispatcher/InputDispatcher.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -4449,7 +4449,8 @@ void InputDispatcher::notifyMotion(const NotifyMotionArgs& args) { policyFlags |= POLICY_FLAG_TRUSTED; android::base::Timer t; mPolicy.interceptMotionBeforeQueueing(args.displayId, args.eventTime, policyFlags); mPolicy.interceptMotionBeforeQueueing(args.displayId, args.source, args.action, args.eventTime, policyFlags); if (t.duration() > SLOW_INTERCEPTION_THRESHOLD) { ALOGW("Excessive delay in interceptMotionBeforeQueueing; took %s ms", std::to_string(t.duration().count()).c_str()); Loading Loading @@ -4710,7 +4711,9 @@ InputEventInjectionResult InputDispatcher::injectInputEvent(const InputEvent* ev if (!(policyFlags & POLICY_FLAG_FILTERED)) { nsecs_t eventTime = motionEvent.getEventTime(); android::base::Timer t; mPolicy.interceptMotionBeforeQueueing(displayId, eventTime, /*byref*/ policyFlags); mPolicy.interceptMotionBeforeQueueing(displayId, motionEvent.getSource(), motionEvent.getAction(), eventTime, /*byref*/ policyFlags); if (t.duration() > SLOW_INTERCEPTION_THRESHOLD) { ALOGW("Excessive delay in interceptMotionBeforeQueueing; took %s ms", std::to_string(t.duration().count()).c_str()); Loading services/inputflinger/dispatcher/include/InputDispatcherPolicyInterface.h +2 −2 Original line number Diff line number Diff line Loading @@ -99,8 +99,8 @@ public: * This method is expected to set the POLICY_FLAG_PASS_TO_USER policy flag if the event * should be dispatched to applications. */ virtual void interceptMotionBeforeQueueing(int32_t displayId, nsecs_t when, uint32_t& policyFlags) = 0; virtual void interceptMotionBeforeQueueing(int32_t displayId, uint32_t source, int32_t action, nsecs_t when, uint32_t& policyFlags) = 0; /* Allows the policy a chance to intercept a key before dispatching. */ virtual nsecs_t interceptKeyBeforeDispatching(const sp<IBinder>& token, Loading services/inputflinger/tests/FakeInputDispatcherPolicy.h +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ private: void interceptKeyBeforeQueueing(const KeyEvent&, uint32_t&) override {} void interceptMotionBeforeQueueing(int32_t, nsecs_t, uint32_t&) override {} void interceptMotionBeforeQueueing(int32_t, uint32_t, int32_t, nsecs_t, uint32_t&) override {} nsecs_t interceptKeyBeforeDispatching(const sp<IBinder>&, const KeyEvent&, uint32_t) override { return 0; Loading services/inputflinger/tests/InputDispatcher_test.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -549,7 +549,7 @@ private: } } void interceptMotionBeforeQueueing(int32_t, nsecs_t, uint32_t&) override {} void interceptMotionBeforeQueueing(int32_t, uint32_t, int32_t, nsecs_t, uint32_t&) override {} nsecs_t interceptKeyBeforeDispatching(const sp<IBinder>&, const KeyEvent&, uint32_t) override { nsecs_t delay = std::chrono::nanoseconds(mInterceptKeyTimeout).count(); Loading Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -4449,7 +4449,8 @@ void InputDispatcher::notifyMotion(const NotifyMotionArgs& args) { policyFlags |= POLICY_FLAG_TRUSTED; android::base::Timer t; mPolicy.interceptMotionBeforeQueueing(args.displayId, args.eventTime, policyFlags); mPolicy.interceptMotionBeforeQueueing(args.displayId, args.source, args.action, args.eventTime, policyFlags); if (t.duration() > SLOW_INTERCEPTION_THRESHOLD) { ALOGW("Excessive delay in interceptMotionBeforeQueueing; took %s ms", std::to_string(t.duration().count()).c_str()); Loading Loading @@ -4710,7 +4711,9 @@ InputEventInjectionResult InputDispatcher::injectInputEvent(const InputEvent* ev if (!(policyFlags & POLICY_FLAG_FILTERED)) { nsecs_t eventTime = motionEvent.getEventTime(); android::base::Timer t; mPolicy.interceptMotionBeforeQueueing(displayId, eventTime, /*byref*/ policyFlags); mPolicy.interceptMotionBeforeQueueing(displayId, motionEvent.getSource(), motionEvent.getAction(), eventTime, /*byref*/ policyFlags); if (t.duration() > SLOW_INTERCEPTION_THRESHOLD) { ALOGW("Excessive delay in interceptMotionBeforeQueueing; took %s ms", std::to_string(t.duration().count()).c_str()); Loading
services/inputflinger/dispatcher/include/InputDispatcherPolicyInterface.h +2 −2 Original line number Diff line number Diff line Loading @@ -99,8 +99,8 @@ public: * This method is expected to set the POLICY_FLAG_PASS_TO_USER policy flag if the event * should be dispatched to applications. */ virtual void interceptMotionBeforeQueueing(int32_t displayId, nsecs_t when, uint32_t& policyFlags) = 0; virtual void interceptMotionBeforeQueueing(int32_t displayId, uint32_t source, int32_t action, nsecs_t when, uint32_t& policyFlags) = 0; /* Allows the policy a chance to intercept a key before dispatching. */ virtual nsecs_t interceptKeyBeforeDispatching(const sp<IBinder>& token, Loading
services/inputflinger/tests/FakeInputDispatcherPolicy.h +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ private: void interceptKeyBeforeQueueing(const KeyEvent&, uint32_t&) override {} void interceptMotionBeforeQueueing(int32_t, nsecs_t, uint32_t&) override {} void interceptMotionBeforeQueueing(int32_t, uint32_t, int32_t, nsecs_t, uint32_t&) override {} nsecs_t interceptKeyBeforeDispatching(const sp<IBinder>&, const KeyEvent&, uint32_t) override { return 0; Loading
services/inputflinger/tests/InputDispatcher_test.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -549,7 +549,7 @@ private: } } void interceptMotionBeforeQueueing(int32_t, nsecs_t, uint32_t&) override {} void interceptMotionBeforeQueueing(int32_t, uint32_t, int32_t, nsecs_t, uint32_t&) override {} nsecs_t interceptKeyBeforeDispatching(const sp<IBinder>&, const KeyEvent&, uint32_t) override { nsecs_t delay = std::chrono::nanoseconds(mInterceptKeyTimeout).count(); Loading