2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 06:05:12 +00:00

Mark request answers as so, to not show the notifications as new

This commit is contained in:
Albert Vaca
2013-08-22 04:38:04 +02:00
parent 1d09358075
commit 72b25f2b7d

View File

@@ -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);
}
}
});