ViewRootImpl
InputStage责任链
ViewPostImeInputStage
onProcess
KeyEvent processKeyEvent->DecorView dispatchKeyEvent
SOURCE_CLASS_POINTER processPointerEvent->DecorView dispatchPointerEvent
DecorView
KeyEvent dispatchKeyEvent->cb.dispatchKeyEvent(cb就是Activity)
SOURCE_CLASS_POINTER View dispatchPointerEvent->event.isTouchEvent dispatchTouchEvent(event) else dispatchGenericMotionEvent
->DecorView dispatchTouchEvent->cb.dispatchTouchEvent(cb就是Activity)
Activity
dispatchKeyEvent->PhoneWindow superDispatchKeyEvent
dispatchTouchEvent->PhoneWindow superDispatchTouchEvent
PhoneWindow
superDispatchKeyEvent->DecorView superDispatchKeyEvent
superDispatchTouchEvent->DecorView superDispatchTouchEvent
DecorView
superDispatchKeyEvent->ViewGroup dispatchKeyEvent(分发流程类似dispatchTouchEvent,更简单一些)->ViewRootImpl dispatchUnhandledKeyEvent
superDispatchTouchEvent->ViewGroup dispatchTouchEvent-> 寻找可接收分发事件的child作为target,调用它的dispatchTouchEvent,
如果拦截掉了,就当前view进行调用onTouchEvent。如果子view都不消费,则往上一层一层调用onTouchEvent,最终会到ViewRootImpl处理unHandered Event
分发到View dispatchTouchEvent -> mOnTouchListener onTouch->onTouchEvent->ClickListener onClick, 任何一个return true,都不会调用下一个)