Cleanup logs (fix lint)

This commit is contained in:
Benoit Marty 2021-02-15 17:56:05 +01:00 committed by Benoit Marty
parent b3a408a34c
commit aab70e14fc

View File

@ -83,12 +83,12 @@ class CallAudioManager(private val context: Context, val configChange: (() -> Un
fun setAudioDevice(device: Device) { fun setAudioDevice(device: Device) {
runInAudioThread(Runnable { runInAudioThread(Runnable {
if (!_availableDevices.contains(device)) { if (!_availableDevices.contains(device)) {
Timber.w(" Audio device not available: $device") Timber.w("Audio device not available: $device")
userSelectedDevice = null userSelectedDevice = null
return@Runnable return@Runnable
} }
if (mode != Mode.DEFAULT) { if (mode != Mode.DEFAULT) {
Timber.i(" User selected device set to: $device") Timber.i("User selected device set to: $device")
userSelectedDevice = device userSelectedDevice = device
updateAudioRoute(mode, false) updateAudioRoute(mode, false)
} }
@ -108,7 +108,7 @@ class CallAudioManager(private val context: Context, val configChange: (() -> Un
success = updateAudioRoute(mode, false) success = updateAudioRoute(mode, false)
} catch (e: Throwable) { } catch (e: Throwable) {
success = false success = false
Timber.e(e, " Failed to update audio route for mode: " + mode) Timber.e(e, "Failed to update audio route for mode: $mode")
} }
if (success) { if (success) {
this@CallAudioManager.mode = mode this@CallAudioManager.mode = mode
@ -124,7 +124,7 @@ class CallAudioManager(private val context: Context, val configChange: (() -> Un
* `false`, otherwise. * `false`, otherwise.
*/ */
private fun updateAudioRoute(mode: Mode, force: Boolean): Boolean { private fun updateAudioRoute(mode: Mode, force: Boolean): Boolean {
Timber.i(" Update audio route for mode: " + mode) Timber.i("Update audio route for mode: $mode")
if (!audioDeviceRouter?.setMode(mode).orFalse()) { if (!audioDeviceRouter?.setMode(mode).orFalse()) {
return false return false
} }
@ -158,7 +158,7 @@ class CallAudioManager(private val context: Context, val configChange: (() -> Un
return true return true
} }
selectedDevice = audioDevice selectedDevice = audioDevice
Timber.i(" Selected audio device: " + audioDevice) Timber.i("Selected audio device: $audioDevice")
audioDeviceRouter?.setAudioRoute(audioDevice) audioDeviceRouter?.setAudioRoute(audioDevice)
configChange?.invoke() configChange?.invoke()
return true return true