Loading services/core/java/com/android/server/pm/PackageDexOptimizer.java +5 −6 Original line number Original line Diff line number Diff line Loading @@ -82,7 +82,7 @@ final class PackageDexOptimizer { * {@link PackageManagerService#mInstallLock}. * {@link PackageManagerService#mInstallLock}. */ */ int performDexOpt(PackageParser.Package pkg, String[] instructionSets, int performDexOpt(PackageParser.Package pkg, String[] instructionSets, boolean inclDependencies, String volumeUuid, boolean useProfiles, boolean extractOnly) { boolean inclDependencies, boolean useProfiles, boolean extractOnly) { ArraySet<String> done; ArraySet<String> done; if (inclDependencies && (pkg.usesLibraries != null || pkg.usesOptionalLibraries != null)) { if (inclDependencies && (pkg.usesLibraries != null || pkg.usesOptionalLibraries != null)) { done = new ArraySet<String>(); done = new ArraySet<String>(); Loading @@ -97,7 +97,7 @@ final class PackageDexOptimizer { mDexoptWakeLock.acquire(); mDexoptWakeLock.acquire(); } } try { try { return performDexOptLI(pkg, instructionSets, done, volumeUuid, useProfiles, return performDexOptLI(pkg, instructionSets, done, useProfiles, extractOnly); extractOnly); } finally { } finally { if (useLock) { if (useLock) { Loading @@ -108,7 +108,7 @@ final class PackageDexOptimizer { } } private int performDexOptLI(PackageParser.Package pkg, String[] targetInstructionSets, private int performDexOptLI(PackageParser.Package pkg, String[] targetInstructionSets, ArraySet<String> done, String volumeUuid, boolean useProfiles, boolean extractOnly) { ArraySet<String> done, boolean useProfiles, boolean extractOnly) { final String[] instructionSets = targetInstructionSets != null ? final String[] instructionSets = targetInstructionSets != null ? targetInstructionSets : getAppDexInstructionSets(pkg.applicationInfo); targetInstructionSets : getAppDexInstructionSets(pkg.applicationInfo); Loading Loading @@ -185,7 +185,7 @@ final class PackageDexOptimizer { try { try { mPackageManagerService.mInstaller.dexopt(path, sharedGid, mPackageManagerService.mInstaller.dexopt(path, sharedGid, pkg.packageName, dexCodeInstructionSet, dexoptNeeded, oatDir, pkg.packageName, dexCodeInstructionSet, dexoptNeeded, oatDir, dexFlags, volumeUuid, useProfiles); dexFlags, pkg.volumeUuid, useProfiles); performedDexOpt = true; performedDexOpt = true; } catch (InstallerException e) { } catch (InstallerException e) { Slog.w(TAG, "Failed to dexopt", e); Slog.w(TAG, "Failed to dexopt", e); Loading Loading @@ -252,8 +252,7 @@ final class PackageDexOptimizer { if (libPkg != null && !done.contains(libName)) { if (libPkg != null && !done.contains(libName)) { // TODO: Analyze and investigate if we (should) profile libraries. // TODO: Analyze and investigate if we (should) profile libraries. // Currently this will do a full compilation of the library. // Currently this will do a full compilation of the library. performDexOptLI(libPkg, instructionSets, done, performDexOptLI(libPkg, instructionSets, done, /*useProfiles*/ false, StorageManager.UUID_PRIVATE_INTERNAL, /*useProfiles*/ false, /* extractOnly */ false); /* extractOnly */ false); } } } } Loading services/core/java/com/android/server/pm/PackageManagerService.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -6717,7 +6717,7 @@ public class PackageManagerService extends IPackageManager.Stub { synchronized (mInstallLock) { synchronized (mInstallLock) { final String[] instructionSets = new String[] { targetInstructionSet }; final String[] instructionSets = new String[] { targetInstructionSet }; int result = mPackageDexOptimizer.performDexOpt(p, instructionSets, int result = mPackageDexOptimizer.performDexOpt(p, instructionSets, true /* inclDependencies */, p.volumeUuid, useProfiles, extractOnly); true /* inclDependencies */, useProfiles, extractOnly); return result == PackageDexOptimizer.DEX_OPT_PERFORMED; return result == PackageDexOptimizer.DEX_OPT_PERFORMED; } } } finally { } finally { Loading Loading @@ -6762,7 +6762,7 @@ public class PackageManagerService extends IPackageManager.Stub { // Whoever is calling forceDexOpt wants a fully compiled package. // Whoever is calling forceDexOpt wants a fully compiled package. // Don't use profiles since that may cause compilation to be skipped. // Don't use profiles since that may cause compilation to be skipped. final int res = mPackageDexOptimizer.performDexOpt(pkg, instructionSets, final int res = mPackageDexOptimizer.performDexOpt(pkg, instructionSets, true /* inclDependencies */, pkg.volumeUuid, false /* useProfiles */, true /* inclDependencies */, false /* useProfiles */, false /* extractOnly */); false /* extractOnly */); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); Loading Loading @@ -13024,7 +13024,7 @@ public class PackageManagerService extends IPackageManager.Stub { // Do not run PackageDexOptimizer through the local performDexOpt // Do not run PackageDexOptimizer through the local performDexOpt // method because `pkg` is not in `mPackages` yet. // method because `pkg` is not in `mPackages` yet. int result = mPackageDexOptimizer.performDexOpt(pkg, null /* instructionSets */, int result = mPackageDexOptimizer.performDexOpt(pkg, null /* instructionSets */, false /* inclDependencies */, volumeUuid, false /* useProfiles */, false /* inclDependencies */, false /* useProfiles */, true /* extractOnly */); true /* extractOnly */); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); if (result == PackageDexOptimizer.DEX_OPT_FAILED) { if (result == PackageDexOptimizer.DEX_OPT_FAILED) { Loading
services/core/java/com/android/server/pm/PackageDexOptimizer.java +5 −6 Original line number Original line Diff line number Diff line Loading @@ -82,7 +82,7 @@ final class PackageDexOptimizer { * {@link PackageManagerService#mInstallLock}. * {@link PackageManagerService#mInstallLock}. */ */ int performDexOpt(PackageParser.Package pkg, String[] instructionSets, int performDexOpt(PackageParser.Package pkg, String[] instructionSets, boolean inclDependencies, String volumeUuid, boolean useProfiles, boolean extractOnly) { boolean inclDependencies, boolean useProfiles, boolean extractOnly) { ArraySet<String> done; ArraySet<String> done; if (inclDependencies && (pkg.usesLibraries != null || pkg.usesOptionalLibraries != null)) { if (inclDependencies && (pkg.usesLibraries != null || pkg.usesOptionalLibraries != null)) { done = new ArraySet<String>(); done = new ArraySet<String>(); Loading @@ -97,7 +97,7 @@ final class PackageDexOptimizer { mDexoptWakeLock.acquire(); mDexoptWakeLock.acquire(); } } try { try { return performDexOptLI(pkg, instructionSets, done, volumeUuid, useProfiles, return performDexOptLI(pkg, instructionSets, done, useProfiles, extractOnly); extractOnly); } finally { } finally { if (useLock) { if (useLock) { Loading @@ -108,7 +108,7 @@ final class PackageDexOptimizer { } } private int performDexOptLI(PackageParser.Package pkg, String[] targetInstructionSets, private int performDexOptLI(PackageParser.Package pkg, String[] targetInstructionSets, ArraySet<String> done, String volumeUuid, boolean useProfiles, boolean extractOnly) { ArraySet<String> done, boolean useProfiles, boolean extractOnly) { final String[] instructionSets = targetInstructionSets != null ? final String[] instructionSets = targetInstructionSets != null ? targetInstructionSets : getAppDexInstructionSets(pkg.applicationInfo); targetInstructionSets : getAppDexInstructionSets(pkg.applicationInfo); Loading Loading @@ -185,7 +185,7 @@ final class PackageDexOptimizer { try { try { mPackageManagerService.mInstaller.dexopt(path, sharedGid, mPackageManagerService.mInstaller.dexopt(path, sharedGid, pkg.packageName, dexCodeInstructionSet, dexoptNeeded, oatDir, pkg.packageName, dexCodeInstructionSet, dexoptNeeded, oatDir, dexFlags, volumeUuid, useProfiles); dexFlags, pkg.volumeUuid, useProfiles); performedDexOpt = true; performedDexOpt = true; } catch (InstallerException e) { } catch (InstallerException e) { Slog.w(TAG, "Failed to dexopt", e); Slog.w(TAG, "Failed to dexopt", e); Loading Loading @@ -252,8 +252,7 @@ final class PackageDexOptimizer { if (libPkg != null && !done.contains(libName)) { if (libPkg != null && !done.contains(libName)) { // TODO: Analyze and investigate if we (should) profile libraries. // TODO: Analyze and investigate if we (should) profile libraries. // Currently this will do a full compilation of the library. // Currently this will do a full compilation of the library. performDexOptLI(libPkg, instructionSets, done, performDexOptLI(libPkg, instructionSets, done, /*useProfiles*/ false, StorageManager.UUID_PRIVATE_INTERNAL, /*useProfiles*/ false, /* extractOnly */ false); /* extractOnly */ false); } } } } Loading
services/core/java/com/android/server/pm/PackageManagerService.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -6717,7 +6717,7 @@ public class PackageManagerService extends IPackageManager.Stub { synchronized (mInstallLock) { synchronized (mInstallLock) { final String[] instructionSets = new String[] { targetInstructionSet }; final String[] instructionSets = new String[] { targetInstructionSet }; int result = mPackageDexOptimizer.performDexOpt(p, instructionSets, int result = mPackageDexOptimizer.performDexOpt(p, instructionSets, true /* inclDependencies */, p.volumeUuid, useProfiles, extractOnly); true /* inclDependencies */, useProfiles, extractOnly); return result == PackageDexOptimizer.DEX_OPT_PERFORMED; return result == PackageDexOptimizer.DEX_OPT_PERFORMED; } } } finally { } finally { Loading Loading @@ -6762,7 +6762,7 @@ public class PackageManagerService extends IPackageManager.Stub { // Whoever is calling forceDexOpt wants a fully compiled package. // Whoever is calling forceDexOpt wants a fully compiled package. // Don't use profiles since that may cause compilation to be skipped. // Don't use profiles since that may cause compilation to be skipped. final int res = mPackageDexOptimizer.performDexOpt(pkg, instructionSets, final int res = mPackageDexOptimizer.performDexOpt(pkg, instructionSets, true /* inclDependencies */, pkg.volumeUuid, false /* useProfiles */, true /* inclDependencies */, false /* useProfiles */, false /* extractOnly */); false /* extractOnly */); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); Loading Loading @@ -13024,7 +13024,7 @@ public class PackageManagerService extends IPackageManager.Stub { // Do not run PackageDexOptimizer through the local performDexOpt // Do not run PackageDexOptimizer through the local performDexOpt // method because `pkg` is not in `mPackages` yet. // method because `pkg` is not in `mPackages` yet. int result = mPackageDexOptimizer.performDexOpt(pkg, null /* instructionSets */, int result = mPackageDexOptimizer.performDexOpt(pkg, null /* instructionSets */, false /* inclDependencies */, volumeUuid, false /* useProfiles */, false /* inclDependencies */, false /* useProfiles */, true /* extractOnly */); true /* extractOnly */); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); if (result == PackageDexOptimizer.DEX_OPT_FAILED) { if (result == PackageDexOptimizer.DEX_OPT_FAILED) {