diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiNotificationService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiNotificationService.java index a2da9e080..b831ced2a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiNotificationService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiNotificationService.java @@ -87,11 +87,13 @@ public class XiaomiNotificationService extends AbstractXiaomiService implements switch (cmd.getSubtype()) { case CMD_NOTIFICATION_DISMISS: - final int dismissNotificationId = cmd.getNotification().getNotification4().getNotificationId().getId(); - LOG.info("Watch dismiss notification {}", dismissNotificationId); - deviceEvtNotificationControl.handle = dismissNotificationId; - deviceEvtNotificationControl.event = GBDeviceEventNotificationControl.Event.DISMISS; - getSupport().evaluateGBDeviceEvent(deviceEvtNotificationControl); + LOG.info("Watch dismiss {} notifications", cmd.getNotification().getNotificationDismiss().getNotificationIdCount()); + for (final XiaomiProto.NotificationId notificationId : cmd.getNotification().getNotificationDismiss().getNotificationIdList()) { + LOG.debug("Watch dismiss {}", notificationId.getId()); + deviceEvtNotificationControl.handle = notificationId.getId(); + deviceEvtNotificationControl.event = GBDeviceEventNotificationControl.Event.DISMISS; + getSupport().evaluateGBDeviceEvent(deviceEvtNotificationControl); + } return; case CMD_CALL_REJECT: LOG.debug("Reject call"); @@ -196,10 +198,10 @@ public class XiaomiNotificationService extends AbstractXiaomiService implements if (callSpec.command != CallSpec.CALL_INCOMING) { final XiaomiProto.NotificationDismiss.Builder notification4 = XiaomiProto.NotificationDismiss.newBuilder() - .setNotificationId(XiaomiProto.NotificationId.newBuilder().setId(0).setPackage("phone")); + .addNotificationId(XiaomiProto.NotificationId.newBuilder().setId(0).setPackage("phone")); final XiaomiProto.Notification notification = XiaomiProto.Notification.newBuilder() - .setNotification4(notification4) + .setNotificationDismiss(notification4) .build(); getSupport().sendCommand( diff --git a/app/src/main/proto/xiaomi.proto b/app/src/main/proto/xiaomi.proto index e3c49081b..b4a769b81 100644 --- a/app/src/main/proto/xiaomi.proto +++ b/app/src/main/proto/xiaomi.proto @@ -571,7 +571,7 @@ message MediaKey { message Notification { optional Notification2 notification2 = 3; - optional NotificationDismiss notification4 = 4; + optional NotificationDismiss notificationDismiss = 4; optional bool screenOnOnNotifications = 7; optional uint32 unknown8 = 8; // 1 on canned replies request? @@ -605,7 +605,7 @@ message Notification3 { } message NotificationDismiss { - optional NotificationId notificationId = 1; + repeated NotificationId notificationId = 1; } message NotificationId {