diff --git a/stream-video-android-core/api/stream-video-android-core.api b/stream-video-android-core/api/stream-video-android-core.api index 2b05f0c989..edaf857959 100644 --- a/stream-video-android-core/api/stream-video-android-core.api +++ b/stream-video-android-core/api/stream-video-android-core.api @@ -869,10 +869,7 @@ public abstract interface class io/getstream/video/android/core/audio/AudioHandl public final class io/getstream/video/android/core/audio/AudioSwitchHandler : io/getstream/video/android/core/audio/AudioHandler { public static final field Companion Lio/getstream/video/android/core/audio/AudioSwitchHandler$Companion; public fun (Landroid/content/Context;ZLkotlin/jvm/functions/Function2;)V - public final fun getAudioDeviceChangeListener ()Lkotlin/jvm/functions/Function2; - public final fun getPreferSpeakerphone ()Z public final fun selectDevice (Lcom/twilio/audioswitch/AudioDevice;)V - public final fun setAudioDeviceChangeListener (Lkotlin/jvm/functions/Function2;)V public fun start ()V public fun stop ()V } diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt index 18e16145af..e984318a90 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/Call.kt @@ -900,17 +900,10 @@ public class Call( private fun updateMediaManagerFromSettings(callSettings: CallSettingsResponse) { // Speaker - if (speaker.status.value is DeviceStatus.NotSelected) { - val enableSpeaker = - if (callSettings.video.cameraDefaultOn || camera.status.value is DeviceStatus.Enabled) { - // if camera is enabled then enable speaker. Eventually this should - // be a new audio.defaultDevice setting returned from backend - true - } else { - callSettings.audio.defaultDevice == AudioSettingsResponse.DefaultDevice.Speaker - } - speaker.setEnabled(enableSpeaker) - } + speaker.setEnabled( + enabled = callSettings.audio.defaultDevice == AudioSettingsResponse.DefaultDevice.Speaker || + callSettings.audio.speakerDefaultOn, + ) // Camera if (camera.status.value is DeviceStatus.NotSelected) { diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/MediaManager.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/MediaManager.kt index 5ddb342db3..14cdd5c424 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/MediaManager.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/MediaManager.kt @@ -858,7 +858,7 @@ class MediaManagerImpl( ) internal val camera = CameraManager(this, eglBaseContext) - internal val microphone = MicrophoneManager(this, preferSpeakerphone = true, audioUsage) + internal val microphone = MicrophoneManager(this, preferSpeakerphone = false, audioUsage) internal val speaker = SpeakerManager(this, microphone) internal val screenShare = ScreenShareManager(this, eglBaseContext) diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/audio/AudioHandler.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/audio/AudioHandler.kt index b2c9268aa6..d665110846 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/audio/AudioHandler.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/audio/AudioHandler.kt @@ -43,8 +43,8 @@ public interface AudioHandler { */ public class AudioSwitchHandler constructor( private val context: Context, - val preferSpeakerphone: Boolean, - var audioDeviceChangeListener: AudioDeviceChangeListener, + private val preferSpeakerphone: Boolean, + private var audioDeviceChangeListener: AudioDeviceChangeListener, ) : AudioHandler {