mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +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:
@@ -55,6 +55,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -108,6 +109,10 @@ public class NotificationListener extends NotificationListenerService {
|
|||||||
private HashMap<String, Long> notificationBurstPrevention = new HashMap<>();
|
private HashMap<String, Long> notificationBurstPrevention = new HashMap<>();
|
||||||
private HashMap<String, Long> notificationOldRepeatPrevention = 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<>();
|
public static ArrayList<String> notificationStack = new ArrayList<>();
|
||||||
|
|
||||||
private long activeCallPostTime;
|
private long activeCallPostTime;
|
||||||
@@ -342,7 +347,7 @@ public class NotificationListener extends NotificationListenerService {
|
|||||||
List<NotificationCompat.Action> actions = wearableExtender.getActions();
|
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);
|
LOG.info("Not forwarding notification, FLAG_GROUP_SUMMARY is set and no wearable action present. Notification flags: " + notification.flags);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -51,6 +51,7 @@ public class AppNotificationType extends HashMap<String, NotificationType> {
|
|||||||
|
|
||||||
// Generic Calendar
|
// Generic Calendar
|
||||||
put("com.android.calendar", NotificationType.GENERIC_CALENDAR);
|
put("com.android.calendar", NotificationType.GENERIC_CALENDAR);
|
||||||
|
put("mikado.bizcalpro", NotificationType.BUSINESS_CALENDAR);
|
||||||
|
|
||||||
// Google
|
// Google
|
||||||
put("com.google.android.gm", NotificationType.GMAIL);
|
put("com.google.android.gm", NotificationType.GMAIL);
|
||||||
|
Reference in New Issue
Block a user