src/framework/av/media/audioserver/main_audioserver.cpp
通过fork()函数创建一个子进程,父进程中返回子进程的ID号,执行的是if语句,子进程返回0,执行else语句。可以看到在else语句中有三个四个服务:
AudioFlinger::instantiate();
AudioPolicyService::instantiate();
RadioService::instantiate();
SoundTriggerHwService::instantiate();
父进程中有MediaLogService::instantiate();用于log的输出,waitid()函数监督子进程。
/*
**
** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License fo