novoda / download-manager

A library that handles long-running downloads, handling the network interactions and retrying downloads automatically after failures
Apache License 2.0
483 stars 63 forks source link

Add a single dismissible notification #477

Closed Mecharyry closed 5 years ago

Mecharyry commented 5 years ago

Problem

As per issue #474, clients of the application cannot specify that they want a single dismissible notification. See #474 for discussion and usecase.

Solution

Add an additional NotificationDisplayState called SINGLE_DISMISSIBLE_NOTIFICATION, which will cancel all current notifications sent through the notification manager, not the service. This notification should not replace SINGLE_PERSISTENT_NOTIFICATION which is designed to operate on a foreground service and keep downloads working, this is additional functionality for the other states i.e. DELETED, DOWNLOADED etc.

Example

notifications mp4