From ef2fcd60d712be2d2582be0e68f644c5fe52e18d Mon Sep 17 00:00:00 2001 From: Valere Date: Mon, 22 Jun 2020 09:54:45 +0200 Subject: [PATCH] code cleaning --- .../java/im/vector/riotx/features/call/CallAudioManager.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/call/CallAudioManager.kt b/vector/src/main/java/im/vector/riotx/features/call/CallAudioManager.kt index 56a915d8e6..b25a11b5b3 100644 --- a/vector/src/main/java/im/vector/riotx/features/call/CallAudioManager.kt +++ b/vector/src/main/java/im/vector/riotx/features/call/CallAudioManager.kt @@ -51,7 +51,8 @@ class CallAudioManager( private var connectedBlueToothHeadset: BluetoothProfile? = null private var wantsBluetoothConnection = false - private var bluetoothAdapter : BluetoothAdapter? = null + private var bluetoothAdapter: BluetoothAdapter? = null + init { executor.execute { audioManager = applicationContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager @@ -179,7 +180,9 @@ class CallAudioManager( } private fun isBluetoothHeadsetConnected(audioManager: AudioManager) = - isBluetoothHeadsetOn() && !connectedBlueToothHeadset?.connectedDevices.isNullOrEmpty() && (wantsBluetoothConnection || audioManager.isBluetoothScoOn) + isBluetoothHeadsetOn() + && !connectedBlueToothHeadset?.connectedDevices.isNullOrEmpty() + && (wantsBluetoothConnection || audioManager.isBluetoothScoOn) fun setCurrentSoundDevice(device: SoundDevice) { executor.execute {