Closed Bug 616272 Opened 14 years ago Closed 6 years ago

Don't let the OS kill us during long downloads

Categories

(Firefox for Android Graveyard :: Download Manager, defect, P3)

All
Android
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: blassey, Unassigned)

References

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.
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.
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).
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)
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
tracking-fennec: + → ---
Priority: P1 → P3
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
Closed: 6 years ago
Resolution: --- → WORKSFORME
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.