diff options
| author | Christopher Tate <ctate@google.com> | 2014-04-23 16:55:57 -0700 |
|---|---|---|
| committer | Christopher Tate <ctate@google.com> | 2014-04-24 16:08:12 -0700 |
| commit | 353e39a973dbbadce82fee2f83ad194e04a47449 (patch) | |
| tree | 46a5cad7080d0d10fd50417da1d04bb5da910bcb | |
| parent | 717f39c7d98c7e4b08f7bb88102c720cb8990004 (diff) | |
| download | frameworks_base-353e39a973dbbadce82fee2f83ad194e04a47449.zip frameworks_base-353e39a973dbbadce82fee2f83ad194e04a47449.tar.gz frameworks_base-353e39a973dbbadce82fee2f83ad194e04a47449.tar.bz2 | |
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
Change-Id: I76c3249c72ecc055115d430529d386599e52ae42
| -rwxr-xr-x | services/core/java/com/android/server/pm/PackageManagerService.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 702d9d2..3e61009 100755 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -104,7 +104,6 @@ import android.os.Environment.UserEnvironment; import android.os.FileObserver; import android.os.FileUtils; import android.os.Handler; -import android.os.HandlerThread; import android.os.IBinder; import android.os.Looper; import android.os.Message; @@ -4839,7 +4838,6 @@ public class PackageManagerService extends IPackageManager.Stub { pkg.applicationInfo.nativeLibraryDir = pkgSetting.nativeLibraryPathString; } } - pkgSetting.uidError = uidError; } @@ -5420,7 +5418,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(); @@ -5457,12 +5456,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); |
