Notification fixed

This commit is contained in:
Jens 2021-08-31 23:13:59 +02:00
parent dc35c8b7fb
commit db21011b7f

View File

@ -835,18 +835,15 @@ public class Rule implements Comparable<Rule>
}
/*
If there are multiple notifications ("stacked") this will fail.
If there are multiple notifications ("stacked") title or text might be null:
https://stackoverflow.com/questions/28047767/notificationlistenerservice-not-reading-text-of-stacked-notifications
*/
Bundle extras = sbn.getNotification().extras;
if (extras.containsKey(EXTRA_TITLE))
notificationTitle = sbn.getNotification().extras.getString(EXTRA_TITLE);
if (extras.containsKey(EXTRA_TEXT))
notificationText = sbn.getNotification().extras.getString(EXTRA_TEXT);
// T I T L E
if (extras.containsKey(EXTRA_TITLE))
notificationTitle = sbn.getNotification().extras.getString(EXTRA_TITLE);
if (!StringUtils.isEmpty(requiredTitle))
{
@ -861,6 +858,9 @@ public class Rule implements Comparable<Rule>
// T E X T
if (extras.containsKey(EXTRA_TEXT))
notificationText = sbn.getNotification().extras.getString(EXTRA_TEXT);
if (!StringUtils.isEmpty(requiredText))
{
if (!Miscellaneous.compare(myTextDir, requiredText, notificationText))
@ -871,7 +871,6 @@ public class Rule implements Comparable<Rule>
}
else
Miscellaneous.logEvent("i", "NotificationCheck", "A required text for a notification trigger was not specified.", 5);
// }
foundMatch = true;
break;