mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 12:56:49 +01:00
Limit the number of temporarily stored notification IDs
This commit is contained in:
parent
586e54a748
commit
9d710308fa
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user