Loading core/java/android/app/ActivityThread.java +26 −1 Original line number Original line Diff line number Diff line Loading @@ -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) { private void handleBindApplication(AppBindData data) { // Register the UI Thread as a sensitive thread to the runtime. // Register the UI Thread as a sensitive thread to the runtime. VMRuntime.registerSensitiveThread(); VMRuntime.registerSensitiveThread(); Loading Loading @@ -5130,7 +5155,7 @@ public final class ActivityThread { mInstrumentationPackageName = ii.packageName; mInstrumentationPackageName = ii.packageName; mInstrumentationAppDir = ii.sourceDir; mInstrumentationAppDir = ii.sourceDir; mInstrumentationSplitAppDirs = ii.splitSourceDirs; mInstrumentationSplitAppDirs = ii.splitSourceDirs; mInstrumentationLibDir = ii.nativeLibraryDir; mInstrumentationLibDir = getInstrumentationLibrary(data.appInfo, ii); mInstrumentedAppDir = data.info.getAppDir(); mInstrumentedAppDir = data.info.getAppDir(); mInstrumentedSplitAppDirs = data.info.getSplitAppDirs(); mInstrumentedSplitAppDirs = data.info.getSplitAppDirs(); mInstrumentedLibDir = data.info.getLibDir(); mInstrumentedLibDir = data.info.getLibDir(); Loading core/java/android/content/pm/InstrumentationInfo.java +8 −5 Original line number Original line Diff line number Diff line Loading @@ -66,13 +66,12 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable { /** {@hide} */ /** {@hide} */ public String credentialProtectedDataDir; public String credentialProtectedDataDir; /** /** {@hide} Full path to the directory containing primary ABI native libraries. */ * Full path to the directory where the native JNI libraries are stored. * * {@hide} */ public String nativeLibraryDir; public String nativeLibraryDir; /** {@hide} Full path to the directory containing secondary ABI native libraries. */ public String secondaryNativeLibraryDir; /** /** * Specifies whether or not this instrumentation will handle profiling. * Specifies whether or not this instrumentation will handle profiling. */ */ Loading @@ -95,6 +94,7 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable { deviceProtectedDataDir = orig.deviceProtectedDataDir; deviceProtectedDataDir = orig.deviceProtectedDataDir; credentialProtectedDataDir = orig.credentialProtectedDataDir; credentialProtectedDataDir = orig.credentialProtectedDataDir; nativeLibraryDir = orig.nativeLibraryDir; nativeLibraryDir = orig.nativeLibraryDir; secondaryNativeLibraryDir = orig.secondaryNativeLibraryDir; handleProfiling = orig.handleProfiling; handleProfiling = orig.handleProfiling; functionalTest = orig.functionalTest; functionalTest = orig.functionalTest; } } Loading @@ -120,6 +120,7 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable { dest.writeString(deviceProtectedDataDir); dest.writeString(deviceProtectedDataDir); dest.writeString(credentialProtectedDataDir); dest.writeString(credentialProtectedDataDir); dest.writeString(nativeLibraryDir); dest.writeString(nativeLibraryDir); dest.writeString(secondaryNativeLibraryDir); dest.writeInt((handleProfiling == false) ? 0 : 1); dest.writeInt((handleProfiling == false) ? 0 : 1); dest.writeInt((functionalTest == false) ? 0 : 1); dest.writeInt((functionalTest == false) ? 0 : 1); } } Loading @@ -145,6 +146,7 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable { deviceProtectedDataDir = source.readString(); deviceProtectedDataDir = source.readString(); credentialProtectedDataDir = source.readString(); credentialProtectedDataDir = source.readString(); nativeLibraryDir = source.readString(); nativeLibraryDir = source.readString(); secondaryNativeLibraryDir = source.readString(); handleProfiling = source.readInt() != 0; handleProfiling = source.readInt() != 0; functionalTest = source.readInt() != 0; functionalTest = source.readInt() != 0; } } Loading @@ -160,5 +162,6 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable { ai.deviceProtectedDataDir = deviceProtectedDataDir; ai.deviceProtectedDataDir = deviceProtectedDataDir; ai.credentialProtectedDataDir = credentialProtectedDataDir; ai.credentialProtectedDataDir = credentialProtectedDataDir; ai.nativeLibraryDir = nativeLibraryDir; ai.nativeLibraryDir = nativeLibraryDir; ai.secondaryNativeLibraryDir = secondaryNativeLibraryDir; } } } } services/core/java/com/android/server/pm/PackageManagerService.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -8727,9 +8727,8 @@ public class PackageManagerService extends IPackageManager.Stub { a.info.deviceProtectedDataDir = pkg.applicationInfo.deviceProtectedDataDir; a.info.deviceProtectedDataDir = pkg.applicationInfo.deviceProtectedDataDir; a.info.credentialProtectedDataDir = pkg.applicationInfo.credentialProtectedDataDir; a.info.credentialProtectedDataDir = pkg.applicationInfo.credentialProtectedDataDir; // TODO: Update instrumentation.nativeLibraryDir as well ? Does it // need other information about the application, like the ABI and what not ? a.info.nativeLibraryDir = pkg.applicationInfo.nativeLibraryDir; a.info.nativeLibraryDir = pkg.applicationInfo.nativeLibraryDir; a.info.secondaryNativeLibraryDir = pkg.applicationInfo.secondaryNativeLibraryDir; mInstrumentation.put(a.getComponentName(), a); mInstrumentation.put(a.getComponentName(), a); if ((policyFlags&PackageParser.PARSE_CHATTY) != 0) { if ((policyFlags&PackageParser.PARSE_CHATTY) != 0) { if (r == null) { if (r == null) { Loading Loading
core/java/android/app/ActivityThread.java +26 −1 Original line number Original line Diff line number Diff line Loading @@ -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) { private void handleBindApplication(AppBindData data) { // Register the UI Thread as a sensitive thread to the runtime. // Register the UI Thread as a sensitive thread to the runtime. VMRuntime.registerSensitiveThread(); VMRuntime.registerSensitiveThread(); Loading Loading @@ -5130,7 +5155,7 @@ public final class ActivityThread { mInstrumentationPackageName = ii.packageName; mInstrumentationPackageName = ii.packageName; mInstrumentationAppDir = ii.sourceDir; mInstrumentationAppDir = ii.sourceDir; mInstrumentationSplitAppDirs = ii.splitSourceDirs; mInstrumentationSplitAppDirs = ii.splitSourceDirs; mInstrumentationLibDir = ii.nativeLibraryDir; mInstrumentationLibDir = getInstrumentationLibrary(data.appInfo, ii); mInstrumentedAppDir = data.info.getAppDir(); mInstrumentedAppDir = data.info.getAppDir(); mInstrumentedSplitAppDirs = data.info.getSplitAppDirs(); mInstrumentedSplitAppDirs = data.info.getSplitAppDirs(); mInstrumentedLibDir = data.info.getLibDir(); mInstrumentedLibDir = data.info.getLibDir(); Loading
core/java/android/content/pm/InstrumentationInfo.java +8 −5 Original line number Original line Diff line number Diff line Loading @@ -66,13 +66,12 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable { /** {@hide} */ /** {@hide} */ public String credentialProtectedDataDir; public String credentialProtectedDataDir; /** /** {@hide} Full path to the directory containing primary ABI native libraries. */ * Full path to the directory where the native JNI libraries are stored. * * {@hide} */ public String nativeLibraryDir; public String nativeLibraryDir; /** {@hide} Full path to the directory containing secondary ABI native libraries. */ public String secondaryNativeLibraryDir; /** /** * Specifies whether or not this instrumentation will handle profiling. * Specifies whether or not this instrumentation will handle profiling. */ */ Loading @@ -95,6 +94,7 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable { deviceProtectedDataDir = orig.deviceProtectedDataDir; deviceProtectedDataDir = orig.deviceProtectedDataDir; credentialProtectedDataDir = orig.credentialProtectedDataDir; credentialProtectedDataDir = orig.credentialProtectedDataDir; nativeLibraryDir = orig.nativeLibraryDir; nativeLibraryDir = orig.nativeLibraryDir; secondaryNativeLibraryDir = orig.secondaryNativeLibraryDir; handleProfiling = orig.handleProfiling; handleProfiling = orig.handleProfiling; functionalTest = orig.functionalTest; functionalTest = orig.functionalTest; } } Loading @@ -120,6 +120,7 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable { dest.writeString(deviceProtectedDataDir); dest.writeString(deviceProtectedDataDir); dest.writeString(credentialProtectedDataDir); dest.writeString(credentialProtectedDataDir); dest.writeString(nativeLibraryDir); dest.writeString(nativeLibraryDir); dest.writeString(secondaryNativeLibraryDir); dest.writeInt((handleProfiling == false) ? 0 : 1); dest.writeInt((handleProfiling == false) ? 0 : 1); dest.writeInt((functionalTest == false) ? 0 : 1); dest.writeInt((functionalTest == false) ? 0 : 1); } } Loading @@ -145,6 +146,7 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable { deviceProtectedDataDir = source.readString(); deviceProtectedDataDir = source.readString(); credentialProtectedDataDir = source.readString(); credentialProtectedDataDir = source.readString(); nativeLibraryDir = source.readString(); nativeLibraryDir = source.readString(); secondaryNativeLibraryDir = source.readString(); handleProfiling = source.readInt() != 0; handleProfiling = source.readInt() != 0; functionalTest = source.readInt() != 0; functionalTest = source.readInt() != 0; } } Loading @@ -160,5 +162,6 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable { ai.deviceProtectedDataDir = deviceProtectedDataDir; ai.deviceProtectedDataDir = deviceProtectedDataDir; ai.credentialProtectedDataDir = credentialProtectedDataDir; ai.credentialProtectedDataDir = credentialProtectedDataDir; ai.nativeLibraryDir = nativeLibraryDir; ai.nativeLibraryDir = nativeLibraryDir; ai.secondaryNativeLibraryDir = secondaryNativeLibraryDir; } } } }
services/core/java/com/android/server/pm/PackageManagerService.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -8727,9 +8727,8 @@ public class PackageManagerService extends IPackageManager.Stub { a.info.deviceProtectedDataDir = pkg.applicationInfo.deviceProtectedDataDir; a.info.deviceProtectedDataDir = pkg.applicationInfo.deviceProtectedDataDir; a.info.credentialProtectedDataDir = pkg.applicationInfo.credentialProtectedDataDir; a.info.credentialProtectedDataDir = pkg.applicationInfo.credentialProtectedDataDir; // TODO: Update instrumentation.nativeLibraryDir as well ? Does it // need other information about the application, like the ABI and what not ? a.info.nativeLibraryDir = pkg.applicationInfo.nativeLibraryDir; a.info.nativeLibraryDir = pkg.applicationInfo.nativeLibraryDir; a.info.secondaryNativeLibraryDir = pkg.applicationInfo.secondaryNativeLibraryDir; mInstrumentation.put(a.getComponentName(), a); mInstrumentation.put(a.getComponentName(), a); if ((policyFlags&PackageParser.PARSE_CHATTY) != 0) { if ((policyFlags&PackageParser.PARSE_CHATTY) != 0) { if (r == null) { if (r == null) { Loading