summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorFyodor Kupolov <fkupolov@google.com>2015-09-16 19:37:47 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-09-16 19:37:47 +0000
commitbfc584df683a84dffd8e04b7b13f619606a0a42a (patch)
tree1b39a0ce3749939de9a5166b6bdaffca5c4772a9 /services
parent870a9e6a783c7755b059d8533ae0232873bff9ba (diff)
parentebcac16cb1405bf7d0b570e11a287df078edfc1c (diff)
downloadframeworks_base-bfc584df683a84dffd8e04b7b13f619606a0a42a.zip
frameworks_base-bfc584df683a84dffd8e04b7b13f619606a0a42a.tar.gz
frameworks_base-bfc584df683a84dffd8e04b7b13f619606a0a42a.tar.bz2
Merge "Use app directory as apkPath for cluster installs" into mnc-dr-dev
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/pm/PackageDexOptimizer.java3
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java16
2 files changed, 16 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
index 7024ec8..8c23648 100644
--- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java
+++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
@@ -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);
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 96c5460..3330a50 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -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;