summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-10-19 09:28:28 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-19 09:28:28 -0700
commit928b07480bc5372f2b959bce7b4a3b49651b49b8 (patch)
treeacc3ba2df960bd4d7658af313fd889b8c7d3d8ba /services/java
parentf73d48d754b11f6ed0fba017f5bc8f27acdfbe4f (diff)
parente68d58a2981827c6f54245fb62e70303a6a7ddb8 (diff)
downloadframeworks_base-928b07480bc5372f2b959bce7b4a3b49651b49b8.zip
frameworks_base-928b07480bc5372f2b959bce7b4a3b49651b49b8.tar.gz
frameworks_base-928b07480bc5372f2b959bce7b4a3b49651b49b8.tar.bz2
Merge "Don't symlink native library paths for old apps" into gingerbread
Diffstat (limited to 'services/java')
-rw-r--r--services/java/com/android/server/PackageManagerService.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index cc7a027..c7735d9 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -3286,7 +3286,9 @@ class PackageManagerService extends IPackageManager.Stub {
* only for non-system apps and system app upgrades.
*/
if (pkg.applicationInfo.nativeLibraryDir != null) {
- final File sharedLibraryDir = new File(pkg.applicationInfo.nativeLibraryDir);
+ final File nativeLibraryDir = new File(pkg.applicationInfo.nativeLibraryDir);
+ final String dataPathString = dataPath.getPath();
+
if (isSystemApp(pkg) && !isUpdatedSystemApp(pkg)) {
/*
* Upgrading from a previous version of the OS sometimes
@@ -3295,15 +3297,24 @@ class PackageManagerService extends IPackageManager.Stub {
* Recent changes in the JNI library search path
* necessitates we remove those to match previous behavior.
*/
- if (NativeLibraryHelper.removeNativeBinariesFromDirLI(sharedLibraryDir)) {
+ if (NativeLibraryHelper.removeNativeBinariesFromDirLI(nativeLibraryDir)) {
Log.i(TAG, "removed obsolete native libraries for system package " + path);
}
- } else if (!isExternal(pkg)) {
- Log.i(TAG, path + " changed; unpacking");
- mInstaller.unlinkNativeLibraryDirectory(dataPath.getPath());
- NativeLibraryHelper.copyNativeBinariesLI(scanFile, sharedLibraryDir);
+ } else if (nativeLibraryDir.getParent().equals(dataPathString)) {
+ /*
+ * If this is an internal application or our
+ * nativeLibraryPath points to our data directory, unpack
+ * the libraries. The native library path pointing to the
+ * data directory for an application in an ASEC container
+ * can happen for older apps that existed before an OTA to
+ * Gingerbread.
+ */
+ Slog.i(TAG, "Unpacking native libraries for " + path);
+ mInstaller.unlinkNativeLibraryDirectory(dataPathString);
+ NativeLibraryHelper.copyNativeBinariesLI(scanFile, nativeLibraryDir);
} else {
- mInstaller.linkNativeLibraryDirectory(dataPath.getPath(),
+ Slog.i(TAG, "Linking native library dir for " + path);
+ mInstaller.linkNativeLibraryDirectory(dataPathString,
pkg.applicationInfo.nativeLibraryDir);
}
}