IMS:EventHub设备底层上报Input事件对象处理
android11-release
IMS:EventHub 设备添加和InputDevice转化
IMS:InputReader线程获取输入事件
IMS:InputDispatcher线程分发事件
Android 知识体系
input_event 封装成 RawEvent
从IMS:InputReader线程获取输入事件 将 input_event 信息封装成 RawEvent ,而IMS:EventHub 设备添加和InputDevice转化 这里除了新增外部设备时InputDevice转化,还有getEvents读取事件input_event 并封装成 RawEvent。
externalkernel-headersoriginaluapilinuxinput.h
frameworksnativeservicesinputflingerreaderincludeEventHub.h
frameworksnativeservicesinputflingerreaderEventHub.cpp


InputReader::loopOnce() -> mEventHub->getEvents

添加NotifyArgs对象
InputReader::loopOnce() -> InputReader::processEventsLocked -> InputReader::processEventsForDeviceLocked -> device->process
frameworksnativeservicesinputflingerreaderInputDevice.cpp

这里InputMapper就是IMS:EventHub 设备添加和InputDevice转化新增设备(不只是外界,手机默认的物理按键和触摸屏幕也是设备)时添加对应的各种InputMapper:常见有物理按键KeyboardInputMapper、触摸点击SingleTouchInputMapper、MultiTouchInputMapper(都是继承TouchInputMapper)

mapper.process(rawEvent)这里就是各种事件InputMapper处理,如KeyboardInputMapper,最终添加NotifyKeyArgs:
device->process -> mapper.process(rawEvent) -> KeyboardInputMapper::processKey -> getListener()->notifyKey(&args) -> QueuedInputListener::notifyKey
frameworksnativeservicesinputflingerreadermapperKeyboardInputMapper.cpp
frameworksnativeservicesinputflingerInputListener.cpp



notify通知InputDispatcher分发
frameworksnativeservicesinputflingerreaderInputReader.cpp
frameworksnativeservicesinputflingerInputListener.cpp
frameworksnativeservicesinputflingerdispatcherInputDispatcher.cpp
loopOnce() -> mQueuedListener->flush() -> args->notify(mInnerListener) -> InputDispatcher::notify***



剩下整体流程可查看IMS:InputReader线程获取输入事件、IMS:InputDispatcher线程分发事件
最后
以上就是漂亮萝莉最近收集整理的关于IMS:EventHub设备底层上报Input事件对象处理IMS:EventHub设备底层上报Input事件对象处理的全部内容,更多相关IMS内容请搜索靠谱客的其他文章。
发表评论 取消回复