When resuming to baresip, check if its default app roles have changed

This commit is contained in:
Juha Heinanen
2026-06-26 16:12:00 +03:00
parent 47eada966d
commit c4b3f8acb4
2 changed files with 16 additions and 0 deletions

View File

@ -617,6 +617,12 @@ class BaresipService: Service() {
if (!aecAvailable) if (!aecAvailable)
toast(getString(R.string.no_aec), Toast.LENGTH_LONG) toast(getString(R.string.no_aec), Toast.LENGTH_LONG)
if (VERSION.SDK_INT >= 29) {
val baresipService = Intent(this, BaresipService::class.java)
baresipService.action = "Check Roles"
startService(baresipService)
}
} }
"Notification Dismissed" -> "Notification Dismissed" ->
@ -751,6 +757,11 @@ class BaresipService: Service() {
"Update Notification" -> "Update Notification" ->
updateStatusNotification() updateStatusNotification()
"Check Roles" -> {
if (isNativeReady)
addMobileUserAgent()
}
"Start Call" -> { "Start Call" -> {
val uap = intent!!.getLongExtra("uap", 0L) val uap = intent!!.getLongExtra("uap", 0L)
val uri = intent.getStringExtra("uri")!! val uri = intent.getStringExtra("uri")!!

View File

@ -314,6 +314,11 @@ class MainActivity : ComponentActivity() {
super.onResume() super.onResume()
Log.d(TAG, "Main onResume") Log.d(TAG, "Main onResume")
nm.cancelAll() nm.cancelAll()
if (Build.VERSION.SDK_INT >= 29) {
val baresipService = Intent(this, BaresipService::class.java)
baresipService.action = "Check Roles"
startService(baresipService)
}
} }
override fun onPause() { override fun onPause() {