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

Commit 5c312d7f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use local status for convert profile" into tm-qpr-dev

parents 132b386f cefd74bb
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);