File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
features/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,10 @@ private fun OutputAudioDeviceSelector() {
262
262
Text (device.description())
263
263
}, onClick = {
264
264
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .S ) {
265
+ // Workaround for Android 12, otherwise changing the audio device doesn't work
266
+ if (Build .VERSION .SDK_INT == Build .VERSION_CODES .S ) {
267
+ audioManager?.mode = AudioManager .MODE_NORMAL
268
+ }
265
269
audioManager?.setCommunicationDevice(device)
266
270
selected = device
267
271
expanded = false
@@ -316,7 +320,9 @@ fun AudioDeviceInfo.description(): String {
316
320
private fun Context.setupAudioConfiguration (): AudioDeviceCallback ? {
317
321
val audioManager = getSystemService<AudioManager >() ? : return null
318
322
// Set 'voice call' mode so volume keys actually control the call volume
319
- audioManager.mode = AudioManager .MODE_IN_COMMUNICATION
323
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .TIRAMISU ) {
324
+ audioManager.mode = AudioManager .MODE_IN_COMMUNICATION
325
+ }
320
326
audioManager.enableExternalAudioDevice()
321
327
return object : AudioDeviceCallback () {
322
328
override fun onAudioDevicesAdded (addedDevices : Array <out AudioDeviceInfo >? ) {
You can’t perform that action at this time.
0 commit comments