mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent auth dialog when failed to login in assistant and then successfully login another account
This commit is contained in:
parent
39b68097ee
commit
d69a797b25
2 changed files with 5 additions and 2 deletions
|
|
@ -498,12 +498,13 @@ class CoreContext
|
||||||
if (account.findAuthInfo() == digestAuthInfoPendingPasswordUpdate) {
|
if (account.findAuthInfo() == digestAuthInfoPendingPasswordUpdate) {
|
||||||
Log.i("$TAG Removed account matches auth info pending password update, removing dialog")
|
Log.i("$TAG Removed account matches auth info pending password update, removing dialog")
|
||||||
clearAuthenticationRequestDialogEvent.postValue(Event(true))
|
clearAuthenticationRequestDialogEvent.postValue(Event(true))
|
||||||
|
digestAuthInfoPendingPasswordUpdate = null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (core.defaultAccount == null || core.defaultAccount == account) {
|
if (core.defaultAccount == null || core.defaultAccount == account) {
|
||||||
Log.w("$TAG Removed account was the default one, choosing another as default if possible")
|
Log.w("$TAG Removed account was the default one, choosing another as default if possible")
|
||||||
val newDefaultAccount = core.accountList.find {
|
val newDefaultAccount = core.accountList.find {
|
||||||
it.params.isRegisterEnabled == true
|
it.params.isRegisterEnabled
|
||||||
} ?: core.accountList.firstOrNull()
|
} ?: core.accountList.firstOrNull()
|
||||||
if (newDefaultAccount == null) {
|
if (newDefaultAccount == null) {
|
||||||
Log.e("$TAG Failed to find a new default account!")
|
Log.e("$TAG Failed to find a new default account!")
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,9 @@ class MainActivity : GenericActivity() {
|
||||||
coreContext.digestAuthenticationRequestedEvent.observe(this) {
|
coreContext.digestAuthenticationRequestedEvent.observe(this) {
|
||||||
it.consume { identity ->
|
it.consume { identity ->
|
||||||
try {
|
try {
|
||||||
showAuthenticationRequestedDialog(identity)
|
if (coreContext.digestAuthInfoPendingPasswordUpdate != null) {
|
||||||
|
showAuthenticationRequestedDialog(identity)
|
||||||
|
}
|
||||||
} catch (e: WindowManager.BadTokenException) {
|
} catch (e: WindowManager.BadTokenException) {
|
||||||
Log.e("$TAG Failed to show authentication dialog: $e")
|
Log.e("$TAG Failed to show authentication dialog: $e")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue