mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 18:15:49 +01:00
Fossil Hybrid: can now delete notifications from watch
This commit is contained in:
parent
02b9cedcb7
commit
79939b7339
@ -798,11 +798,11 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
||||
try {
|
||||
for (NotificationHRConfiguration configuration : this.notificationConfigurations) {
|
||||
if (configuration.getPackageName().equals(sourceAppId)) {
|
||||
queueWrite(new PlayTextNotificationRequest(sourceAppId, senderOrTitle, notificationSpec.body, this));
|
||||
queueWrite(new PlayTextNotificationRequest(sourceAppId, senderOrTitle, notificationSpec.body, notificationSpec.getId(), this));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
queueWrite(new PlayTextNotificationRequest("generic", senderOrTitle, notificationSpec.body, this));
|
||||
queueWrite(new PlayTextNotificationRequest("generic", senderOrTitle, notificationSpec.body, notificationSpec.getId(), this));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -1281,6 +1281,10 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
||||
buffer.order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
int notifId = buffer.getInt(3);
|
||||
|
||||
Intent deleteIntent = new Intent(NotificationListener.ACTION_DISMISS);
|
||||
deleteIntent.putExtra("handle", (long) notifId);
|
||||
LocalBroadcastManager.getInstance(getContext()).sendBroadcast(deleteIntent);
|
||||
}
|
||||
|
||||
private void handleCallRequest(byte[] value) {
|
||||
|
@ -32,8 +32,8 @@ public abstract class PlayNotificationRequest extends FilePutRequest {
|
||||
super(FileHandle.NOTIFICATION_PLAY, createFile(notificationType, flags, packageName, packageName, packageName, getCurrentMessageId()), adapter);
|
||||
}
|
||||
|
||||
public PlayNotificationRequest(int notificationType, int flags, String packageName, String sender, String message, FossilWatchAdapter adapter) {
|
||||
super(FileHandle.NOTIFICATION_PLAY, createFile(notificationType, flags, packageName, sender, message, getCurrentMessageId()), adapter);
|
||||
public PlayNotificationRequest(int notificationType, int flags, String packageName, String sender, String message, int notificationId, FossilWatchAdapter adapter) {
|
||||
super(FileHandle.NOTIFICATION_PLAY, createFile(notificationType, flags, packageName, sender, message, notificationId), adapter);
|
||||
}
|
||||
|
||||
public PlayNotificationRequest(int notificationType, int flags, int packageCRC, String sender, String message, int messageId, FossilWatchAdapter adapter) {
|
||||
|
@ -3,8 +3,8 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fo
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.adapter.fossil.FossilWatchAdapter;
|
||||
|
||||
public class PlayTextNotificationRequest extends PlayNotificationRequest {
|
||||
public PlayTextNotificationRequest(String packageName, String sender, String message, FossilWatchAdapter adapter) {
|
||||
super(3, 2, packageName, sender, message, adapter);
|
||||
public PlayTextNotificationRequest(String packageName, String sender, String message, int messageId, FossilWatchAdapter adapter) {
|
||||
super(3, 2, packageName, sender, message, messageId, adapter);
|
||||
}
|
||||
|
||||
public PlayTextNotificationRequest(String packageName, FossilWatchAdapter adapter) {
|
||||
|
Loading…
Reference in New Issue
Block a user