Handle non-public notification records

This commit is contained in:
ajp_anton
2026-08-18 16:01:05 +00:00
parent 243bf62e67
commit c9d189ac97
@@ -45,7 +45,9 @@ internal class NotificationAttentionBridge(
}.getOrNull() }.getOrNull()
private fun eventFrom(record: Any?): SystemNotificationEvent? = runCatching { 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) SystemNotificationEvent.fromStatusBarNotification(sbn)
}.getOrNull() }.getOrNull()