SystemUi 启动流程(8.1)

1   SystemServer.java -> startSystemUi()

     static final void startSystemUi(Context context, WindowManagerService windowManager) {

        Intent intent = new Intent();

        intent.setComponent(new ComponentName("com.android.systemui",

                    "com.android.systemui.SystemUIService"));

        intent.addFlags(Intent.FLAG_DEBUG_TRIAGED_MISSING);

        //Slog.d(TAG, "Starting service: " + intent);

        context.startServiceAsUser(intent, UserHandle.SYSTEM);

        windowManager.onSystemUiStarted();

    }

2  SystemUIService.java->onCreate()

((SystemUIApplication) getApplication()).startServicesIfNeeded();

3 SystemUIApplication.java->startServicesIfNeeded()

private void startServicesIfNeeded(Class<?>[] services) {

        if (mServicesStarted) {

            return;

        }

        if (!mBootCompleted) {

            // check to see if maybe it was already completed long before we began

            // see ActivityManagerService.finishBooting()

            if ("1".equals(SystemProperties.get("sys.boot_completed"))) {

                mBootCompleted = true;

                if (DEBUG) Log.v(TAG, "BOOT_COMPLETED was already sent");

            }

           ...................

           mServices[i].start(); //开启服务

        }

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容