下载此文档

Android系统默认Home应用程序(Launcher)的启动过程源代码分析.doc


文档分类:IT计算机 | 页数:约25页 举报非法文档有奖
1/25
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/25 下载此文档
文档列表 文档介绍
Android系统默认Home应用程序(Launcher)的启动过程源代码分析.doc在前面一篇文章中,我们分析了 Android系统在启动时安装应用程序的过程,这些应用程序安装好
之后,还需要有一个Home应用程序来负责把它们在桌面上展示出来, 在Android系统中,这个默认的Home
应用程序就是Launcher n( int factoryTest) {
AThread thr = new AThread();
();
8.
syn chro ni zed (thr) {
while ( == null ) {
try {
;
} catch (In terruptedExcepti on e) {
}
}
}
17.
ActivityMa nagerService m = ;
mSelf = m;
20.
ActivityThread at = in();
21.
mSystemThread = at;
22.
Con text con text = on text。;
23.
ontext = con text;
24.
= factoryTest;
25.
in Stack = new ActivityStack(m, con text,
true );
26.
27.
(co ntext);
28.
(c on text);
29.
30.
syn chro ni zed (thr) {
31.
= true ;
32.
otifyAII();
33.
}
34.
35.
( null , null , null , null );
36.
37.
return con text;
38.
}
39.
40.
41.
}
这个函数首先通过 AThread线程对象来内部创建了一个 ActivityManagerService 实例,然后将这个 实例保存其成员变量 mService中,接着又把这个 ActivityManagerService 实例保存在 ActivityManagerService 类的静态成员变量 mSelf中,最后初始化其它成员变量,就结束了。
Step 8.
这个函数定义在 frameworks/base/services/java/com/android/server/
文件中,具体可以参考前面一篇文章 Android应用程序安装过程源代码分析 的Step 7。执行完这一步之后,
系统中的应用程序的所有信息都保存在 PackageManagerService 中了,后面Home应用程序Launcher
启动起来后,就会把 PackageManagerService 中的应用程序信息取出来,然后以快捷图标的形式展示在
桌面上,后面我们将会看到这个过程。
Step 9.
这个函数定义在
frameworks/base/services/java/com/android/server/am/ 文件中:
view plain
public final class ActivityMa nagerService exte nds ActivityMa nagerNative
impleme nts nitor, {
……
4.
public static void setSystemProcess() {
try {
7.
ActivityMa nagerService m = mSelf;
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
3

Android系统默认Home应用程序(Launcher)的启动过程源代码分析 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数25
  • 收藏数0 收藏
  • 顶次数0
  • 上传人小辰GG1
  • 文件大小671 KB
  • 时间2022-02-08