mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Xiaomi: Fix dismiss multiple notifications from watch
This commit is contained in:
parent
6479cc3bb0
commit
2b8d8c2cb0
@ -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(
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user