mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Reduce limit of attempts to change audio device in Android framework + return correct value if it failed
This commit is contained in:
parent
ae7a3c5bce
commit
8f3415f6fa
1 changed files with 4 additions and 2 deletions
|
|
@ -260,13 +260,14 @@ class TelecomCallControlCallback(
|
|||
continue
|
||||
}
|
||||
|
||||
var success = false
|
||||
scope.launch {
|
||||
Log.i("$TAG Requesting audio endpoint change to [${endpoint.name}] with type [${endpointTypeToString(endpoint.type)}]")
|
||||
endpointUpdateRequestFromLinphone = true
|
||||
latestLinphoneRequestedEndpoint = endpoint
|
||||
var result: CallControlResult = callControl.requestEndpointChange(endpoint)
|
||||
var attempts = 1
|
||||
while (result is CallControlResult.Error && attempts <= 10) {
|
||||
while (result is CallControlResult.Error && attempts <= 2) {
|
||||
delay(100)
|
||||
Log.i(
|
||||
"$TAG Previous attempt failed [$result], requesting again audio endpoint change to [${endpoint.name}] with type [${endpointTypeToString(endpoint.type)}]"
|
||||
|
|
@ -282,10 +283,11 @@ class TelecomCallControlCallback(
|
|||
"$TAG It took [$attempts] attempt(s) to change endpoint audio device..."
|
||||
)
|
||||
currentEndpoint = endpoint.type
|
||||
success = true
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
return success
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue