1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-09 07:01:33 +02:00

Whitelist group summary notifications for "mikado.bizcalpro"

Causes multiple notification to be sent, but this seems to be a bug from that app
This commit is contained in:
Andreas Shimokawa 2020-01-28 11:12:56 +01:00
parent 01d19e5384
commit b91f357dc0
2 changed files with 7 additions and 1 deletions

View File

@ -55,6 +55,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
@ -108,6 +109,10 @@ public class NotificationListener extends NotificationListenerService {
private HashMap<String, Long> notificationBurstPrevention = new HashMap<>();
private HashMap<String, Long> notificationOldRepeatPrevention = new HashMap<>();
private static final List<String> groupSummaryWhitelist = Arrays.asList(
"mikado.bizcalpro"
);
public static ArrayList<String> notificationStack = new ArrayList<>();
private long activeCallPostTime;
@ -342,7 +347,7 @@ public class NotificationListener extends NotificationListenerService {
List<NotificationCompat.Action> actions = wearableExtender.getActions();
if (actions.size() == 0 && NotificationCompat.isGroupSummary(notification)) { //this could cause #395 to come back
if (actions.size() == 0 && NotificationCompat.isGroupSummary(notification) && !groupSummaryWhitelist.contains(source)) { //this could cause #395 to come back
LOG.info("Not forwarding notification, FLAG_GROUP_SUMMARY is set and no wearable action present. Notification flags: " + notification.flags);
return;
}

View File

@ -51,6 +51,7 @@ public class AppNotificationType extends HashMap<String, NotificationType> {
// Generic Calendar
put("com.android.calendar", NotificationType.GENERIC_CALENDAR);
put("mikado.bizcalpro", NotificationType.BUSINESS_CALENDAR);
// Google
put("com.google.android.gm", NotificationType.GMAIL);