自己怎么制作網(wǎng)站百度排行
前面的文章我們介紹了 WMS 中的輸入服務(wù)的啟動(dòng)及事件處理,這一篇我們來(lái)看一下客戶端對(duì)輸入事件的處理。
一、事件初始化
事件的初始化就是在添加窗口的過(guò)程。
1、ViewRootImpl
源碼位置:/frameworks/base/core/java/android/view/ViewRootImpl.java
public void setView(View view, WindowManager.LayoutParams attrs, View panelParentView, int userId) {synchronized (this) {if (mView == null) {……InputChannel inputChannel = null;if ((mWindowAttributes.inputFeatures & WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL) == 0) {inputChannel = new InputChannel();}……try {……// 創(chuàng)建 channelres = mWindowSession.addToDisplayAsUser(mWindow, mSeq, mWindowAttributes,getHostVisibility(), mDisplay.getDisplayId(), userId, mTmpFrame,