Pebble: try to work around duplicate Telegram messages

(#395)
This commit is contained in:
Andreas Shimokawa 2016-09-22 09:31:14 +02:00
parent 8080734470
commit fd03dac5cd
1 changed files with 5 additions and 0 deletions

View File

@ -285,6 +285,11 @@ 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();
if (actions.isEmpty() && notificationSpec.type == NotificationType.TELEGRAM) {
return; // workaround for duplicate telegram message
}
for (NotificationCompat.Action act : actions) { for (NotificationCompat.Action act : actions) {
if (act != null && act.getRemoteInputs() != null) { if (act != null && act.getRemoteInputs() != null) {
LOG.info("found wearable action: " + act.getTitle() + " " + sbn.getTag()); LOG.info("found wearable action: " + act.getTitle() + " " + sbn.getTag());