Synched handling of events

This commit is contained in:
Juha Heinanen
2026-05-25 08:44:23 +03:00
parent 1bc93ca133
commit 1656bf8228

View File

@ -2371,9 +2371,11 @@ fun handleServiceEvent(ctx: Context, viewModel: ViewModel, event: String, params
fun handleNextEvent(logMessage: String? = null) {
if (logMessage != null)
Log.w(TAG, logMessage)
if (BaresipService.serviceEvents.isNotEmpty()) {
val first = BaresipService.serviceEvents.removeAt(0)
handleServiceEvent(ctx, viewModel, first.event, first.params)
synchronized(BaresipService.serviceEvents) {
if (BaresipService.serviceEvents.isNotEmpty()) {
val first = BaresipService.serviceEvents.removeAt(0)
handleServiceEvent(ctx, viewModel, first.event, first.params)
}
}
}