This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6954: Closes #6893 Fulfill the foreground service contract on AbstractFetchDownloadService r=notWoods,pocmo a=Amejia481 For fulfilling the Android foreground service api, we need to provide a notification, this notification will be marked as ongoing by the OS, and we won't be able to remove it until we are not longer a foreground a service by calling `stopForeground`. For this reason, I used two approaches: **Devices that support notification group:** [Demo 🎮 ](https://drive.google.com/file/d/1xaGh4qx_3913t4s1GenvIJphRFWNQvWP/view?usp=sharing) A separate notification (a summary of all notification) which will be the foreground notification, it will be always present until we don't have more active downloads. **Devices that DO NOT support notification group:** [Demo 🎮 (Tested on Android 5.1.1) ](https://drive.google.com/file/d/10f26Ggh5uXVn5gCbrCBp3o5s2eNoAbzU/view?usp=sharing) Set the latest active notification as the foreground notification and keep changing it to the latest active download. **Note:** To reduce battery consumption when all the downloads notifications have been dismissed we stop the service. Related issues #4910 Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com>
- Loading branch information