OtaDexopt: Special-case system app classpaths

am: c7e02c1d2a

Change-Id: I11bdba24aec736f1ef3e1023acab63a9680c6183
This commit is contained in:
Andreas Gampe
2016-08-04 04:30:07 +00:00
committed by android-build-merger

View File

@@ -50,6 +50,9 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
private final static String TAG = "OTADexopt"; private final static String TAG = "OTADexopt";
private final static boolean DEBUG_DEXOPT = true; private final static boolean DEBUG_DEXOPT = true;
// The synthetic library dependencies denoting "no checks."
private final static String[] NO_LIBRARIES = new String[] { "&" };
private final Context mContext; private final Context mContext;
private final PackageManagerService mPackageManagerService; private final PackageManagerService mPackageManagerService;
@@ -202,7 +205,13 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
PackageDexOptimizer optimizer = new OTADexoptPackageDexOptimizer( PackageDexOptimizer optimizer = new OTADexoptPackageDexOptimizer(
collectingInstaller, mPackageManagerService.mInstallLock, mContext); collectingInstaller, mPackageManagerService.mInstallLock, mContext);
optimizer.performDexOpt(pkg, pkg.usesLibraryFiles, String[] libraryDependencies = pkg.usesLibraryFiles;
if (pkg.isSystemApp()) {
// For system apps, we want to avoid classpaths checks.
libraryDependencies = NO_LIBRARIES;
}
optimizer.performDexOpt(pkg, libraryDependencies,
null /* ISAs */, false /* checkProfiles */, null /* ISAs */, false /* checkProfiles */,
getCompilerFilterForReason(compilationReason), getCompilerFilterForReason(compilationReason),
null /* CompilerStats.PackageStats */); null /* CompilerStats.PackageStats */);