OtaDexopt: Special-case system app classpaths
Specialize system apps' shared libraries so that classpath checks are elided. Bug: 30568568 Change-Id: Id1f2555ef43984b616e01f8596701ccba77895b3
This commit is contained in:
@@ -50,6 +50,9 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
|
||||
private final static String TAG = "OTADexopt";
|
||||
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 PackageManagerService mPackageManagerService;
|
||||
|
||||
@@ -202,7 +205,13 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
|
||||
PackageDexOptimizer optimizer = new OTADexoptPackageDexOptimizer(
|
||||
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 */,
|
||||
getCompilerFilterForReason(compilationReason),
|
||||
null /* CompilerStats.PackageStats */);
|
||||
|
||||
Reference in New Issue
Block a user