[-> InputDispatcher.cpp]
bool InputDispatcherThread::threadLoop() {
mDispatcher->dispatchOnce();
return true;
}
//将NotifyKeyArgs封装的事件信息解析出来,构造两个结构体KeyEvent和KeyEntry,为什么是两个?因为KeyEvent是会首先传递到java层的PhoneWindowManager中去判断是否将此事件加入分发队列
InputDispatcher::notifyKey
// 构建KeyEvent event;
event.initialize...
mPolicy->interceptKeyBeforeQueueing(&event, policyFlags);//mPolicy指向NativeInputManager,这个函数最终会通过JNI调到java层PhoneWindowManager
(1)AccessibilityService辅助服务拦截注入Input事件 IMS:AccessibilityService辅助服务拦截注入Input事件_accessibility inputfilter-CSDN博客
shouldSendKeyToInputFilterLocked?