diff options
author | emancebo <emancebo@cyngn.com> | 2015-06-04 14:10:22 -0700 |
---|---|---|
committer | emancebo <emancebo@cyngn.com> | 2015-06-09 14:48:04 -0700 |
commit | d4b8568f97a5a126e66f76ab06ea0ad53da48ab9 (patch) | |
tree | a695783e2e96def92ef2a6e002b41bf3e3177d98 | |
parent | 7ce75047f4c1f2a3deeadcd1fe144be7a3203868 (diff) | |
download | android_frameworks_base-staging/cm-12.0-YNG1T-prebundle.tar.gz android_frameworks_base-staging/cm-12.0-YNG1T-prebundle.tar.bz2 android_frameworks_base-staging/cm-12.0-YNG1T-prebundle.zip |
PackageManagerService: override native lib root for prebundled packagesstaging/cm-12.0-YNG1T-prebundle
Prebundled apps are installed directly from the /system/vendor directory which is mounted
read-only. Since we cannot copy native libs there, override the native lib dir so that
we put libs in /data/app-lib/<package name>
Change-Id: I1d492f2cc450e2b92af980bee7da0f874d34a363
-rwxr-xr-x | services/core/java/com/android/server/pm/PackageManagerService.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index d0ef66037c0..7f4c87cb33f 100755 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -6018,7 +6018,7 @@ public class PackageManagerService extends IPackageManager.Stub { } } - setNativeLibraryPaths(pkg); + setNativeLibraryPaths(pkg, parseFlags); } else { // TODO: We can probably be smarter about this stuff. For installed apps, // we can calculate this information at install time once and for all. For @@ -6027,7 +6027,7 @@ public class PackageManagerService extends IPackageManager.Stub { // Give ourselves some initial paths; we'll come back for another // pass once we've determined ABI below. - setNativeLibraryPaths(pkg); + setNativeLibraryPaths(pkg, parseFlags); final boolean isAsec = isForwardLocked(pkg) || isExternal(pkg); final String nativeLibraryRootStr = pkg.applicationInfo.nativeLibraryRootDir; @@ -6165,7 +6165,7 @@ public class PackageManagerService extends IPackageManager.Stub { // Now that we've calculated the ABIs and determined if it's an internal app, // we will go ahead and populate the nativeLibraryPath. - setNativeLibraryPaths(pkg); + setNativeLibraryPaths(pkg, parseFlags); if (DEBUG_INSTALL) Slog.i(TAG, "Linking native library dir for " + path); final int[] userIds = sUserManager.getUserIds(); @@ -7315,7 +7315,7 @@ public class PackageManagerService extends IPackageManager.Stub { * Derive and set the location of native libraries for the given package, * which varies depending on where and how the package was installed. */ - private void setNativeLibraryPaths(PackageParser.Package pkg) { + private void setNativeLibraryPaths(PackageParser.Package pkg, int parseFlags) { final ApplicationInfo info = pkg.applicationInfo; final String codePath = pkg.codePath; final File codeFile = new File(codePath); @@ -7361,10 +7361,13 @@ public class PackageManagerService extends IPackageManager.Stub { info.nativeLibraryRootRequiresIsa = false; info.nativeLibraryDir = info.nativeLibraryRootDir; } else { - // Cluster install - info.nativeLibraryRootDir = new File(codeFile, LIB_DIR_NAME).getAbsolutePath(); + if ((parseFlags & PackageParser.PARSE_IS_PREBUNDLED_DIR) != 0) { + info.nativeLibraryRootDir = + new File(mAppLib32InstallDir, pkg.packageName).getAbsolutePath(); + } else { + info.nativeLibraryRootDir = new File(codeFile, LIB_DIR_NAME).getAbsolutePath(); + } info.nativeLibraryRootRequiresIsa = true; - info.nativeLibraryDir = new File(info.nativeLibraryRootDir, getPrimaryInstructionSet(info)).getAbsolutePath(); |