Android4.0 WindowManagerService的分析(三)

2014-11-24 11:47:46 来源: 作者: 浏览: 9
utInputChannel != null && (attrs.inputFeatures


& WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL) == 0) {


String name = win.makeInputChannelName();


InputChannel[] inputChannels = InputChannel.openInputChannelPair(name);


win.setInputChannel(inputChannels[0]);


inputChannels[1].transferTo(outInputChannel);



mInputManager.registerInputChannel(win.mInputChannel, win.mInputWindowHandle);


}


}


在windowState.java中调用attach:


void attach() {


mSession.windowAddedLocked();


}


最后在Session.java中实现添加:


void windowAddedLocked() {


if (mSurfaceSession == null) {


mSurfaceSession = new SurfaceSession();


mService.mSessions.add(this);


}



mNumWindow++;


}



至此,正式建立activity的client和windowManagerService之间的联系:


ViewRootImpl 通过IWindowSession 访问 WindowManagerService


WindowManagerService通过IWindow访问ViewRootImpl


-->

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: