Always set fullScreenIntent when showing incoming call notification

Impoved finding userpart from caller URI
This commit is contained in:
Juha Heinanen
2026-05-03 12:00:38 +03:00
parent 46a5526eab
commit 1604bbc407
@@ -1755,6 +1755,7 @@ class BaresipService: Service() {
var type = 0
if (VERSION.SDK_INT >= 30) {
type = type or ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL
if (ContextCompat.checkSelfPermission(this, RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED)
type = type or ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
}
if (VERSION.SDK_INT >= 34) {
@@ -1789,7 +1790,7 @@ class BaresipService: Service() {
val peerUri = call.peerUri
val callp = call.callp
val callerNumber = peerUri.split(":")[1].split("@")[0]
val callerNumber = Utils.uriUserPart(peerUri)
if (shouldStartRinging(callerNumber))
startRinging()
@@ -1841,7 +1842,6 @@ class BaresipService: Service() {
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setPriority(NotificationCompat.PRIORITY_MAX)
if (VERSION.SDK_INT < 34 || nm.canUseFullScreenIntent())
nb.setFullScreenIntent(pi, true)
val answerIntent = Intent(applicationContext, MainActivity::class.java)