Don't let the OS kill us during long downloads

RESOLVED WORKSFORME

Status

()

Firefox for Android
Download Manager
P3
normal
RESOLVED WORKSFORME
8 years ago
2 months ago

People

(Reporter: blassey, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
All
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

If I start a long download (including updates) and Fennec goes into the background the process gets kill a fair amount of the time on my Galaxy S (less so on my nexus one). Reading the Android docs, if there is an active service, it won't kill the process until it hits emergency OOM levels.

We could take advantage of this by starting a service which blocks until the download is completed, which will let the OS know that there is something going on in the background so it shouldn't kill us.

Comment 1

3 years ago
Any chance for this?
It looks to be a design flaw - a process and not a service.
As comment 0 states Android OS LMK will kill any process or service to free resources for foreground apps or to prevent the phone from becoming unresponsive.
(Reporter)

Updated

3 years ago
tracking-e10s: --- → ?

Comment 3

3 years ago
Yes, but (afaik) services are more "immune" to the LMK, that's why all the other browsers use a service for downloads.

Imagine this scenario (I was hit by it multiple types with Firefox on multiple devices):
1. Use Firefox for Android.
2. Start a download. It will take some time.
3. Switch to another (or more) application.
4. After some time & some switching between apps, the download is failed.

I encountered this even on a tablet with 2 GB RAM.
On any other browser, this didn't happen.
The only way I could keep the download through Firefox "alive" was to periodically (1-3 minutes) switch back to Firefox so Android would consider it a recent app and not "hibernate" it (causing the download to fail).
(Reporter)

Updated

3 years ago
tracking-fennec: --- → ?
tracking-e10s: ? → ---
Jenn, can you add this to the unprioritized board?
tracking-fennec: ? → +
Flags: needinfo?(jchaulk)
Priority: -- → P1
Barbara, do we have something equivalent to this anywhere?  If not, you can decide how to word/include it for funnel review :-)
Flags: needinfo?(bbermes)
That seems like an annoying bug. I created an Aha card for our funnel meeting.
Flags: needinfo?(bbermes)

Updated

2 years ago
Flags: needinfo?(jchaulk)
I thought this was already fixed. Regardless it's not a widget bug, moving to a better component.
Component: Widget: Android → Download Manager
OS: Linux → Android
Product: Core → Firefox for Android
Hardware: x86_64 → All
Blocks: 1157964
tracking-fennec: + → ---
Priority: P1 → P3

Comment 8

2 months ago
We're now starting the NotificationService as a foreground service [1] when showing an ongoing notification for a running download, which is about as much as we can do here.

[1] https://dxr.mozilla.org/mozilla-central/rev/d75d996016dcf325c2db2ed8a47af512d07ffacd/mobile/android/base/java/org/mozilla/gecko/notifications/NotificationService.java#23
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.