From c9d189ac97d2d6a06418a5d379359bcbcd9af975 Mon Sep 17 00:00:00 2001 From: ajp_anton Date: Tue, 18 Aug 2026 16:01:05 +0000 Subject: [PATCH] Handle non-public notification records --- .../notificationsmaster/module/NotificationAttentionBridge.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/se/ajpanton/notificationsmaster/module/NotificationAttentionBridge.kt b/app/src/main/java/se/ajpanton/notificationsmaster/module/NotificationAttentionBridge.kt index 87a5002..92b467c 100644 --- a/app/src/main/java/se/ajpanton/notificationsmaster/module/NotificationAttentionBridge.kt +++ b/app/src/main/java/se/ajpanton/notificationsmaster/module/NotificationAttentionBridge.kt @@ -45,7 +45,9 @@ internal class NotificationAttentionBridge( }.getOrNull() private fun eventFrom(record: Any?): SystemNotificationEvent? = runCatching { - val sbn = record?.javaClass?.getMethod("getSbn")?.invoke(record) as? StatusBarNotification ?: return null + val method = record?.javaClass?.getDeclaredMethod("getSbn") ?: return null + method.isAccessible = true + val sbn = method.invoke(record) as? StatusBarNotification ?: return null SystemNotificationEvent.fromStatusBarNotification(sbn) }.getOrNull()