Loading services/core/java/com/android/server/pm/OtaDexoptService.java +1 −10 Original line number Diff line number Diff line Loading @@ -135,16 +135,7 @@ public class OtaDexoptService extends IOtaDexopt.Stub { } for (PackageParser.Package p : important) { // Make sure that core apps are optimized according to their own "reason". // If the core apps are not preopted in the B OTA, and REASON_AB_OTA is not speed // (by default is speed-profile) they will be interepreted/JITed. This in itself is // not a problem as we will end up doing profile guided compilation. However, some // core apps may be loaded by system server which doesn't JIT and we need to make // sure we don't interpret-only int compilationReason = p.coreApp ? PackageManagerService.REASON_CORE_APP : PackageManagerService.REASON_AB_OTA; mDexoptCommands.addAll(generatePackageDexopts(p, compilationReason)); mDexoptCommands.addAll(generatePackageDexopts(p, PackageManagerService.REASON_AB_OTA)); } for (PackageParser.Package p : others) { // We assume here that there are no core apps left. Loading services/core/java/com/android/server/pm/PackageManagerService.java +1 −37 Original line number Diff line number Diff line Loading @@ -540,9 +540,8 @@ public class PackageManagerService extends IPackageManager.Stub { public static final int REASON_NON_SYSTEM_LIBRARY = 5; public static final int REASON_SHARED_APK = 6; public static final int REASON_FORCED_DEXOPT = 7; public static final int REASON_CORE_APP = 8; public static final int REASON_LAST = REASON_CORE_APP; public static final int REASON_LAST = REASON_FORCED_DEXOPT; /** All dangerous permission names in the same order as the events in MetricsEvent */ private static final List<String> ALL_DANGEROUS_PERMISSIONS = Arrays.asList( Loading Loading @@ -2819,41 +2818,6 @@ public class PackageManagerService extends IPackageManager.Stub { mSettings.writeLPr(); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); // Perform dexopt on all apps that mark themselves as coreApps. We do this pretty // early on (before the package manager declares itself as early) because other // components in the system server might ask for package contexts for these apps. // // Note that "onlyCore" in this context means the system is encrypted or encrypting // (i.e, that the data partition is unavailable). if ((isFirstBoot() || isUpgrade() || VMRuntime.didPruneDalvikCache()) && !onlyCore) { long start = System.nanoTime(); List<PackageParser.Package> coreApps = new ArrayList<>(); for (PackageParser.Package pkg : mPackages.values()) { if (pkg.coreApp) { coreApps.add(pkg); } } int[] stats = performDexOptUpgrade(coreApps, false, getCompilerFilterForReason(REASON_CORE_APP)); final int elapsedTimeSeconds = (int) TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start); MetricsLogger.histogram(mContext, "opt_coreapps_time_s", elapsedTimeSeconds); if (DEBUG_DEXOPT) { Slog.i(TAG, "Dex-opt core apps took : " + elapsedTimeSeconds + " seconds (" + stats[0] + ", " + stats[1] + ", " + stats[2] + ")"); } // TODO: Should we log these stats to tron too ? // MetricsLogger.histogram(mContext, "opt_coreapps_num_dexopted", stats[0]); // MetricsLogger.histogram(mContext, "opt_coreapps_num_skipped", stats[1]); // MetricsLogger.histogram(mContext, "opt_coreapps_num_failed", stats[2]); // MetricsLogger.histogram(mContext, "opt_coreapps_num_total", coreApps.size()); } EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_PMS_READY, SystemClock.uptimeMillis()); services/core/java/com/android/server/pm/PackageManagerServiceCompilerMapping.java +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ public class PackageManagerServiceCompilerMapping { // Names for compilation reasons. static final String REASON_STRINGS[] = { "first-boot", "boot", "install", "bg-dexopt", "ab-ota", "nsys-library", "shared-apk", "forced-dexopt", "core-app" "forced-dexopt" }; // Static block to ensure the strings array is of the right length. Loading Loading
services/core/java/com/android/server/pm/OtaDexoptService.java +1 −10 Original line number Diff line number Diff line Loading @@ -135,16 +135,7 @@ public class OtaDexoptService extends IOtaDexopt.Stub { } for (PackageParser.Package p : important) { // Make sure that core apps are optimized according to their own "reason". // If the core apps are not preopted in the B OTA, and REASON_AB_OTA is not speed // (by default is speed-profile) they will be interepreted/JITed. This in itself is // not a problem as we will end up doing profile guided compilation. However, some // core apps may be loaded by system server which doesn't JIT and we need to make // sure we don't interpret-only int compilationReason = p.coreApp ? PackageManagerService.REASON_CORE_APP : PackageManagerService.REASON_AB_OTA; mDexoptCommands.addAll(generatePackageDexopts(p, compilationReason)); mDexoptCommands.addAll(generatePackageDexopts(p, PackageManagerService.REASON_AB_OTA)); } for (PackageParser.Package p : others) { // We assume here that there are no core apps left. Loading
services/core/java/com/android/server/pm/PackageManagerService.java +1 −37 Original line number Diff line number Diff line Loading @@ -540,9 +540,8 @@ public class PackageManagerService extends IPackageManager.Stub { public static final int REASON_NON_SYSTEM_LIBRARY = 5; public static final int REASON_SHARED_APK = 6; public static final int REASON_FORCED_DEXOPT = 7; public static final int REASON_CORE_APP = 8; public static final int REASON_LAST = REASON_CORE_APP; public static final int REASON_LAST = REASON_FORCED_DEXOPT; /** All dangerous permission names in the same order as the events in MetricsEvent */ private static final List<String> ALL_DANGEROUS_PERMISSIONS = Arrays.asList( Loading Loading @@ -2819,41 +2818,6 @@ public class PackageManagerService extends IPackageManager.Stub { mSettings.writeLPr(); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); // Perform dexopt on all apps that mark themselves as coreApps. We do this pretty // early on (before the package manager declares itself as early) because other // components in the system server might ask for package contexts for these apps. // // Note that "onlyCore" in this context means the system is encrypted or encrypting // (i.e, that the data partition is unavailable). if ((isFirstBoot() || isUpgrade() || VMRuntime.didPruneDalvikCache()) && !onlyCore) { long start = System.nanoTime(); List<PackageParser.Package> coreApps = new ArrayList<>(); for (PackageParser.Package pkg : mPackages.values()) { if (pkg.coreApp) { coreApps.add(pkg); } } int[] stats = performDexOptUpgrade(coreApps, false, getCompilerFilterForReason(REASON_CORE_APP)); final int elapsedTimeSeconds = (int) TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start); MetricsLogger.histogram(mContext, "opt_coreapps_time_s", elapsedTimeSeconds); if (DEBUG_DEXOPT) { Slog.i(TAG, "Dex-opt core apps took : " + elapsedTimeSeconds + " seconds (" + stats[0] + ", " + stats[1] + ", " + stats[2] + ")"); } // TODO: Should we log these stats to tron too ? // MetricsLogger.histogram(mContext, "opt_coreapps_num_dexopted", stats[0]); // MetricsLogger.histogram(mContext, "opt_coreapps_num_skipped", stats[1]); // MetricsLogger.histogram(mContext, "opt_coreapps_num_failed", stats[2]); // MetricsLogger.histogram(mContext, "opt_coreapps_num_total", coreApps.size()); } EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_PMS_READY, SystemClock.uptimeMillis());
services/core/java/com/android/server/pm/PackageManagerServiceCompilerMapping.java +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ public class PackageManagerServiceCompilerMapping { // Names for compilation reasons. static final String REASON_STRINGS[] = { "first-boot", "boot", "install", "bg-dexopt", "ab-ota", "nsys-library", "shared-apk", "forced-dexopt", "core-app" "forced-dexopt" }; // Static block to ensure the strings array is of the right length. Loading