Merge "Audio: fix AudioVolumeGroup JNI"

This commit is contained in:
Eric Laurent
2022-10-04 17:33:35 +00:00
committed by Android (Google) Code Review

View File

@@ -94,6 +94,11 @@ static jint convertAudioVolumeGroupsFromNative(
for (size_t j = 0; j < static_cast<size_t>(numAttributes); j++) {
auto attributes = group.getAudioAttributes()[j];
// Native & Java audio attributes default initializers are not aligned for the source.
// Given the volume group class concerns only playback, this field must be equal to the
// default java initializer.
attributes.source = AUDIO_SOURCE_INVALID;
jStatus = JNIAudioAttributeHelper::nativeToJava(env, &jAudioAttribute, attributes);
if (jStatus != AUDIO_JAVA_SUCCESS) {
goto exit;