diff options
| author | Todd Kennedy <toddke@google.com> | 2016-05-11 14:35:18 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-05-11 14:35:19 +0000 |
| commit | f09f0699369c02a6a46fbff68c02b00a7c703697 (patch) | |
| tree | 26cdea6e3de393772d364f9696243e9aab6251d8 /core/java/android/app/ActivityThread.java | |
| parent | 25118d1aa2274d258c183187b90963a11840b0f3 (diff) | |
| parent | e713efcac103f3d8083ec9d5b00c528af7266b21 (diff) | |
Merge "Fix secondary ABI instrumetion" into nyc-dev
Diffstat (limited to 'core/java/android/app/ActivityThread.java')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 061d924fa529..e54edf2a574b 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -4957,6 +4957,31 @@ public final class ActivityThread { } } + /** + * Returns the correct library directory for the current ABI. + * <p> + * If we're dealing with a multi-arch application that has both 32 and 64 bit shared + * libraries, we might need to choose the secondary depending on what the current + * runtime's instruction set is. + */ + private String getInstrumentationLibrary(ApplicationInfo appInfo, InstrumentationInfo insInfo) { + if (appInfo.primaryCpuAbi != null && appInfo.secondaryCpuAbi != null) { + // Get the instruction set supported by the secondary ABI. In the presence + // of a native bridge this might be different than the one secondary ABI used. + String secondaryIsa = + VMRuntime.getInstructionSet(appInfo.secondaryCpuAbi); + final String secondaryDexCodeIsa = + SystemProperties.get("ro.dalvik.vm.isa." + secondaryIsa); + secondaryIsa = secondaryDexCodeIsa.isEmpty() ? secondaryIsa : secondaryDexCodeIsa; + + final String runtimeIsa = VMRuntime.getRuntime().vmInstructionSet(); + if (runtimeIsa.equals(secondaryIsa)) { + return insInfo.secondaryNativeLibraryDir; + } + } + return insInfo.nativeLibraryDir; + } + private void handleBindApplication(AppBindData data) { // Register the UI Thread as a sensitive thread to the runtime. VMRuntime.registerSensitiveThread(); @@ -5130,7 +5155,7 @@ public final class ActivityThread { mInstrumentationPackageName = ii.packageName; mInstrumentationAppDir = ii.sourceDir; mInstrumentationSplitAppDirs = ii.splitSourceDirs; - mInstrumentationLibDir = ii.nativeLibraryDir; + mInstrumentationLibDir = getInstrumentationLibrary(data.appInfo, ii); mInstrumentedAppDir = data.info.getAppDir(); mInstrumentedSplitAppDirs = data.info.getSplitAppDirs(); mInstrumentedLibDir = data.info.getLibDir(); |
