mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-26 16:41:43 +01:00
Fix Skype notifications
This commit is contained in:
parent
9f0169542e
commit
42853df591
@ -53,8 +53,8 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -110,9 +110,11 @@ public class NotificationListener extends NotificationListenerService {
|
|||||||
private final HashMap<String, Long> notificationBurstPrevention = new HashMap<>();
|
private final HashMap<String, Long> notificationBurstPrevention = new HashMap<>();
|
||||||
private final HashMap<String, Long> notificationOldRepeatPrevention = new HashMap<>();
|
private final HashMap<String, Long> notificationOldRepeatPrevention = new HashMap<>();
|
||||||
|
|
||||||
private static final Set<String> GROUP_SUMMARY_WHITELIST = Collections.singleton(
|
private static final Set<String> GROUP_SUMMARY_WHITELIST = new HashSet<String>() {{
|
||||||
"mikado.bizcalpro"
|
add("com.microsoft.office.lync15");
|
||||||
);
|
add("com.skype.raider");
|
||||||
|
add("mikado.bizcalpro");
|
||||||
|
}};
|
||||||
|
|
||||||
public static ArrayList<String> notificationStack = new ArrayList<>();
|
public static ArrayList<String> notificationStack = new ArrayList<>();
|
||||||
private static ArrayList<Integer> notificationsActive = new ArrayList<Integer>();
|
private static ArrayList<Integer> notificationsActive = new ArrayList<Integer>();
|
||||||
@ -388,7 +390,8 @@ public class NotificationListener extends NotificationListenerService {
|
|||||||
NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender(notification);
|
NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender(notification);
|
||||||
List<NotificationCompat.Action> actions = wearableExtender.getActions();
|
List<NotificationCompat.Action> actions = wearableExtender.getActions();
|
||||||
|
|
||||||
|
// Some apps such as Telegram send both a group + normal notifications, which would get sent in duplicate to the devices
|
||||||
|
// Others only send the group summary, so they need to be whitelisted
|
||||||
if (actions.isEmpty() && NotificationCompat.isGroupSummary(notification)
|
if (actions.isEmpty() && NotificationCompat.isGroupSummary(notification)
|
||||||
&& !GROUP_SUMMARY_WHITELIST.contains(source)) { //this could cause #395 to come back
|
&& !GROUP_SUMMARY_WHITELIST.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);
|
||||||
|
Loading…
Reference in New Issue
Block a user