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

Commit 7aab6bbe authored by Dorin Drimus's avatar Dorin Drimus Committed by Gerrit Code Review
Browse files

Merge "Use local status for convert profile"

parents d6a9de15 4469c2a0
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2937,13 +2937,14 @@ static jint android_media_AudioSystem_getDirectProfilesForAttributes(JNIEnv *env

    for (const auto &audioProfile : audioProfiles) {
        jobject jAudioProfile;
        jStatus = convertAudioProfileFromNative(env, &jAudioProfile, &audioProfile, false);
        if (jStatus == AUDIO_JAVA_BAD_VALUE) {
        jint jConvertProfileStatus = convertAudioProfileFromNative(
                                        env, &jAudioProfile, &audioProfile, false);
        if (jConvertProfileStatus == AUDIO_JAVA_BAD_VALUE) {
            // skipping Java layer unsupported audio formats
            continue;
        }
        if (jStatus != AUDIO_JAVA_SUCCESS) {
            return jStatus;
        if (jConvertProfileStatus != AUDIO_JAVA_SUCCESS) {
            return jConvertProfileStatus;
        }
        env->CallBooleanMethod(jAudioProfilesList, gArrayListMethods.add, jAudioProfile);
        env->DeleteLocalRef(jAudioProfile);