下载此文档

Android应用程序安装过程源代码分析.docx


文档分类:IT计算机 | 页数:约19页 举报非法文档有奖
1/19
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/19 下载此文档
文档列表 文档介绍
Android系统在启动的过程中,会启动一个应用程序管理服务PackageManagerService,这个服务负 责扫描系统中特定的目录,找到里面的应用程序文件,即以Apk为后缀的文件,然后对这些文件进解析, 得到应用程序的相关信息,完成m_init 函数来进一步执行操作。
Step 3.
函数system_init实现在libsystem_server库中,源代码位于 frameworks/base/cmds/system_server/library/ 文件中:
view plain
1・ extern "C" status_t system_init()
{
LOGI("Entered system_init()");
4・
5・ sp<ProcessState> proc(ProcessState::self());
6.
7・ sp<IServiceManager> sm = defaultServiceManager();
LOGI("ServiceManager: %p\n", ());
9.
10.
sp<GrimReaper> grim = new GrimReaper();
11.
sm->asBinder()->linkToDeath(grim, grim・get(), 0);
12.
13.
char propBuf[PROPERTY_VALUE_MAX];
14.
property_get("", propBuf, "1");
15.
if (strcmp(propBuf, "1") == 0) {
16.
// Start the SurfaceFlinger
17.
SurfaceFlinger::instantiate();
18.
}
19.
20.
// Start the sensor service
21.
SensorService::instantiate();
22.
23.
// On the simulator, audioflinger et al don't get started the
24.
// same way as on the device, and we need to start them here
25.
if (!proc->supportsProcesses()) {
26.
27.
// Start the AudioFlinger
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
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 = AndroidRu

Android应用程序安装过程源代码分析 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数19
  • 收藏数0 收藏
  • 顶次数0
  • 上传人xiaobaizhua
  • 文件大小103 KB
  • 时间2022-06-28