This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 473
Fulfill the foreground service contract on AbstractFetchDownloadService #6893
Labels
Milestone
Comments
Amejia481
added
🐞 bug
Something isn't working
<download>
Component: feature-download
labels
May 7, 2020
Amejia481
added a commit
to Amejia481/android-components
that referenced
this issue
May 12, 2020
… AbstractFetchDownloadService
Amejia481
added a commit
to Amejia481/android-components
that referenced
this issue
May 18, 2020
… AbstractFetchDownloadService
Amejia481
added a commit
to Amejia481/android-components
that referenced
this issue
May 18, 2020
… AbstractFetchDownloadService
Amejia481
added a commit
to Amejia481/android-components
that referenced
this issue
May 18, 2020
AbstractFetchDownloadService
Amejia481
added a commit
to Amejia481/android-components
that referenced
this issue
May 18, 2020
AbstractFetchDownloadService.
bors bot
pushed a commit
that referenced
this issue
May 26, 2020
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>
bors bot
pushed a commit
that referenced
this issue
May 26, 2020
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>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
For
AbstractFetchDownloadService
to be considered as a foreground service it needs to callstartForeground()
and provides an ongoing notification this signal Android that this task isn't a candidate for the system to kill when low on memory, avoiding issues like mozilla-mobile/fenix#9884┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: