diff options
author | Jeff Sharkey <jsharkey@android.com> | 2014-07-21 13:01:59 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2014-07-21 13:28:16 -0700 |
commit | 603862517569cbebed9a7bd231c3fb80292d4bcd (patch) | |
tree | e20ed7150640048640001c13ed6d10ca9c45cb16 /services | |
parent | 8207c58490e977e87079cc6ca85c85b673f5cf50 (diff) | |
download | frameworks_base-603862517569cbebed9a7bd231c3fb80292d4bcd.zip frameworks_base-603862517569cbebed9a7bd231c3fb80292d4bcd.tar.gz frameworks_base-603862517569cbebed9a7bd231c3fb80292d4bcd.tar.bz2 |
Detect bundled app ABI for cluster-style layout.
Now that build system switched to cluster-style layout for bundled
apps, we need to detect primary/secondary ABI based on that layout.
Bug: 16456263
Change-Id: If6daf60ee1815bb6fde560a0c373b4f2bc8bd3a8
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index a70dd1b..77fd409 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -6312,10 +6312,32 @@ public class PackageManagerService extends IPackageManager.Stub { * @param apkName the name of the installed package. */ private static void setBundledAppAbi(PackageParser.Package pkg, String apkRoot, String apkName) { - // This is of the form "/system/lib64/<packagename>", "/vendor/lib64/<packagename>" - // or similar. - final boolean has64BitLibs = (new File(apkRoot, new File(LIB64_DIR_NAME, apkName).getPath())).exists(); - final boolean has32BitLibs = (new File(apkRoot, new File(LIB_DIR_NAME, apkName).getPath())).exists(); + final File codeFile = new File(pkg.codePath); + + final boolean has64BitLibs; + final boolean has32BitLibs; + if (isApkFile(codeFile)) { + // Monolithic install + has64BitLibs = (new File(apkRoot, new File(LIB64_DIR_NAME, apkName).getPath())).exists(); + has32BitLibs = (new File(apkRoot, new File(LIB_DIR_NAME, apkName).getPath())).exists(); + } else { + // Cluster install + final File rootDir = new File(codeFile, LIB_DIR_NAME); + if (!ArrayUtils.isEmpty(Build.SUPPORTED_64_BIT_ABIS) + && !TextUtils.isEmpty(Build.SUPPORTED_64_BIT_ABIS[0])) { + final String isa = VMRuntime.getInstructionSet(Build.SUPPORTED_64_BIT_ABIS[0]); + has64BitLibs = (new File(rootDir, isa)).exists(); + } else { + has64BitLibs = false; + } + if (!ArrayUtils.isEmpty(Build.SUPPORTED_32_BIT_ABIS) + && !TextUtils.isEmpty(Build.SUPPORTED_32_BIT_ABIS[0])) { + final String isa = VMRuntime.getInstructionSet(Build.SUPPORTED_32_BIT_ABIS[0]); + has32BitLibs = (new File(rootDir, isa)).exists(); + } else { + has32BitLibs = false; + } + } if (has64BitLibs && !has32BitLibs) { // The package has 64 bit libs, but not 32 bit libs. Its primary |