Notification fixed
This commit is contained in:
parent
dc35c8b7fb
commit
db21011b7f
@ -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
|
https://stackoverflow.com/questions/28047767/notificationlistenerservice-not-reading-text-of-stacked-notifications
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Bundle extras = sbn.getNotification().extras;
|
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
|
// T I T L E
|
||||||
|
if (extras.containsKey(EXTRA_TITLE))
|
||||||
|
notificationTitle = sbn.getNotification().extras.getString(EXTRA_TITLE);
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(requiredTitle))
|
if (!StringUtils.isEmpty(requiredTitle))
|
||||||
{
|
{
|
||||||
@ -861,6 +858,9 @@ public class Rule implements Comparable<Rule>
|
|||||||
|
|
||||||
// T E X T
|
// T E X T
|
||||||
|
|
||||||
|
if (extras.containsKey(EXTRA_TEXT))
|
||||||
|
notificationText = sbn.getNotification().extras.getString(EXTRA_TEXT);
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(requiredText))
|
if (!StringUtils.isEmpty(requiredText))
|
||||||
{
|
{
|
||||||
if (!Miscellaneous.compare(myTextDir, requiredText, notificationText))
|
if (!Miscellaneous.compare(myTextDir, requiredText, notificationText))
|
||||||
@ -871,7 +871,6 @@ public class Rule implements Comparable<Rule>
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
Miscellaneous.logEvent("i", "NotificationCheck", "A required text for a notification trigger was not specified.", 5);
|
Miscellaneous.logEvent("i", "NotificationCheck", "A required text for a notification trigger was not specified.", 5);
|
||||||
// }
|
|
||||||
|
|
||||||
foundMatch = true;
|
foundMatch = true;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user