mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-25 16:15:55 +01:00
Fix notification filters by title if notification does not contain a body
This commit is contained in:
parent
a746943603
commit
b1ceb96100
@ -18,6 +18,7 @@
|
|||||||
* Zepp OS: Fix reminder creation
|
* Zepp OS: Fix reminder creation
|
||||||
* Bump target SDK version to 31
|
* Bump target SDK version to 31
|
||||||
* Fix media button control for some applications
|
* 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 opening screenshots from notification on external apps
|
||||||
* Fix reconnect delay reset after all devices are initialized
|
* Fix reconnect delay reset after all devices are initialized
|
||||||
* Fix transliteration of emoji
|
* Fix transliteration of emoji
|
||||||
|
@ -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_BLACKLIST;
|
||||||
import static nodomain.freeyourgadget.gadgetbridge.activities.NotificationFilterActivity.NOTIFICATION_FILTER_MODE_WHITELIST;
|
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.activities.NotificationFilterActivity.NOTIFICATION_FILTER_SUBMODE_ALL;
|
||||||
|
import static nodomain.freeyourgadget.gadgetbridge.util.StringUtils.ensureNotNull;
|
||||||
|
|
||||||
public class NotificationListener extends NotificationListenerService {
|
public class NotificationListener extends NotificationListenerService {
|
||||||
|
|
||||||
@ -387,8 +388,9 @@ public class NotificationListener extends NotificationListenerService {
|
|||||||
|
|
||||||
dissectNotificationTo(notification, notificationSpec, preferBigText);
|
dissectNotificationTo(notification, notificationSpec, preferBigText);
|
||||||
|
|
||||||
if (notificationSpec.body != null) {
|
if (notificationSpec.title != null || notificationSpec.body != null) {
|
||||||
if (!checkNotificationContentForWhiteAndBlackList(sbn.getPackageName().toLowerCase(), notificationSpec.title + " " + notificationSpec.body)) {
|
final String textToCheck = ensureNotNull(notificationSpec.title) + " " + ensureNotNull(notificationSpec.body);
|
||||||
|
if (!checkNotificationContentForWhiteAndBlackList(sbn.getPackageName().toLowerCase(), textToCheck)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user