diff options
| author | 2017-03-30 21:11:05 +0000 | |
|---|---|---|
| committer | 2017-03-30 21:11:10 +0000 | |
| commit | 474662da390937a95ed2e3b3acdae00c92be47d8 (patch) | |
| tree | e4da55079c6d8f6b9ed233915b9cd75adbdf7fe4 | |
| parent | 60e0c1950565b7ed3883825af54d7808c93eb502 (diff) | |
| parent | 2ab076f611cecb771fe546580634583a27c61aa5 (diff) | |
Merge "Drop REASON_SHARED_APK." into oc-dev
| -rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 56 | ||||
| -rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerServiceCompilerMapping.java | 3 |
2 files changed, 2 insertions, 57 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index a8e096c59e1b..a045e5b6a257 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -537,8 +537,7 @@ public class PackageManagerService extends IPackageManager.Stub { public static final int REASON_INSTALL = 2; public static final int REASON_BACKGROUND_DEXOPT = 3; public static final int REASON_AB_OTA = 4; - public static final int REASON_SHARED_APK = 5; - public static final int REASON_FORCED_DEXOPT = 6; + public static final int REASON_FORCED_DEXOPT = 5; public static final int REASON_LAST = REASON_FORCED_DEXOPT; @@ -2381,59 +2380,6 @@ public class PackageManagerService extends IPackageManager.Stub { Slog.w(TAG, "No SYSTEMSERVERCLASSPATH found!"); } - final List<String> allInstructionSets = InstructionSets.getAllInstructionSets(); - final String[] dexCodeInstructionSets = - getDexCodeInstructionSets( - allInstructionSets.toArray(new String[allInstructionSets.size()])); - - /** - * Ensure all external libraries have had dexopt run on them. - */ - if (mSharedLibraries.size() > 0) { - Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt"); - // NOTE: For now, we're compiling these system "shared libraries" - // (and framework jars) into all available architectures. It's possible - // to compile them only when we come across an app that uses them (there's - // already logic for that in scanPackageLI) but that adds some complexity. - for (String dexCodeInstructionSet : dexCodeInstructionSets) { - final int libCount = mSharedLibraries.size(); - for (int i = 0; i < libCount; i++) { - SparseArray<SharedLibraryEntry> versionedLib = mSharedLibraries.valueAt(i); - final int versionCount = versionedLib.size(); - for (int j = 0; j < versionCount; j++) { - SharedLibraryEntry libEntry = versionedLib.valueAt(j); - final String libPath = libEntry.path != null - ? libEntry.path : libEntry.apk; - if (libPath == null) { - continue; - } - try { - // Shared libraries do not have profiles so we perform a full - // AOT compilation (if needed). - int dexoptNeeded = DexFile.getDexOptNeeded( - libPath, dexCodeInstructionSet, - getCompilerFilterForReason(REASON_SHARED_APK), - false /* newProfile */); - if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) { - mInstaller.dexopt(libPath, Process.SYSTEM_UID, "*", - dexCodeInstructionSet, dexoptNeeded, null, - DEXOPT_PUBLIC, - getCompilerFilterForReason(REASON_SHARED_APK), - StorageManager.UUID_PRIVATE_INTERNAL, - PackageDexOptimizer.SKIP_SHARED_LIBRARY_CHECK); - } - } catch (FileNotFoundException e) { - Slog.w(TAG, "Library not found: " + libPath); - } catch (IOException | InstallerException e) { - Slog.w(TAG, "Cannot dexopt " + libPath + "; is it an APK or JAR? " - + e.getMessage()); - } - } - } - } - Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); - } - File frameworkDir = new File(Environment.getRootDirectory(), "framework"); final VersionInfo ver = mSettings.getInternalVersion(); diff --git a/services/core/java/com/android/server/pm/PackageManagerServiceCompilerMapping.java b/services/core/java/com/android/server/pm/PackageManagerServiceCompilerMapping.java index 987a801c4e1c..f6872e4373fd 100644 --- a/services/core/java/com/android/server/pm/PackageManagerServiceCompilerMapping.java +++ b/services/core/java/com/android/server/pm/PackageManagerServiceCompilerMapping.java @@ -26,7 +26,7 @@ import dalvik.system.DexFile; public class PackageManagerServiceCompilerMapping { // Names for compilation reasons. static final String REASON_STRINGS[] = { - "first-boot", "boot", "install", "bg-dexopt", "ab-ota", "shared-apk", "forced-dexopt" + "first-boot", "boot", "install", "bg-dexopt", "ab-ota", "forced-dexopt" }; // Static block to ensure the strings array is of the right length. @@ -56,7 +56,6 @@ public class PackageManagerServiceCompilerMapping { // Ensure that some reasons are not mapped to profile-guided filters. switch (reason) { - case PackageManagerService.REASON_SHARED_APK: case PackageManagerService.REASON_FORCED_DEXOPT: if (DexFile.isProfileGuidedCompilerFilter(sysPropValue)) { throw new IllegalStateException("\"" + sysPropValue + "\" is profile-guided, " |