code cleaning
This commit is contained in:
parent
07e57b1498
commit
ef2fcd60d7
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue