From fbdd4da2832e252ddcce61862c38cf8199d9c610 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 31 Mar 2025 09:21:38 +0200 Subject: [PATCH] Forgot to change some of POST_NOTIFICATIONS checks --- .../notifications/NotificationsManager.kt | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt index 77a8bf507..787e71073 100644 --- a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt +++ b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt @@ -715,14 +715,10 @@ class NotificationsManager Log.i("$TAG Trying to start foreground Service using incoming call notification") val service = inCallService if (service != null) { - Log.i( - "$TAG Service found, starting it as foreground using notification ID [$INCOMING_CALL_ID] with type PHONE_CALL" - ) - if (ActivityCompat.checkSelfPermission( - context, - Manifest.permission.POST_NOTIFICATIONS - ) == PackageManager.PERMISSION_GRANTED - ) { + if (Compatibility.isPostNotificationsPermissionGranted(context)) { + Log.i( + "$TAG Service found, starting it as foreground using notification ID [$INCOMING_CALL_ID] with type PHONE_CALL" + ) Compatibility.startServiceForeground( service, INCOMING_CALL_ID, @@ -826,11 +822,7 @@ class NotificationsManager } } - if (ActivityCompat.checkSelfPermission( - context, - Manifest.permission.POST_NOTIFICATIONS - ) == PackageManager.PERMISSION_GRANTED - ) { + if (Compatibility.isPostNotificationsPermissionGranted(context)) { Log.i( "$TAG Service found, starting it as foreground using notification ID [${notifiable.notificationId}] with type(s) [$mask]" )