1,Binder是android特有的进程间通信方式。
2,基于Binder的C/S架构体系中,除了Client和Server外,还有一个全局的ServiceManager。SM存在的意义:为Client提供查询Service服务,即Client要到SM中查询注册过的Service信息。
3,注意区分Binder中的通信层架构和业务层架构。
=========开始源码解读=========
1,main_mediaserver.cpp
sp proc(ProcessState::self());
sp sm = defaultServiceManager();
ALOGI("ServiceManager: %p", sm.get());
AudioFlinger::instantiate();
MediaPlayerService::instantiate();
ResourceManagerService::instantiate();
CameraService::instantiate();
AudioPolicyService::instantiate();
SoundTriggerHwService::instantiate();
RadioService::instantiate();
#ifdefAUDIO_LISTEN_ENABLED
ALOGI("ListenService instantiated");
ListenService::instantiate();
#endif
registerExtensions();
ProcessState::self()->startThreadPool();
IPCThreadState::self()->joinThreadPool();