Merge "don't dex when installing an instant app" into oc-dev

am: d5f3bd46a1

Change-Id: Ia27a62acce14f8dbce07ceef942f0059ed8875cc
This commit is contained in:
Todd Kennedy
2017-05-18 19:45:12 +00:00
committed by android-build-merger

View File

@@ -17526,17 +17526,24 @@ public class PackageManagerService extends IPackageManager.Stub
} }
} }
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt"); // dexopt can take some time to complete, so, for instant apps, we skip this
// Do not run PackageDexOptimizer through the local performDexOpt // step during installation. Instead, we'll take extra time the first time the
// method because `pkg` may not be in `mPackages` yet. // instant app starts. It's preferred to do it this way to provide continuous
// // progress to the user instead of mysteriously blocking somewhere in the
// Also, don't fail application installs if the dexopt step fails. // middle of running an instant app.
mPackageDexOptimizer.performDexOpt(pkg, pkg.usesLibraryFiles, if (!instantApp) {
null /* instructionSets */, false /* checkProfiles */, Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt");
getCompilerFilterForReason(REASON_INSTALL), // Do not run PackageDexOptimizer through the local performDexOpt
getOrCreateCompilerPackageStats(pkg), // method because `pkg` may not be in `mPackages` yet.
mDexManager.isUsedByOtherApps(pkg.packageName)); //
Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); // Also, don't fail application installs if the dexopt step fails.
mPackageDexOptimizer.performDexOpt(pkg, pkg.usesLibraryFiles,
null /* instructionSets */, false /* checkProfiles */,
getCompilerFilterForReason(REASON_INSTALL),
getOrCreateCompilerPackageStats(pkg),
mDexManager.isUsedByOtherApps(pkg.packageName));
Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
}
// Notify BackgroundDexOptService that the package has been changed. // Notify BackgroundDexOptService that the package has been changed.
// If this is an update of a package which used to fail to compile, // If this is an update of a package which used to fail to compile,