diff options
author | Jeff Sharkey <jsharkey@android.com> | 2014-07-04 20:18:13 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2014-07-04 21:00:33 -0700 |
commit | 73767b9d607d99b3a027619b5c6b7f1a09b7673d (patch) | |
tree | 4906ccdb54022a1a0b47950c5cb0546c585c75c0 /packages/DefaultContainerService | |
parent | 9810f39717f3625222af9d710f7d8f5acca28449 (diff) | |
download | frameworks_base-73767b9d607d99b3a027619b5c6b7f1a09b7673d.zip frameworks_base-73767b9d607d99b3a027619b5c6b7f1a09b7673d.tar.gz frameworks_base-73767b9d607d99b3a027619b5c6b7f1a09b7673d.tar.bz2 |
Extract native code from split APKs.
In the new split APK world, multiple APKs work together to define a
single package. This means that native code may be split among those
APKs. To handle this, extend NativeLibraryHelper to examine all
APKs in a package ordered by splitName.
A package has valid native code as long as one matching ABI is found
inside. The "best" ABI found across all APKs is picked for the
entire package. No attempt is made to ensure that every native
library defined is available for the picked ABI; that's the
responsibility of the installer.
Re-introduce PackageLite to represent a lightweight parsing of an
entire package, which may be a single monolithic APK or a cluster
of one or more APKs.
Remove native code extraction from InstallerSession, since it'll be
handled inside PMS for this release.
Bug: 14975160
Change-Id: I4f4db0f82e88a46101c7777499ebc0a11fd911f9
Diffstat (limited to 'packages/DefaultContainerService')
-rw-r--r-- | packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java index 74ff3b1..4a61f1f 100644 --- a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java +++ b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java @@ -48,7 +48,7 @@ import android.util.Slog; import com.android.internal.app.IMediaContainerService; import com.android.internal.content.NativeLibraryHelper; -import com.android.internal.content.NativeLibraryHelper.ApkHandle; +import com.android.internal.content.NativeLibraryHelper.Handle; import com.android.internal.content.PackageHelper; import libcore.io.IoUtils; @@ -116,9 +116,9 @@ public class DefaultContainerService extends IntentService { } } - ApkHandle handle = null; + Handle handle = null; try { - handle = ApkHandle.create(packagePath); + handle = Handle.create(new File(packagePath)); return copyResourceInner(packagePath, cid, key, resFileName, publicResFileName, isExternal, isForwardLocked, handle, abiOverride); } catch (IOException ioe) { @@ -349,7 +349,7 @@ public class DefaultContainerService extends IntentService { private String copyResourceInner(String packagePath, String newCid, String key, String resFileName, String publicResFileName, boolean isExternal, boolean isForwardLocked, - ApkHandle handle, String abiOverride) { + Handle handle, String abiOverride) { // The .apk file String codePath = packagePath; File codeFile = new File(codePath); @@ -834,9 +834,9 @@ public class DefaultContainerService extends IntentService { private int calculateContainerSize(File apkFile, boolean forwardLocked, String abiOverride) throws IOException { - ApkHandle handle = null; + Handle handle = null; try { - handle = ApkHandle.create(apkFile); + handle = Handle.create(apkFile); final int abi = NativeLibraryHelper.findSupportedAbi(handle, (abiOverride != null) ? new String[] { abiOverride } : Build.SUPPORTED_ABIS); return calculateContainerSize(handle, apkFile, abi, forwardLocked); @@ -852,7 +852,7 @@ public class DefaultContainerService extends IntentService { * @return size in megabytes (2^20 bytes) * @throws IOException when there is a problem reading the file */ - private int calculateContainerSize(NativeLibraryHelper.ApkHandle apkHandle, + private int calculateContainerSize(NativeLibraryHelper.Handle handle, File apkFile, int abiIndex, boolean forwardLocked) throws IOException { // Calculate size of container needed to hold base APK. long sizeBytes = apkFile.length(); @@ -863,7 +863,7 @@ public class DefaultContainerService extends IntentService { // Check all the native files that need to be copied and add that to the // container size. if (abiIndex >= 0) { - sizeBytes += NativeLibraryHelper.sumNativeBinariesLI(apkHandle, + sizeBytes += NativeLibraryHelper.sumNativeBinariesLI(handle, Build.SUPPORTED_ABIS[abiIndex]); } |