Android:coreApp在清单中的含义

时间:2019-05-12 13:55:12

标签: android manifest

在清单中,我看到了一个代码

<manifest xmlns:tools="http://schemas.android.com/tools"
    package="com.example.test"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="1"
    android:versionName="1.0"
    android:sharedUserId="android.uid.system"
    coreApp="true">

coreApp是什么意思?

2 个答案:

答案 0 :(得分:1)

coreApp =“ true”表示应用程序将在启用特定的启动模式(可能是“安全模式”)时启动:

  

系统可以成功启动(尽管有些痛苦)   仅framework-res.apk,SettingsProvider.apk,SystemUI.apk,   将DefaultContainerService.apk和Launcher2.apk设置为核心应用。

从Android Git存储库中: https://android.googlesource.com/platform/frameworks/base/+/d2509fd83597595914ef0627685e917380863eb6%5E!/

答案 1 :(得分:1)

根据Android-8.0代码com.android.server.SystemServer#startBootstrapServices

        // Only run "core" apps if we're encrypting the device.
    String cryptState = SystemProperties.get("vold.decrypt");
    if (ENCRYPTING_STATE.equals(cryptState)) {
        Slog.w(TAG, "Detected encryption in progress - only parsing core apps");
        mOnlyCore = true;
    } else if (ENCRYPTED_STATE.equals(cryptState)) {
        Slog.w(TAG, "Device encrypted - only parsing core apps");
        mOnlyCore = true;
    }

    // Start the package manager.
    if (!mRuntimeRestart) {
        MetricsLogger.histogram(null, "boot_package_manager_init_start",
                (int) SystemClock.elapsedRealtime());
    }
    traceBeginAndSlog("StartPackageManagerService");
    mPackageManagerService = PackageManagerService.main(mSystemContext, installer,
            mFactoryTestMode != FactoryTest.FACTORY_TEST_OFF, mOnlyCore);
    mFirstBoot = mPackageManagerService.isFirstBoot();
    mPackageManager = mSystemContext.getPackageManager();
    traceEnd();