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

This commit is contained in:
TreeHugger Robot
2022-09-20 15:28:46 +00:00
committed by Android (Google) Code Review

View File

@@ -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);