下载此文档

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


文档分类:IT计算机 | 页数:约20页 举报非法文档有奖
1/20
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/20 下载此文档
文档列表 文档介绍
Android系统在启动的过程中,会启动一个应用程序管理服务PackageManagerService,这个服务负责扫描系统中特定的目录,找到里面的应用程序文件,即以Apk为后缀的文件,然后对这些文件进解析,得到应用程序的相关信息,完成应用源代码位于frameworks/base/cmds/system_server/library/:
viewplain
1・extern"C"status_tsystem_init()
{
LOGI("Enteredsystem_init()");
4・
5・sp<ProcessState>proc(ProcessState::self());
6.
7・sp<IServiceManager>sm=defaultServiceManager();
LOGI("ServiceManager:%p\n",());
9.
10.
sp<GrimReaper>grim=newGrimReaper();
11.
sm->asBinder()->linkToDeath(grim,grim・get(),0);
12.
13.
charpropBuf[PROPERTY_VALUE_MAX];
14.
property_get("",propBuf,"1");
15.
if(strcmp(propBuf,"1")==0){
16.
//StarttheSurfaceFlinger
17.
SurfaceFlinger::instantiate();
18.
}
19.
20.
//Startthesensorservice
21.
SensorService::instantiate();
22.
23.
//Onthesimulator,audioflingeretaldon'tgetstartedthe
24.
//samewayasonthedevice,andweneedtostartthemhere
25.
if(!proc->supportsProcesses()){
26.
27.
//StarttheAudioFlinger
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();
//Startthemediaplaybackservice
MediaPlayerService::instantiate();
//Startthecameraservice
CameraService::instantiate();
//Starttheaudiopolicyservice
AudioPolicyService::instantiate();
}
//
//ofnastinessbecausetheAndroidruntimeinitializationrequires
//someofthecoresystemservicestoalreadybestarted.
//AllotherserversshouldjuststarttheAndroidruntimeat
//thebeginningoftheirprocesses'smain(),beforecalling
//theinitfunction.
LOGI("Systemserver:startingAndroidruntime・\n");
AndroidRuntime*runtime=AndroidRuntime::getRuntime();
LOGI("Systemserver:startingAndroidservices.\n");
runtime->callStatic("com/android/server/SystemServer","init2");
//Ifrunninginourownprocess,justgointothethread
//,calltheinitializationfinis

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

相关文档 更多>>
非法内容举报中心
文档信息
最近更新