mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 21:55:10 +00:00
Mark request answers as so, to not show the notifications as new
This commit is contained in:
@@ -171,6 +171,10 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
||||
|
||||
@Override
|
||||
public void onNotificationPosted(StatusBarNotification statusBarNotification) {
|
||||
onNotificationPosted(statusBarNotification, false);
|
||||
}
|
||||
|
||||
public void onNotificationPosted(StatusBarNotification statusBarNotification, boolean requestAnswer) {
|
||||
|
||||
Notification notification = statusBarNotification.getNotification();
|
||||
NotificationId id = NotificationId.fromNotification(statusBarNotification);
|
||||
@@ -201,6 +205,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
||||
np.set("isClearable", statusBarNotification.isClearable());
|
||||
np.set("ticker", notification.tickerText.toString());
|
||||
np.set("time", new Long(statusBarNotification.getPostTime()).toString());
|
||||
if (requestAnswer) np.set("requestAnswer", true);
|
||||
|
||||
device.sendPackage(np);
|
||||
}
|
||||
@@ -220,7 +225,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
||||
public void onServiceStart(NotificationReceiver service) {
|
||||
StatusBarNotification[] notifications = service.getActiveNotifications();
|
||||
for (StatusBarNotification notification : notifications) {
|
||||
onNotificationPosted(notification);
|
||||
onNotificationPosted(notification, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user