mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-05-06 21:33:09 +00:00
Clear auth info password requested dialog when account is removed
This commit is contained in:
parent
354f39d76d
commit
30364c48b0
2 changed files with 20 additions and 0 deletions
|
|
@ -93,6 +93,10 @@ class CoreContext
|
|||
MutableLiveData<Event<String>>()
|
||||
}
|
||||
|
||||
val clearAuthenticationRequestDialogEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
val refreshMicrophoneMuteStateEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
|
@ -391,6 +395,7 @@ class CoreContext
|
|||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onAccountAdded(core: Core, account: Account) {
|
||||
// Prevent this trigger when core is stopped/start in remote prov
|
||||
if (core.globalState == GlobalState.Off) return
|
||||
|
|
@ -412,6 +417,15 @@ class CoreContext
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onAccountRemoved(core: Core, account: Account) {
|
||||
Log.i("$TAG Account [${account.params.identityAddress?.asStringUriOnly()}] removed, clearing auth request dialog if needed")
|
||||
if (account.findAuthInfo() == digestAuthInfoPendingPasswordUpdate) {
|
||||
Log.i("$TAG Removed account matches auth info pending password update, removing dialog")
|
||||
clearAuthenticationRequestDialogEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var logcatEnabled: Boolean = corePreferences.printLogsInLogcat
|
||||
|
|
|
|||
|
|
@ -284,6 +284,12 @@ class MainActivity : GenericActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
coreContext.clearAuthenticationRequestDialogEvent.observe(this) {
|
||||
it.consume {
|
||||
currentlyDisplayedAuthDialog?.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
coreContext.showGreenToastEvent.observe(this) {
|
||||
it.consume { pair ->
|
||||
val message = getString(pair.first)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue