Handle non-public notification records
This commit is contained in:
+3
-1
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user