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

Commit d90f6902 authored by Eric Laurent's avatar Eric Laurent
Browse files

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
parent 0b3ff821
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);