Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61b9b6c9 authored by Dimitry Ivanov's avatar Dimitry Ivanov Committed by Gerrit Code Review
Browse files

Merge "Respect extractNativeLibs in natively bridged environments"

parents 9b1db24f 6e44c30f
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -171,8 +171,7 @@ public class NativeLibraryHelper {
            boolean debuggable);

    private native static int nativeCopyNativeBinaries(long handle, String sharedLibraryPath,
            String abiToCopy, boolean extractNativeLibs, boolean hasNativeBridge,
            boolean debuggable);
            String abiToCopy, boolean extractNativeLibs, boolean debuggable);

    private static long sumNativeBinaries(Handle handle, String abi) {
        long sum = 0;
@@ -193,7 +192,7 @@ public class NativeLibraryHelper {
    public static int copyNativeBinaries(Handle handle, File sharedLibraryDir, String abi) {
        for (long apkHandle : handle.apkHandles) {
            int res = nativeCopyNativeBinaries(apkHandle, sharedLibraryDir.getPath(), abi,
                    handle.extractNativeLibs, HAS_NATIVE_BRIDGE, handle.debuggable);
                    handle.extractNativeLibs, handle.debuggable);
            if (res != INSTALL_SUCCEEDED) {
                return res;
            }
@@ -448,9 +447,6 @@ public class NativeLibraryHelper {
    // We don't care about the other return values for now.
    private static final int BITCODE_PRESENT = 1;

    private static final boolean HAS_NATIVE_BRIDGE =
            !"0".equals(SystemProperties.get("ro.dalvik.vm.native.bridge", "0"));

    private static native int hasRenderscriptBitcode(long apkHandle);

    public static boolean hasRenderscriptBitcode(Handle handle) throws IOException {
+4 −7
Original line number Diff line number Diff line
@@ -176,7 +176,6 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr
    void** args = reinterpret_cast<void**>(arg);
    jstring* javaNativeLibPath = (jstring*) args[0];
    jboolean extractNativeLibs = *(jboolean*) args[1];
    jboolean hasNativeBridge = *(jboolean*) args[2];

    ScopedUtfChars nativeLibPath(env, *javaNativeLibPath);

@@ -206,10 +205,8 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr
            return INSTALL_FAILED_INVALID_APK;
        }

        if (!hasNativeBridge) {
        return INSTALL_SUCCEEDED;
    }
    }

    // Build local file path
    const size_t fileNameLen = strlen(fileName);
@@ -489,9 +486,9 @@ static int findSupportedAbi(JNIEnv *env, jlong apkHandle, jobjectArray supported
static jint
com_android_internal_content_NativeLibraryHelper_copyNativeBinaries(JNIEnv *env, jclass clazz,
        jlong apkHandle, jstring javaNativeLibPath, jstring javaCpuAbi,
        jboolean extractNativeLibs, jboolean hasNativeBridge, jboolean debuggable)
        jboolean extractNativeLibs, jboolean debuggable)
{
    void* args[] = { &javaNativeLibPath, &extractNativeLibs, &hasNativeBridge };
    void* args[] = { &javaNativeLibPath, &extractNativeLibs };
    return (jint) iterateOverNativeFiles(env, apkHandle, javaCpuAbi, debuggable,
            copyFileIfChanged, reinterpret_cast<void*>(args));
}
@@ -597,7 +594,7 @@ static const JNINativeMethod gMethods[] = {
            "(J)V",
            (void *)com_android_internal_content_NativeLibraryHelper_close},
    {"nativeCopyNativeBinaries",
            "(JLjava/lang/String;Ljava/lang/String;ZZZ)I",
            "(JLjava/lang/String;Ljava/lang/String;ZZ)I",
            (void *)com_android_internal_content_NativeLibraryHelper_copyNativeBinaries},
    {"nativeSumNativeBinaries",
            "(JLjava/lang/String;Z)J",