summaryrefslogtreecommitdiffstats
path: root/packages/DefaultContainerService
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-05-16 16:45:56 +0100
committerNarayan Kamath <narayan@google.com>2014-06-03 12:58:35 +0100
commitd47e38b6342fea93b007319431634a4bcfee452c (patch)
tree4f6365ddf8421fbe2c4238d26ab53d005cc0976e /packages/DefaultContainerService
parent7ed98c43f8cbcfbb4862205a72455ab39359a011 (diff)
downloadframeworks_base-d47e38b6342fea93b007319431634a4bcfee452c.zip
frameworks_base-d47e38b6342fea93b007319431634a4bcfee452c.tar.gz
frameworks_base-d47e38b6342fea93b007319431634a4bcfee452c.tar.bz2
Scan for renderscript files before deciding ABIs.
The presence of ".bc" files in an APK implies incompatibility with any of the 64 bit ABIs. bug: 14900093 Change-Id: I66ca339a9a149cb3b7e7b349033d80acdeb4140a
Diffstat (limited to 'packages/DefaultContainerService')
-rw-r--r--packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
index b02aefc..e4de641 100644
--- a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
+++ b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
@@ -88,7 +88,7 @@ public class DefaultContainerService extends IntentService {
private IMediaContainerService.Stub mBinder = new IMediaContainerService.Stub() {
/**
* Creates a new container and copies resource there.
- * @param paackageURI the uri of resource to be copied. Can be either
+ * @param packageURI the uri of resource to be copied. Can be either
* a content uri or a file uri
* @param cid the id of the secure container that should
* be used for creating a secure container into which the resource
@@ -342,9 +342,22 @@ public class DefaultContainerService extends IntentService {
// The .apk file
String codePath = packageURI.getPath();
File codeFile = new File(codePath);
- String[] abiList = (abiOverride != null) ? new String[] { abiOverride }
- : Build.SUPPORTED_ABIS;
NativeLibraryHelper.ApkHandle handle = new NativeLibraryHelper.ApkHandle(codePath);
+ String[] abiList = Build.SUPPORTED_ABIS;
+ if (abiOverride != null) {
+ abiList = new String[] { abiList };
+ } else {
+ try {
+ if (Build.SUPPORTED_64_BIT_ABIS.length > 0 &&
+ NativeLibraryHelper.hasRenderscriptBitcode(handle)) {
+ abiList = Build.SUPPORTED_32_BIT_ABIS;
+ }
+ } catch (IOException ioe) {
+ Slog.w(TAG, "Problem determining ABI for: " + codeFile.getPath());
+ return null;
+ }
+ }
+
final int abi = NativeLibraryHelper.findSupportedAbi(handle, abiList);
// Calculate size of container needed to hold base APK.