Merge "Remove support for dexopting shared libraries."
This commit is contained in:
@@ -150,51 +150,6 @@ public class PackageDexOptimizer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int performDexOpt(SharedLibraryInfo info, String[] instructionSets, DexoptOptions options) {
|
|
||||||
String classLoaderContext = DexoptUtils.getClassLoaderContext(info);
|
|
||||||
final String[] dexCodeInstructionSets = getDexCodeInstructionSets(instructionSets);
|
|
||||||
String compilerFilter = PackageManagerServiceCompilerMapping.getCompilerFilterForReason(
|
|
||||||
PackageManagerService.REASON_SHARED);
|
|
||||||
int result = DEX_OPT_SKIPPED;
|
|
||||||
for (String instructionSet : dexCodeInstructionSets) {
|
|
||||||
int dexoptNeeded = getDexoptNeeded(
|
|
||||||
info.getPath(), instructionSet, compilerFilter,
|
|
||||||
classLoaderContext, false /* newProfile */,
|
|
||||||
false /* downgrade */);
|
|
||||||
if (Math.abs(dexoptNeeded) == DexFile.NO_DEXOPT_NEEDED) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// Special string recognized by installd.
|
|
||||||
final String packageName = "*";
|
|
||||||
final String outputPath = null;
|
|
||||||
int dexFlags = DEXOPT_PUBLIC
|
|
||||||
| (options.isBootComplete() ? DEXOPT_BOOTCOMPLETE : 0)
|
|
||||||
| (options.isDexoptIdleBackgroundJob() ? DEXOPT_IDLE_BACKGROUND_JOB : 0);
|
|
||||||
dexFlags = adjustDexoptFlags(dexFlags);
|
|
||||||
final String uuid = StorageManager.UUID_SYSTEM;
|
|
||||||
final String seInfo = null;
|
|
||||||
final int targetSdkVersion = 0; // Builtin libraries targets the system's SDK version
|
|
||||||
try {
|
|
||||||
mInstaller.dexopt(info.getPath(), Process.SYSTEM_UID, packageName,
|
|
||||||
instructionSet, dexoptNeeded, outputPath, dexFlags, compilerFilter,
|
|
||||||
uuid, classLoaderContext, seInfo, false /* downgrade */,
|
|
||||||
targetSdkVersion, /*profileName*/ null, /*dexMetadataPath*/ null,
|
|
||||||
getReasonName(options.getCompilationReason()));
|
|
||||||
// The end result is:
|
|
||||||
// - FAILED if any path failed,
|
|
||||||
// - PERFORMED if at least one path needed compilation,
|
|
||||||
// - SKIPPED when all paths are up to date
|
|
||||||
if (result != DEX_OPT_FAILED) {
|
|
||||||
result = DEX_OPT_PERFORMED;
|
|
||||||
}
|
|
||||||
} catch (InstallerException e) {
|
|
||||||
Slog.w(TAG, "Failed to dexopt", e);
|
|
||||||
result = DEX_OPT_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs dexopt on all code paths of the given package.
|
* Performs dexopt on all code paths of the given package.
|
||||||
* It assumes the install lock is held.
|
* It assumes the install lock is held.
|
||||||
|
|||||||
@@ -9463,7 +9463,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
mDexManager.getPackageUseInfoOrDefault(depPackage.packageName),
|
mDexManager.getPackageUseInfoOrDefault(depPackage.packageName),
|
||||||
libraryOptions);
|
libraryOptions);
|
||||||
} else {
|
} else {
|
||||||
pdo.performDexOpt(info, instructionSets, libraryOptions);
|
// TODO(ngeoffray): Support dexopting system shared libraries.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user