Require an available notification manager at overlay IPC boundaries

This commit is contained in:
evgeny committed 2026-10-29 13:34:23 +01:00
1 parent 19050cd4f2
commit 2f43407ae4
1 file changed
+3 -2
@@ -59,7 +59,8 @@ class RadioOverlayService : Service() {
fun refreshLanguage() {
currentService?.let { service ->
service.createChannel()
service.getSystemService(NotificationManager::class.java).notify(NOTIF_ID, service.buildNotification())
requireNotNull(service.getSystemService(NotificationManager::class.java)) { "notification manager unavailable" }
.notify(NOTIF_ID, service.buildNotification())
}
}
@@ -301,7 +302,7 @@ class RadioOverlayService : Service() {
val ch = NotificationChannel(CHANNEL_ID, AppLanguage.text(R.string.radio_ptt), NotificationManager.IMPORTANCE_LOW).apply {
description = AppLanguage.text(R.string.radio_overlay_description)
}
getSystemService(NotificationManager::class.java).createNotificationChannel(ch)
requireNotNull(getSystemService(NotificationManager::class.java)) { "notification manager unavailable" }.createNotificationChannel(ch)
}
}