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()