From e533bbbdc90290ff30ae3c8efe864d6d1fc0293a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 8 Aug 2022 18:47:37 +0200 Subject: [PATCH] show a default priority notification at incoming calls with locked screen too --- .../com/simplemobiletools/dialer/services/CallService.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt index 5c1ddf4a..fbefdc8e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt @@ -6,7 +6,6 @@ import android.content.Context import android.telecom.Call import android.telecom.InCallService import com.simplemobiletools.dialer.activities.CallActivity -import com.simplemobiletools.dialer.extensions.getStateCompat import com.simplemobiletools.dialer.extensions.isOutgoing import com.simplemobiletools.dialer.extensions.powerManager import com.simplemobiletools.dialer.helpers.CallManager @@ -34,10 +33,8 @@ class CallService : InCallService() { val isScreenLocked = (getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager).isDeviceLocked if (!powerManager.isInteractive || call.isOutgoing() || isScreenLocked) { try { + callNotificationManager.setupNotification() startActivity(CallActivity.getStartIntent(this)) - if (call.getStateCompat() != Call.STATE_RINGING) { - callNotificationManager.setupNotification() - } } catch (e: ActivityNotFoundException) { // seems like startActivity can thrown AndroidRuntimeException and ActivityNotFoundException, not yet sure when and why, lets show a notification callNotificationManager.setupNotification()