mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-17 21:38:29 +00:00
Fixed in-call top bar notification label when going from two calls to one
This commit is contained in:
parent
d655817583
commit
08181afca4
1 changed files with 10 additions and 3 deletions
|
|
@ -163,7 +163,7 @@ class MainViewModel
|
||||||
state: Call.State?,
|
state: Call.State?,
|
||||||
message: String
|
message: String
|
||||||
) {
|
) {
|
||||||
Log.i("$TAG A call's state changed, updating 'alerts' if needed")
|
Log.i("$TAG Call [${call.remoteAddress.asStringUriOnly()}] state changed to [$state], updating 'alerts' if needed")
|
||||||
if (
|
if (
|
||||||
core.callsNb > 1 && (
|
core.callsNb > 1 && (
|
||||||
LinphoneUtils.isCallEnding(call.state) ||
|
LinphoneUtils.isCallEnding(call.state) ||
|
||||||
|
|
@ -173,9 +173,16 @@ class MainViewModel
|
||||||
) {
|
) {
|
||||||
updateCallAlert()
|
updateCallAlert()
|
||||||
} else if (core.callsNb == 1) {
|
} else if (core.callsNb == 1) {
|
||||||
|
if (callsStatus.value.orEmpty().isEmpty()) {
|
||||||
|
// In case there was more than one call and now there is only one left
|
||||||
|
updateCallAlert()
|
||||||
|
} else if (call.state != Call.State.Released) {
|
||||||
|
// When you have two calls, when the one is ended core.callsNb will become 1
|
||||||
|
// but the ended one will still go to Released state after that
|
||||||
callsStatus.postValue(LinphoneUtils.callStateToString(call.state))
|
callsStatus.postValue(LinphoneUtils.callStateToString(call.state))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
override fun onMessagesReceived(
|
override fun onMessagesReceived(
|
||||||
|
|
@ -564,7 +571,7 @@ class MainViewModel
|
||||||
}
|
}
|
||||||
} else if (callsNb > 1) {
|
} else if (callsNb > 1) {
|
||||||
callLabel.postValue(AppUtils.getFormattedString(R.string.calls_count_label, callsNb))
|
callLabel.postValue(AppUtils.getFormattedString(R.string.calls_count_label, callsNb))
|
||||||
callsStatus.postValue("") // TODO: improve ?
|
callsStatus.postValue("")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue