参考 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 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
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 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。