summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2014-04-23 16:55:57 -0700
committerNarayan Kamath <narayan@google.com>2014-05-01 13:52:06 +0000
commitc38a807b2f192bd1413989b70cc42ead9299d4b3 (patch)
tree58b0e53fbec9a08244439bb08687ab1b98fc65f2
parentfde594288bff0b8f95567e6b27f273f50f0c5f87 (diff)
downloadbase-c38a807b2f192bd1413989b70cc42ead9299d4b3.tar.gz
Fix native-lib dir assignment & updating
The per-package /system/lib/* feature introduced bugs in the native library path handling during app upgrade installs. The crux of the fix is that when recalulating the desired native library directory, the basis for the calculation needs to be the scanned APK's location rather than the extant package settings entry -- because that entry refers to the pre-upgrade state of the application, not the new state. Bug 14233983 (cherry picked from commit 353e39a973dbbadce82fee2f83ad194e04a47449) Change-Id: I26f17a596ca2cd7f963955c0642548c15138ae26
-rwxr-xr-xservices/java/com/android/server/pm/PackageManagerService.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index be2bd18f5867..800814d5e942 100755
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -4669,7 +4669,6 @@ public class PackageManagerService extends IPackageManager.Stub {
pkg.applicationInfo.nativeLibraryDir = pkgSetting.nativeLibraryPathString;
}
}
-
pkgSetting.uidError = uidError;
}
@@ -5241,7 +5240,8 @@ public class PackageManagerService extends IPackageManager.Stub {
}
}
- private String calculateApkRoot(final File codePath) {
+ private String calculateApkRoot(final String codePathString) {
+ final File codePath = new File(codePathString);
final File codeRoot;
if (FileUtils.contains(Environment.getRootDirectory(), codePath)) {
codeRoot = Environment.getRootDirectory();
@@ -5278,12 +5278,12 @@ public class PackageManagerService extends IPackageManager.Stub {
PackageSetting pkgSetting) {
// "bundled" here means system-installed with no overriding update
final boolean bundledApk = isSystemApp(pkg) && !isUpdatedSystemApp(pkg);
- final String apkName = getApkName(pkgSetting.codePathString);
+ final String apkName = getApkName(pkg.applicationInfo.sourceDir);
final File libDir;
if (bundledApk) {
// If "/system/lib64/apkname" exists, assume that is the per-package
// native library directory to use; otherwise use "/system/lib/apkname".
- String apkRoot = calculateApkRoot(pkgSetting.codePath);
+ String apkRoot = calculateApkRoot(pkg.applicationInfo.sourceDir);
File lib64 = new File(apkRoot, LIB64_DIR_NAME);
File packLib64 = new File(lib64, apkName);
libDir = (packLib64.exists()) ? lib64 : new File(apkRoot, LIB_DIR_NAME);