Simplified showMissedCallNotification function

This commit is contained in:
Juha Heinanen
2026-07-15 17:08:14 +03:00
parent f39153ac1d
commit 7fe544f697

View File

@ -3120,6 +3120,8 @@ class BaresipService: Service() {
.setDeleteIntent(dpi) .setDeleteIntent(dpi)
.setCategory(NotificationCompat.CATEGORY_MISSED_CALL) .setCategory(NotificationCompat.CATEGORY_MISSED_CALL)
.setAutoCancel(true) .setAutoCancel(true)
.setContentTitle(getString(R.string.missed_call_from))
.setContentText(caller)
var missedCalls = 0 var missedCalls = 0
for (notification in nm.activeNotifications) for (notification in nm.activeNotifications)
@ -3128,20 +3130,7 @@ class BaresipService: Service() {
break break
} }
if (missedCalls == 0) { nb.setNumber(missedCalls + 1)
nb.setContentTitle(getString(R.string.missed_call_from))
nb.setContentText(caller)
nb.setNumber(1)
} else {
nb.setContentTitle(getString(R.string.missed_calls))
nb.setContentText(
String.format(
getString(R.string.missed_calls_count),
missedCalls + 1
)
)
nb.setNumber(missedCalls + 1)
}
nm.notify(CALL_MISSED_NOTIFICATION_ID, nb.build()) nm.notify(CALL_MISSED_NOTIFICATION_ID, nb.build())
} }