Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge #6954
Browse files Browse the repository at this point in the history
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
MozLando and Amejia481 committed May 26, 2020
2 parents 0f6e197 + fd18d39 commit ff02047
Show file tree
Hide file tree
Showing 5 changed files with 729 additions and 174 deletions.
Loading

0 comments on commit ff02047

Please sign in to comment.