mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Prevent no default account being set, using first available account
This commit is contained in:
parent
b9065d3c7c
commit
821986b6a9
1 changed files with 8 additions and 0 deletions
|
|
@ -448,6 +448,14 @@ class CoreContext
|
|||
val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
audioManager.registerAudioDeviceCallback(audioDeviceCallback, coreThread)
|
||||
|
||||
val accounts = core.accountList
|
||||
if (core.defaultAccount == null && accounts.isNotEmpty()) {
|
||||
Log.e("$TAG No default account set but accounts list not empty!")
|
||||
val firstAccount = accounts.first()
|
||||
core.defaultAccount = firstAccount
|
||||
Log.w("$TAG Set account [${firstAccount?.params?.identityAddress?.asStringUriOnly()}] as default")
|
||||
}
|
||||
|
||||
computeUserAgent()
|
||||
Log.i("$TAG Core has been configured with user-agent [${core.userAgent}], starting it")
|
||||
core.start()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue