AudioAttributes: fix setInternalCapturePreset()

Commit 5a594729 aligned the value of capture preset for
audio attributes in volume groups between java and native,
thus allowing AUDIO_SOURCE_INVALID to be passed to
setInternalCapturePreset() by the JNI.

Bug: 267588552
Test: atest AudioServiceHostTest#testAudioVolumeGroups
Change-Id: Ibf496a9cfc83cd3c3e01bab5cb8c26014207cc87
This commit is contained in:
Eric Laurent
2023-02-08 11:52:24 +01:00
parent 0b3ff82173
commit d90f690275

View File

@@ -1275,7 +1275,10 @@ public final class AudioAttributes implements Parcelable {
|| (preset == MediaRecorder.AudioSource.VOICE_UPLINK)
|| (preset == MediaRecorder.AudioSource.VOICE_CALL)
|| (preset == MediaRecorder.AudioSource.ECHO_REFERENCE)
|| (preset == MediaRecorder.AudioSource.ULTRASOUND)) {
|| (preset == MediaRecorder.AudioSource.ULTRASOUND)
// AUDIO_SOURCE_INVALID is used by convention on default initialized
// audio attributes
|| (preset == MediaRecorder.AudioSource.AUDIO_SOURCE_INVALID)) {
mSource = preset;
} else {
setCapturePreset(preset);