Android学习——SystenUIService启动

来源:互联网 发布:ios 网络图片尺寸 编辑:程序博客网 时间:2024/06/05 01:28

参考 http://www.jianshu.com/p/0ab1279465fa


首先简单描述一下启动过程:

设备上电 ——>引导程序引导计入boot——>加载inittramfs、kernel镜像——>进入用户态程序init

init 的基本功能

管理设备,解析并管理Android启动脚本,实时维护init.rc 的服务,加载zygote


而zygote 将启动systemService. 在systemService 的main 函数中执行run 函数将启动一系列Service ,如

            startBootstrapServices();            startCoreServices();            startOtherServices();
在startOtherServices()中将
                    startSystemUi(context);
static final void startSystemUi(Context context) { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService")); //Slog.d(TAG, "Starting service: " + intent); context.startServiceAsUser(intent, UserHandle.OWNER); }
作者:音苍链接:http://www.jianshu.com/p/0ab1279465fa來源:简书著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

static final void startSystemUi(Context context) { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService")); //Slog.d(TAG, "Starting service: " + intent); context.startServiceAsUser(intent, UserHandle.OWNER); }
作者:音苍链接:http://www.jianshu.com/p/0ab1279465fa來源:简书著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
static final void startSystemUi(Context context) { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService")); //Slog.d(TAG, "Starting service: " + intent); context.startServiceAsUser(intent, UserHandle.OWNER); }
作者:音苍链接:http://www.jianshu.com/p/0ab1279465fa來源:简书著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
static final void startSystemUi(Context context) { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService")); //Slog.d(TAG, "Starting service: " + intent); context.startServiceAsUser(intent, UserHandle.OWNER); }
作者:音苍链接:http://www.jianshu.com/p/0ab1279465fa來源:简书著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
进而进入SystemUIService。


static final void startSystemUi(Context context) { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService")); //Slog.d(TAG, "Starting service: " + intent); context.startServiceAsUser(intent, UserHandle.OWNER); }
作者:音苍链接:http://www.jianshu.com/p/0ab1279465fa來源:简书著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
static final void startSystemUi(Context context) { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService")); //Slog.d(TAG, "Starting service: " + intent); context.startServiceAsUser(intent, UserHandle.OWNER); }
作者:音苍链接:http://www.jianshu.com/p/0ab1279465fa來源:简书著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。





原创粉丝点击