summaryrefslogtreecommitdiffstats
path: root/services/java/com
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-10-05 14:07:29 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-05 14:07:29 -0700
commitcfc80bd5c1e4f0207357b288b1b7b8374a31ba70 (patch)
treeaf7fec5abe8531cca78b7a9a0cbf972b1ca0f00d /services/java/com
parent56364bcd0d1a1b064db3e83fdb64f948ce5c2ad7 (diff)
parent2c3360fe9c03536cbfd77267170b73c120c071ac (diff)
downloadframeworks_base-cfc80bd5c1e4f0207357b288b1b7b8374a31ba70.zip
frameworks_base-cfc80bd5c1e4f0207357b288b1b7b8374a31ba70.tar.gz
frameworks_base-cfc80bd5c1e4f0207357b288b1b7b8374a31ba70.tar.bz2
am 2c3360fe: Merge "Remove lingering system app native libs in /data" into gingerbread
Merge commit '2c3360fe9c03536cbfd77267170b73c120c071ac' into gingerbread-plus-aosp * commit '2c3360fe9c03536cbfd77267170b73c120c071ac': Remove lingering system app native libs in /data
Diffstat (limited to 'services/java/com')
-rw-r--r--services/java/com/android/server/PackageManagerService.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 58ea4db..050e0c8 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -140,7 +140,6 @@ class PackageManagerService extends IPackageManager.Stub {
private static final boolean DEBUG_PREFERRED = false;
private static final boolean DEBUG_UPGRADE = false;
private static final boolean DEBUG_INSTALL = false;
- private static final boolean DEBUG_NATIVE = false;
private static final boolean MULTIPLE_APPLICATION_UIDS = true;
private static final int RADIO_UID = Process.PHONE_UID;
@@ -3276,10 +3275,23 @@ class PackageManagerService extends IPackageManager.Stub {
* In other words, we're going to unpack the binaries
* only for non-system apps and system app upgrades.
*/
- if ((!isSystemApp(pkg) || isUpdatedSystemApp(pkg)) && !isExternal(pkg)) {
- Log.i(TAG, path + " changed; unpacking");
- File sharedLibraryDir = new File(pkg.applicationInfo.nativeLibraryDir);
- NativeLibraryHelper.copyNativeBinariesLI(scanFile, sharedLibraryDir);
+ if (pkg.applicationInfo.nativeLibraryDir != null) {
+ final File sharedLibraryDir = new File(pkg.applicationInfo.nativeLibraryDir);
+ if (isSystemApp(pkg) && !isUpdatedSystemApp(pkg)) {
+ /*
+ * Upgrading from a previous version of the OS sometimes
+ * leaves native libraries in the /data/data/<app>/lib
+ * directory for system apps even when they shouldn't be.
+ * Recent changes in the JNI library search path
+ * necessitates we remove those to match previous behavior.
+ */
+ if (NativeLibraryHelper.removeNativeBinariesFromDirLI(sharedLibraryDir)) {
+ Log.i(TAG, "removed obsolete native libraries for system package " + path);
+ }
+ } else if (!isExternal(pkg)) {
+ Log.i(TAG, path + " changed; unpacking");
+ NativeLibraryHelper.copyNativeBinariesLI(scanFile, sharedLibraryDir);
+ }
}
pkg.mScanPath = path;