diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fd3ad0fa0..8ab7bada4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -121,7 +121,7 @@ android:windowSoftInputMode="adjustResize"/> diff --git a/app/src/main/java/org/linphone/activities/voip/CallActivity.kt b/app/src/main/java/org/linphone/activities/voip/CallActivity.kt index 678363b41..3cb076124 100644 --- a/app/src/main/java/org/linphone/activities/voip/CallActivity.kt +++ b/app/src/main/java/org/linphone/activities/voip/CallActivity.kt @@ -86,8 +86,11 @@ class CallActivity : ProximitySensorActivity() { callsViewModel.noMoreCallEvent.observe( this ) { - it.consume { - finish() + it.consume { noMoreCall -> + if (noMoreCall) { + Log.i("[Call Activity] No more call event fired, finishing activity") + finish() + } } } diff --git a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt index 87af8dedb..d8540defb 100644 --- a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt +++ b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt @@ -443,6 +443,17 @@ class NotificationsManager(private val context: Context) { return } + try { + val showLockScreenNotification = android.provider.Settings.Secure.getInt( + context.contentResolver, + "lock_screen_show_notifications", + 0 + ) + Log.i("[Notifications Manager] Are notifications allowed on lock screen? ${showLockScreenNotification != 0} ($showLockScreenNotification)") + } catch (e: Exception) { + Log.e("[Notifications Manager] Failed to get android.provider.Settings.Secure.getInt(lock_screen_show_notifications): $e") + } + val notifiable = getNotifiableForCall(call) if (notifiable.notificationId == currentForegroundServiceNotificationId) { Log.e("[Notifications Manager] There is already a Service foreground notification for an incoming call, cancelling it") @@ -450,8 +461,8 @@ class NotificationsManager(private val context: Context) { currentForegroundServiceNotificationId = 0 } - val incomingCallNotificationIntent = Intent(context, org.linphone.activities.voip.CallActivity::class.java) - incomingCallNotificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + val incomingCallNotificationIntent = Intent(context, CallActivity::class.java) + incomingCallNotificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_USER_ACTION) val pendingIntent = PendingIntent.getActivity( context, 0,