Loading services/core/java/com/android/server/pm/DexOptHelper.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -385,6 +385,11 @@ final class DexOptHelper { } else if (snapshot.isInstantApp(options.getPackageName(), UserHandle.getCallingUserId())) { } else if (snapshot.isInstantApp(options.getPackageName(), UserHandle.getCallingUserId())) { return false; return false; } } var pkg = snapshot.getPackage(options.getPackageName()); if (pkg != null && pkg.isApex()) { // skip APEX return true; } if (options.isDexoptOnlySecondaryDex()) { if (options.isDexoptOnlySecondaryDex()) { return mPm.getDexManager().dexoptSecondaryDex(options); return mPm.getDexManager().dexoptSecondaryDex(options); Loading Loading @@ -427,6 +432,10 @@ final class DexOptHelper { // Package could not be found. Report failure. // Package could not be found. Report failure. return PackageDexOptimizer.DEX_OPT_FAILED; return PackageDexOptimizer.DEX_OPT_FAILED; } } if (p.isApex()) { // APEX needs no dexopt return PackageDexOptimizer.DEX_OPT_SKIPPED; } mPm.getPackageUsage().maybeWriteAsync(mPm.mSettings.getPackagesLocked()); mPm.getPackageUsage().maybeWriteAsync(mPm.mSettings.getPackagesLocked()); mPm.mCompilerStats.maybeWriteAsync(); mPm.mCompilerStats.maybeWriteAsync(); } } Loading Loading @@ -498,6 +507,9 @@ final class DexOptHelper { if (packageState == null || pkg == null) { if (packageState == null || pkg == null) { throw new IllegalArgumentException("Unknown package: " + packageName); throw new IllegalArgumentException("Unknown package: " + packageName); } } if (pkg.isApex()) { throw new IllegalArgumentException("Can't dexopt APEX package: " + packageName); } Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt"); Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt"); Loading services/core/java/com/android/server/pm/PackageDexOptimizer.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -189,6 +189,11 @@ public class PackageDexOptimizer { return false; return false; } } // We do not dexopt APEX packages. if (pkg.isApex()) { return false; } // We do not dexopt unused packages. // We do not dexopt unused packages. // It's possible for this to be called before app hibernation service is ready due to // It's possible for this to be called before app hibernation service is ready due to // an OTA dexopt. In this case, we ignore the hibernation check here. This is fine since // an OTA dexopt. In this case, we ignore the hibernation check here. This is fine since Loading Loading
services/core/java/com/android/server/pm/DexOptHelper.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -385,6 +385,11 @@ final class DexOptHelper { } else if (snapshot.isInstantApp(options.getPackageName(), UserHandle.getCallingUserId())) { } else if (snapshot.isInstantApp(options.getPackageName(), UserHandle.getCallingUserId())) { return false; return false; } } var pkg = snapshot.getPackage(options.getPackageName()); if (pkg != null && pkg.isApex()) { // skip APEX return true; } if (options.isDexoptOnlySecondaryDex()) { if (options.isDexoptOnlySecondaryDex()) { return mPm.getDexManager().dexoptSecondaryDex(options); return mPm.getDexManager().dexoptSecondaryDex(options); Loading Loading @@ -427,6 +432,10 @@ final class DexOptHelper { // Package could not be found. Report failure. // Package could not be found. Report failure. return PackageDexOptimizer.DEX_OPT_FAILED; return PackageDexOptimizer.DEX_OPT_FAILED; } } if (p.isApex()) { // APEX needs no dexopt return PackageDexOptimizer.DEX_OPT_SKIPPED; } mPm.getPackageUsage().maybeWriteAsync(mPm.mSettings.getPackagesLocked()); mPm.getPackageUsage().maybeWriteAsync(mPm.mSettings.getPackagesLocked()); mPm.mCompilerStats.maybeWriteAsync(); mPm.mCompilerStats.maybeWriteAsync(); } } Loading Loading @@ -498,6 +507,9 @@ final class DexOptHelper { if (packageState == null || pkg == null) { if (packageState == null || pkg == null) { throw new IllegalArgumentException("Unknown package: " + packageName); throw new IllegalArgumentException("Unknown package: " + packageName); } } if (pkg.isApex()) { throw new IllegalArgumentException("Can't dexopt APEX package: " + packageName); } Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt"); Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt"); Loading
services/core/java/com/android/server/pm/PackageDexOptimizer.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -189,6 +189,11 @@ public class PackageDexOptimizer { return false; return false; } } // We do not dexopt APEX packages. if (pkg.isApex()) { return false; } // We do not dexopt unused packages. // We do not dexopt unused packages. // It's possible for this to be called before app hibernation service is ready due to // It's possible for this to be called before app hibernation service is ready due to // an OTA dexopt. In this case, we ignore the hibernation check here. This is fine since // an OTA dexopt. In this case, we ignore the hibernation check here. This is fine since Loading