android 9.0 bindService流程
2019-08-27 本文已影响0人
tigerzhao
9.0源码下的bindService流程:
首先还是调用ContextImpl里面的方法

bindServiceCommon方法里面直接就开始跨进程调用了

ActivityManager.getService()依然调用的是AMS的代码,接下来看AMS里面的bindService方法

mServices是ActiveServices类的对象,接下来跳转到了ActiveServices类的方法bindServiceLocked,此方法较多,只截取流程相关的代码。
保存了每个bind此service的客户端的记录

调用了bringUpServiceLocked方法,可以看到接下来的流程就和startService一样了,此处就不再重复了。
