Always set fullScreenIntent when showing incoming call notification
Impoved finding userpart from caller URI
This commit is contained in:
@@ -1755,6 +1755,7 @@ class BaresipService: Service() {
|
|||||||
var type = 0
|
var type = 0
|
||||||
if (VERSION.SDK_INT >= 30) {
|
if (VERSION.SDK_INT >= 30) {
|
||||||
type = type or ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL
|
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
|
type = type or ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
|
||||||
}
|
}
|
||||||
if (VERSION.SDK_INT >= 34) {
|
if (VERSION.SDK_INT >= 34) {
|
||||||
@@ -1789,7 +1790,7 @@ class BaresipService: Service() {
|
|||||||
val peerUri = call.peerUri
|
val peerUri = call.peerUri
|
||||||
val callp = call.callp
|
val callp = call.callp
|
||||||
|
|
||||||
val callerNumber = peerUri.split(":")[1].split("@")[0]
|
val callerNumber = Utils.uriUserPart(peerUri)
|
||||||
if (shouldStartRinging(callerNumber))
|
if (shouldStartRinging(callerNumber))
|
||||||
startRinging()
|
startRinging()
|
||||||
|
|
||||||
@@ -1841,7 +1842,6 @@ class BaresipService: Service() {
|
|||||||
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
||||||
.setPriority(NotificationCompat.PRIORITY_MAX)
|
.setPriority(NotificationCompat.PRIORITY_MAX)
|
||||||
|
|
||||||
if (VERSION.SDK_INT < 34 || nm.canUseFullScreenIntent())
|
|
||||||
nb.setFullScreenIntent(pi, true)
|
nb.setFullScreenIntent(pi, true)
|
||||||
|
|
||||||
val answerIntent = Intent(applicationContext, MainActivity::class.java)
|
val answerIntent = Intent(applicationContext, MainActivity::class.java)
|
||||||
|
|||||||
Reference in New Issue
Block a user