code cleaning

This commit is contained in:
Valere 2020-06-22 09:54:45 +02:00
parent 07e57b1498
commit ef2fcd60d7
1 changed files with 5 additions and 2 deletions

View File

@ -51,7 +51,8 @@ class CallAudioManager(
private var connectedBlueToothHeadset: BluetoothProfile? = null private var connectedBlueToothHeadset: BluetoothProfile? = null
private var wantsBluetoothConnection = false private var wantsBluetoothConnection = false
private var bluetoothAdapter : BluetoothAdapter? = null private var bluetoothAdapter: BluetoothAdapter? = null
init { init {
executor.execute { executor.execute {
audioManager = applicationContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager audioManager = applicationContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager
@ -179,7 +180,9 @@ class CallAudioManager(
} }
private fun isBluetoothHeadsetConnected(audioManager: AudioManager) = private fun isBluetoothHeadsetConnected(audioManager: AudioManager) =
isBluetoothHeadsetOn() && !connectedBlueToothHeadset?.connectedDevices.isNullOrEmpty() && (wantsBluetoothConnection || audioManager.isBluetoothScoOn) isBluetoothHeadsetOn()
&& !connectedBlueToothHeadset?.connectedDevices.isNullOrEmpty()
&& (wantsBluetoothConnection || audioManager.isBluetoothScoOn)
fun setCurrentSoundDevice(device: SoundDevice) { fun setCurrentSoundDevice(device: SoundDevice) {
executor.execute { executor.execute {