Lines Matching refs:args
119 static int32_t getActionUpForPointerId(const NotifyMotionArgs& args, int32_t pointerId) { in getActionUpForPointerId() argument
120 for (size_t i = 0; i < args.getPointerCount(); i++) { in getActionUpForPointerId()
121 if (pointerId == args.pointerProperties[i].id) { in getActionUpForPointerId()
126 LOG_ALWAYS_FATAL("Can't find pointerId %" PRId32 " in %s", pointerId, args.dump().c_str()); in getActionUpForPointerId()
151 NotifyMotionArgs removePointerIds(const NotifyMotionArgs& args, in removePointerIds() argument
153 const uint8_t actionIndex = MotionEvent::getActionIndex(args.action); in removePointerIds()
154 const int32_t actionMasked = MotionEvent::getActionMasked(args.action); in removePointerIds()
158 NotifyMotionArgs newArgs{args}; in removePointerIds()
162 for (uint32_t i = 0; i < args.getPointerCount(); i++) { in removePointerIds()
163 const int32_t pointerId = args.pointerProperties[i].id; in removePointerIds()
174 newArgs.pointerProperties.push_back(args.pointerProperties[i]); in removePointerIds()
175 newArgs.pointerCoords.push_back(args.pointerCoords[i]); in removePointerIds()
202 static std::optional<NotifyMotionArgs> removeStylusPointerIds(const NotifyMotionArgs& args) { in removeStylusPointerIds() argument
204 for (uint32_t i = 0; i < args.getPointerCount(); i++) { in removeStylusPointerIds()
205 if (isStylusToolType(args.pointerProperties[i].toolType)) { in removeStylusPointerIds()
206 stylusPointerIds.insert(args.pointerProperties[i].id); in removeStylusPointerIds()
209 NotifyMotionArgs withoutStylusPointers = removePointerIds(args, stylusPointerIds); in removeStylusPointerIds()
274 const NotifyMotionArgs& args, const std::set<int32_t>& oldSuppressedPointerIds, in cancelSuppressedPointers() argument
276 LOG_ALWAYS_FATAL_IF(args.getPointerCount() == 0, "0 pointers in %s", args.dump().c_str()); in cancelSuppressedPointers()
279 NotifyMotionArgs oldArgs = removePointerIds(args, oldSuppressedPointerIds); in cancelSuppressedPointers()
284 args.pointerProperties[MotionEvent::getActionIndex(args.action)].id; in cancelSuppressedPointers()
285 const int32_t actionMasked = MotionEvent::getActionMasked(args.action); in cancelSuppressedPointers()
333 const NotifyConfigurationChangedArgs& args) { in notifyConfigurationChanged() argument
334 mQueuedListener.notifyConfigurationChanged(args); in notifyConfigurationChanged()
338 void UnwantedInteractionBlocker::notifyKey(const NotifyKeyArgs& args) { in notifyKey() argument
339 mQueuedListener.notifyKey(args); in notifyKey()
343 void UnwantedInteractionBlocker::notifyMotion(const NotifyMotionArgs& args) { in notifyMotion() argument
344 ALOGD_IF(DEBUG_INBOUND_MOTION, "%s: %s", __func__, args.dump().c_str()); in notifyMotion()
348 mPreferStylusOverTouchBlocker.processMotion(args); in notifyMotion()
358 void UnwantedInteractionBlocker::enqueueOutboundMotionLocked(const NotifyMotionArgs& args) { in enqueueOutboundMotionLocked() argument
359 ALOGD_IF(DEBUG_OUTBOUND_MOTION, "%s: %s", __func__, args.dump().c_str()); in enqueueOutboundMotionLocked()
360 mQueuedListener.notifyMotion(args); in enqueueOutboundMotionLocked()
363 void UnwantedInteractionBlocker::notifyMotionLocked(const NotifyMotionArgs& args) { in notifyMotionLocked() argument
364 auto it = mPalmRejectors.find(args.deviceId); in notifyMotionLocked()
365 const bool sendToPalmRejector = it != mPalmRejectors.end() && isFromTouchscreen(args.source); in notifyMotionLocked()
367 enqueueOutboundMotionLocked(args); in notifyMotionLocked()
371 std::vector<NotifyMotionArgs> processedArgs = it->second.processMotion(args); in notifyMotionLocked()
377 void UnwantedInteractionBlocker::notifySwitch(const NotifySwitchArgs& args) { in notifySwitch() argument
378 mQueuedListener.notifySwitch(args); in notifySwitch()
382 void UnwantedInteractionBlocker::notifySensor(const NotifySensorArgs& args) { in notifySensor() argument
383 mQueuedListener.notifySensor(args); in notifySensor()
387 void UnwantedInteractionBlocker::notifyVibratorState(const NotifyVibratorStateArgs& args) { in notifyVibratorState() argument
388 mQueuedListener.notifyVibratorState(args); in notifyVibratorState()
391 void UnwantedInteractionBlocker::notifyDeviceReset(const NotifyDeviceResetArgs& args) { in notifyDeviceReset() argument
394 auto it = mPalmRejectors.find(args.deviceId); in notifyDeviceReset()
399 mPalmRejectors.emplace(args.deviceId, info); in notifyDeviceReset()
401 mQueuedListener.notifyDeviceReset(args); in notifyDeviceReset()
402 mPreferStylusOverTouchBlocker.notifyDeviceReset(args); in notifyDeviceReset()
409 const NotifyPointerCaptureChangedArgs& args) { in notifyPointerCaptureChanged() argument
410 mQueuedListener.notifyPointerCaptureChanged(args); in notifyPointerCaptureChanged()
415 const NotifyInputDevicesChangedArgs& args) { in notifyInputDevicesChanged() argument
416 onInputDevicesChanged(args.inputDeviceInfos); in notifyInputDevicesChanged()
417 mQueuedListener.notify(args); in notifyInputDevicesChanged()
476 void SlotState::update(const NotifyMotionArgs& args) { in update() argument
477 for (size_t i = 0; i < args.getPointerCount(); i++) { in update()
478 const int32_t pointerId = args.pointerProperties[i].id; in update()
479 const int32_t resolvedAction = resolveActionForPointer(i, args.action); in update()
569 std::vector<::ui::InProgressTouchEvdev> getTouches(const NotifyMotionArgs& args, in getTouches() argument
575 for (size_t i = 0; i < args.getPointerCount(); i++) { in getTouches()
576 const int32_t pointerId = args.pointerProperties[i].id; in getTouches()
578 touches.back().major = args.pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MAJOR); in getTouches()
579 touches.back().minor = args.pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MINOR); in getTouches()
604 const int32_t resolvedAction = resolveActionForPointer(i, args.action); in getTouches()
613 touches.back().x = args.pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_X); in getTouches()
614 touches.back().y = args.pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_Y); in getTouches()
626 touches.back().pressure = args.pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_PRESSURE); in getTouches()
627 touches.back().tool_code = getLinuxToolCode(args.pointerProperties[i].toolType); in getTouches()
636 std::set<int32_t> PalmRejector::detectPalmPointers(const NotifyMotionArgs& args) { in detectPalmPointers() argument
643 mSlotState.update(args); in detectPalmPointers()
646 getTouches(args, mDeviceInfo, oldSlotState, mSlotState); in detectPalmPointers()
647 ::base::TimeTicks chromeTimestamp = toChromeTimestamp(args.eventTime); in detectPalmPointers()
664 for (size_t i = 0; i < args.getPointerCount(); i++) { in detectPalmPointers()
665 const int32_t pointerId = args.pointerProperties[i].id; in detectPalmPointers()
678 std::vector<NotifyMotionArgs> PalmRejector::processMotion(const NotifyMotionArgs& args) { in processMotion() argument
680 return {args}; in processMotion()
682 const bool skipThisEvent = args.action == AMOTION_EVENT_ACTION_HOVER_ENTER || in processMotion()
683 args.action == AMOTION_EVENT_ACTION_HOVER_MOVE || in processMotion()
684 args.action == AMOTION_EVENT_ACTION_HOVER_EXIT || in processMotion()
685 args.action == AMOTION_EVENT_ACTION_BUTTON_PRESS || in processMotion()
686 args.action == AMOTION_EVENT_ACTION_BUTTON_RELEASE || in processMotion()
687 args.action == AMOTION_EVENT_ACTION_SCROLL; in processMotion()
690 return {args}; in processMotion()
692 if (args.action == AMOTION_EVENT_ACTION_DOWN) { in processMotion()
699 std::optional<NotifyMotionArgs> touchOnlyArgs = removeStylusPointerIds(args); in processMotion()
709 cancelSuppressedPointers(args, oldSuppressedIds, mSuppressedPointerIds); in processMotion()
719 dumpSet(mSuppressedPointerIds).c_str(), ns2ms(args.eventTime - args.downTime), in processMotion()
720 args.dump().c_str()); in processMotion()