1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-09-26 16:26:52 +02:00

Fix notification filters by title if notification does not contain a body

This commit is contained in:
José Rebelo 2023-07-23 21:02:46 +01:00
parent a746943603
commit b1ceb96100
2 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,7 @@
* Zepp OS: Fix reminder creation
* Bump target SDK version to 31
* Fix media button control for some applications
* Fix notification filters by title if notification does not contain a body
* Fix opening screenshots from notification on external apps
* Fix reconnect delay reset after all devices are initialized
* Fix transliteration of emoji

View File

@ -96,6 +96,7 @@ import java.util.concurrent.TimeUnit;
import static nodomain.freeyourgadget.gadgetbridge.activities.NotificationFilterActivity.NOTIFICATION_FILTER_MODE_BLACKLIST;
import static nodomain.freeyourgadget.gadgetbridge.activities.NotificationFilterActivity.NOTIFICATION_FILTER_MODE_WHITELIST;
import static nodomain.freeyourgadget.gadgetbridge.activities.NotificationFilterActivity.NOTIFICATION_FILTER_SUBMODE_ALL;
import static nodomain.freeyourgadget.gadgetbridge.util.StringUtils.ensureNotNull;
public class NotificationListener extends NotificationListenerService {
@ -387,8 +388,9 @@ public class NotificationListener extends NotificationListenerService {
dissectNotificationTo(notification, notificationSpec, preferBigText);
if (notificationSpec.body != null) {
if (!checkNotificationContentForWhiteAndBlackList(sbn.getPackageName().toLowerCase(), notificationSpec.title + " " + notificationSpec.body)) {
if (notificationSpec.title != null || notificationSpec.body != null) {
final String textToCheck = ensureNotNull(notificationSpec.title) + " " + ensureNotNull(notificationSpec.body);
if (!checkNotificationContentForWhiteAndBlackList(sbn.getPackageName().toLowerCase(), textToCheck)) {
return;
}
}