Loading core/java/android/content/pm/PackageParser.java +11 −0 Original line number Diff line number Diff line Loading @@ -4520,6 +4520,17 @@ public class PackageParser { return applicationInfo.isUpdatedSystemApp(); } /** * @hide */ public boolean canHaveOatDir() { // The following app types CANNOT have oat directory // - non-updated system apps // - forward-locked apps or apps installed in ASEC containers return (!isSystemApp() || isUpdatedSystemApp()) && !isForwardLocked() && !applicationInfo.isExternalAsec(); } public String toString() { return "Package{" + Integer.toHexString(System.identityHashCode(this)) Loading services/core/java/com/android/server/pm/PackageDexOptimizer.java +1 −2 Original line number Diff line number Diff line Loading @@ -217,8 +217,7 @@ final class PackageDexOptimizer { @Nullable private String createOatDirIfSupported(PackageParser.Package pkg, String dexInstructionSet) throws IOException { if ((pkg.isSystemApp() && !pkg.isUpdatedSystemApp()) || pkg.isForwardLocked() || pkg.applicationInfo.isExternalAsec()) { if (!pkg.canHaveOatDir()) { return null; } File codePath = new File(pkg.codePath); Loading services/core/java/com/android/server/pm/PackageManagerService.java +15 −1 Original line number Diff line number Diff line Loading @@ -13628,7 +13628,21 @@ public class PackageManagerService extends IPackageManager.Stub { // TODO(multiArch): Extend getSizeInfo to look at *all* instruction sets, not // just the primary. String[] dexCodeInstructionSets = getDexCodeInstructionSets(getAppDexInstructionSets(ps)); int res = mInstaller.getSizeInfo(p.volumeUuid, packageName, userHandle, p.baseCodePath, String apkPath; File packageDir = new File(p.codePath); if (packageDir.isDirectory() && p.canHaveOatDir()) { apkPath = packageDir.getAbsolutePath(); // If libDirRoot is inside a package dir, set it to null to avoid it being counted twice if (libDirRoot != null && libDirRoot.startsWith(apkPath)) { libDirRoot = null; } } else { apkPath = p.baseCodePath; } int res = mInstaller.getSizeInfo(p.volumeUuid, packageName, userHandle, apkPath, libDirRoot, publicSrcDir, asecPath, dexCodeInstructionSets, pStats); if (res < 0) { return false; Loading
core/java/android/content/pm/PackageParser.java +11 −0 Original line number Diff line number Diff line Loading @@ -4520,6 +4520,17 @@ public class PackageParser { return applicationInfo.isUpdatedSystemApp(); } /** * @hide */ public boolean canHaveOatDir() { // The following app types CANNOT have oat directory // - non-updated system apps // - forward-locked apps or apps installed in ASEC containers return (!isSystemApp() || isUpdatedSystemApp()) && !isForwardLocked() && !applicationInfo.isExternalAsec(); } public String toString() { return "Package{" + Integer.toHexString(System.identityHashCode(this)) Loading
services/core/java/com/android/server/pm/PackageDexOptimizer.java +1 −2 Original line number Diff line number Diff line Loading @@ -217,8 +217,7 @@ final class PackageDexOptimizer { @Nullable private String createOatDirIfSupported(PackageParser.Package pkg, String dexInstructionSet) throws IOException { if ((pkg.isSystemApp() && !pkg.isUpdatedSystemApp()) || pkg.isForwardLocked() || pkg.applicationInfo.isExternalAsec()) { if (!pkg.canHaveOatDir()) { return null; } File codePath = new File(pkg.codePath); Loading
services/core/java/com/android/server/pm/PackageManagerService.java +15 −1 Original line number Diff line number Diff line Loading @@ -13628,7 +13628,21 @@ public class PackageManagerService extends IPackageManager.Stub { // TODO(multiArch): Extend getSizeInfo to look at *all* instruction sets, not // just the primary. String[] dexCodeInstructionSets = getDexCodeInstructionSets(getAppDexInstructionSets(ps)); int res = mInstaller.getSizeInfo(p.volumeUuid, packageName, userHandle, p.baseCodePath, String apkPath; File packageDir = new File(p.codePath); if (packageDir.isDirectory() && p.canHaveOatDir()) { apkPath = packageDir.getAbsolutePath(); // If libDirRoot is inside a package dir, set it to null to avoid it being counted twice if (libDirRoot != null && libDirRoot.startsWith(apkPath)) { libDirRoot = null; } } else { apkPath = p.baseCodePath; } int res = mInstaller.getSizeInfo(p.volumeUuid, packageName, userHandle, apkPath, libDirRoot, publicSrcDir, asecPath, dexCodeInstructionSets, pStats); if (res < 0) { return false;