android 源码分析--system-server
来源:互联网 发布:图像灰度化算法 编辑:程序博客网 时间:2024/05/23 20:13
system_init.cpp 就是对系统服务启动进行使用的情况
extern "C" status_t system_init()
{
LOGI("Entered system_init()");
sp<ProcessState> proc(ProcessState::self());
sp<IServiceManager> sm = defaultServiceManager();
LOGI("ServiceManager: %p\n", sm.get());
sp<GrimReaper> grim = new GrimReaper();
sm->asBinder()->linkToDeath(grim, grim.get(), 0);
char propBuf[PROPERTY_VALUE_MAX];
property_get("system_init.startsurfaceflinger", propBuf, "1");
if (strcmp(propBuf, "1") == 0) {
// Start the SurfaceFlinger
SurfaceFlinger::instantiate();
}
// SurfaceFlinger的使用
// same way as on the device, and we need to start them here
if (!proc->supportsProcesses()) {
// Start the AudioFlinger
AudioFlinger::instantiate();
// Start the media playback service
MediaPlayerService::instantiate();
// Start the camera service
CameraService::instantiate();
// Start the audio policy service
AudioPolicyService::instantiate();
}
// And now start the Android runtime. We have to do this bit
// of nastiness because the Android runtime initialization requires
// some of the core system services to already be started.
// All other servers should just start the Android runtime at
// the beginning of their processes's main(), before calling
// the init function.
LOGI("System server: starting Android runtime.\n");
AndroidRuntime* runtime = AndroidRuntime::getRuntime();
LOGI("System server: starting Android services.\n");
runtime->callStatic("com/android/server/SystemServer", "init2");
// If running in our own process, just go into the thread
// pool. Otherwise, call the initialization finished
// func to let this process continue its initilization.
if (proc->supportsProcesses()) {
LOGI("System server: entering thread pool.\n");
ProcessState::self()->startThreadPool();
IPCThreadState::self()->joinThreadPool();
LOGI("System server: exiting thread pool.\n");
}
return NO_ERROR;
}
- android 源码分析--system-server
- Android System Server进程源码分析 上
- Android System Server进程源码分析 下
- Android System Server进程源码分析 上
- Android System Server进程源码分析 下
- android System Server 分析
- System Server进程启动过程源码分析
- System Server进程启动过程源码分析
- Android system server之WatchDog看门狗分析
- Android system server之PackageManagerService详细分析
- 图解Android - Zygote, System Server 启动分析
- 图解Android - Zygote, System Server 启动分析
- 图解Android - Zygote, System Server 启动分析
- 图解Android - Zygote, System Server 启动分析 .
- 图解Android - Zygote, System Server 启动分析
- 图解Android - Zygote, System Server 启动分析
- 图解Android - Zygote, System Server 启动分析
- android /system/vold源码分析(1)
- qq聊天记录审计
- c# log4net在项目中使用实例
- Openssl介绍
- 超越物质的秘密
- 25 Apache Performance Tuning Tips
- android 源码分析--system-server
- 三星掐住弱点锁喉,台积电危矣
- windows7下不能打开hlp帮助文件的解决办法
- 从现在开始
- IO中用ByteArrayOutputStream解决乱码问题
- 虚拟机centos 全屏方法
- net time 时间同步命令
- 让我们换个角度看世界
- android 签名之必备知识