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

Commit bbaf2abf authored by Michael Hoisie's avatar Michael Hoisie
Browse files

Enable ImageDecoder_nCreateFd for host Linux and host Mac

ImageDecoder_nCreateFd works as-is on host Linux and host Mac, as both
of these OS's support F_DUPFD_CLOEXEC.

Test: ShadowNativeImageDecoderTest in Google3

Flag: EXEMPT host-only change

Bug: 352587758
Change-Id: I4a62ef0156af78d2b59c0e9e39f5a8b8f8152164
parent 9cda256f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -162,8 +162,8 @@ static jobject native_create(JNIEnv* env, std::unique_ptr<SkStream> stream,

static jobject ImageDecoder_nCreateFd(JNIEnv* env, jobject /*clazz*/,
        jobject fileDescriptor, jlong length, jboolean preferAnimation, jobject source) {
#ifndef __ANDROID__ // LayoutLib for Windows does not support F_DUPFD_CLOEXEC
    return throw_exception(env, kSourceException, "Only supported on Android", nullptr, source);
#ifdef _WIN32  // LayoutLib for Windows does not support F_DUPFD_CLOEXEC
    return throw_exception(env, kSourceException, "Not supported on Windows", nullptr, source);
#else
    int descriptor = jniGetFDFromFileDescriptor(env, fileDescriptor);