Removed reduntant isAudioFocused variable
This commit is contained in:
@ -1531,7 +1531,6 @@ class BaresipService: Service() {
|
||||
|
||||
var isServiceRunning = false
|
||||
var isConfigInitialized = false
|
||||
var isAudioFocused = false
|
||||
var libraryLoaded = false
|
||||
var callVolume = 0
|
||||
var dynDns = false
|
||||
@ -1564,8 +1563,8 @@ class BaresipService: Service() {
|
||||
val serviceEvents = mutableListOf<ServiceEvent>()
|
||||
// <aor, password> of those accounts that have auth username without auth password
|
||||
val aorPasswords = mutableMapOf<String, String>()
|
||||
var audioFocusRequest: AudioFocusRequestCompat? = null
|
||||
|
||||
private var audioFocusRequest: AudioFocusRequestCompat? = null
|
||||
private var btAdapter: BluetoothAdapter? = null
|
||||
|
||||
fun requestAudioFocus(ctx: Context): Boolean {
|
||||
|
||||
@ -926,7 +926,7 @@ object Utils {
|
||||
Log.d(TAG, "Setting com device to TYPE_BUILTIN_EARPIECE")
|
||||
if (!am.setCommunicationDevice(speakerDevice))
|
||||
Log.e(TAG, "Could not set com device")
|
||||
if (BaresipService.isAudioFocused && am.mode == AudioManager.MODE_NORMAL) {
|
||||
if (BaresipService.audioFocusRequest != null && am.mode == AudioManager.MODE_NORMAL) {
|
||||
Log.d(TAG, "Setting mode to communication")
|
||||
am.mode = AudioManager.MODE_IN_COMMUNICATION
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user