가끔 하늘을 보자: Android Framework - ACTION BOOT COMPLETE

2024년 5월 15일 수요일

Android Framework - ACTION BOOT COMPLETE

부팅완료시 ACTION BOOT COMPLETE 보내는 부분

분석버전 : Froyo
android\frameworks\base\services\java\com\android\server\am

ActivityManagerService.java


final void finishBooting() {
        IntentFilter pkgFilter = new IntentFilter();
        pkgFilter.addAction(Intent.ACTION_QUERY_PACKAGE_RESTART);
        pkgFilter.addDataScheme("package");
        mContext.registerReceiver(new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                String[] pkgs = intent.getStringArrayExtra(Intent.EXTRA_PACKAGES);
                if (pkgs != null) {
                    for (String pkg : pkgs) {
                      synchronized (ActivityManagerService.this) {
                        if (forceStopPackageLocked(pkg, -1, false, false, false)) {
                            setResultCode(Activity.RESULT_OK);
                            return;
                        }
                      }
                    }
                }
            }
        }, pkgFilter);

        synchronized (this) {
            // Ensure that any processes we had put on hold are now started up.
            final int NP = mProcessesOnHold.size();
            if (NP > 0) {
                ArrayList procs = new ArrayList(mProcessesOnHold);
            }
            for (int ip=0; ip < NP; i++) {
                this.startProcessLocked(procs.get(ip), "on-hold", null);
            }

            if (mFactoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL) {
                // Tell anyone interested that we are done booting!
                broadcastIntentLocked(null, null,                       // <------ 0="" android.manifest.permission.receive_boot_completed="" code="" false="" intent="" my_pid="" new="" ntent.action_boot_completed="" null="" process.system_uid="">





댓글 없음:

댓글 쓰기

Why 왜 남극은 눈이 안 내릴까?

  🎯 사하라보다 건조한 남극? 왜 눈이 잘 안 내릴까? 숨겨진 비밀! 지구에서 가장 춥고 거대한 얼음 대륙인 남극에 사실은 눈이 거의 안 내린다 는 사실, 알고 계셨나요? 흔히 사막이라고 하면 모래 언덕만 떠올리시죠? 하지만 강수량 기준으로 볼 때...