mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent meeting icons from being briefly visible when selected account has no videoconference factory URI set in it's params
This commit is contained in:
parent
1f45ba8bd0
commit
90bf20e50e
2 changed files with 17 additions and 6 deletions
|
|
@ -82,6 +82,8 @@ class CoreContext
|
|||
|
||||
private val mainThread = Handler(Looper.getMainLooper())
|
||||
|
||||
var defaultAccountHasVideoConferenceFactoryUri: Boolean = false
|
||||
|
||||
var bearerAuthInfoPendingPasswordUpdate: AuthInfo? = null
|
||||
var digestAuthInfoPendingPasswordUpdate: AuthInfo? = null
|
||||
|
||||
|
|
@ -175,6 +177,11 @@ class CoreContext
|
|||
private var previousCallState = Call.State.Idle
|
||||
|
||||
private val coreListener = object : CoreListenerStub() {
|
||||
@WorkerThread
|
||||
override fun onDefaultAccountChanged(core: Core, account: Account?) {
|
||||
defaultAccountHasVideoConferenceFactoryUri = account?.params?.audioVideoConferenceFactoryAddress != null
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onMessagesReceived(
|
||||
core: Core,
|
||||
|
|
@ -512,6 +519,8 @@ class CoreContext
|
|||
core.isAutoIterateEnabled = true
|
||||
core.addListener(coreListener)
|
||||
|
||||
defaultAccountHasVideoConferenceFactoryUri = core.defaultAccount?.params?.audioVideoConferenceFactoryAddress != null
|
||||
|
||||
coreThread.postDelayed({ startCore() }, 50)
|
||||
|
||||
Looper.loop()
|
||||
|
|
|
|||
|
|
@ -148,6 +148,10 @@ open class AbstractMainViewModel
|
|||
|
||||
@WorkerThread
|
||||
override fun onDefaultAccountChanged(core: Core, defaultAccount: Account?) {
|
||||
updateAvailableMenus()
|
||||
computeUnreadMessagesCount()
|
||||
updateMissedCallsCount()
|
||||
|
||||
account.value?.destroy()
|
||||
|
||||
if (defaultAccount == null) {
|
||||
|
|
@ -162,15 +166,14 @@ open class AbstractMainViewModel
|
|||
account.postValue(AccountModel(defaultAccount))
|
||||
}
|
||||
|
||||
computeUnreadMessagesCount()
|
||||
updateMissedCallsCount()
|
||||
updateAvailableMenus()
|
||||
|
||||
defaultAccountChangedEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
// Pre-compute this value to prevent the menu being briefly visible
|
||||
hideMeetings.value = !coreContext.defaultAccountHasVideoConferenceFactoryUri
|
||||
|
||||
coreContext.postOnCoreThread { core ->
|
||||
core.addListener(coreListener)
|
||||
configure()
|
||||
|
|
@ -301,8 +304,7 @@ open class AbstractMainViewModel
|
|||
val conferencingAvailable = LinphoneUtils.isRemoteConferencingAvailable(
|
||||
coreContext.core
|
||||
)
|
||||
val hideGroupCall =
|
||||
coreContext.core.accountList.isEmpty() || corePreferences.disableMeetings || !conferencingAvailable
|
||||
val hideGroupCall = corePreferences.disableMeetings || !conferencingAvailable
|
||||
hideMeetings.postValue(hideGroupCall)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue