1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-09-27 08:47:03 +02:00

Limit the number of temporarily stored notification IDs

This commit is contained in:
Andreas Böhler 2020-11-16 22:45:43 +01:00 committed by Gitea
parent 586e54a748
commit 9d710308fa

View File

@ -239,6 +239,11 @@ public class CasioGBX100DeviceSupport extends AbstractBTLEDeviceSupport {
LOG.info("onNotification id=" + notificationSpec.getId());
showNotification(icon, notificationSpec.sender, notificationSpec.title, notificationSpec.body, notificationSpec.getId(), false);
mSyncedNotificationIDs.add(new Integer(notificationSpec.getId()));
// The watch only holds up to 10 notifications. However, the user might have deleted
// some notifications in the meantime, so to be sure, we keep the last 100 IDs.
if(mSyncedNotificationIDs.size() > 100) {
mSyncedNotificationIDs.remove(0);
}
}
@Override