Closed Bug 851056 Opened 12 years ago Closed 12 years ago

Downloads can't be canceled if the user closes Firefox while the download is in progress

Categories

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

ARM
Android
defect
Not set
major

Tracking

(firefox20 wontfix, firefox21 verified, firefox22 verified)

VERIFIED FIXED
Firefox 22
Tracking Status
firefox20 --- wontfix
firefox21 --- verified
firefox22 --- verified

People

(Reporter: AdrianT, Assigned: bnicholson)

References

Details

(Keywords: relnote)

Attachments

(3 files, 1 obsolete file)

Attached file log from Firefox Beta
Nightly 22.0a1 2013-03-14 / Firefox Mobile 20 beta 5 / Aurora 21.0a2 2013-03-14
Samsung Galaxy Tab 2 (Android 4.1.1)

Steps to reproduce:
1) Start a large download - try a nightly build for e.g.
2) Minimize the app and close it from the Task Manager
3) Pull down the notification bar and tap on the Download Notification

Expected results:
The user is asked if he wants to cancel the download just like when Firefox is opened

Actual results:
On Beta and Aurora the app is restarted but the user is not prompted if he wants to cancel the download. Tapping the notification dismisses it but the download is still active in the background and will eventualy display a Download Complete notification

On Nightly the notification is instantly dismissed and the download continues in the background.
Attached file log from Nightly
Blocks: 823285
(In reply to adrian tamas from comment #0)
> Created attachment 724868 [details]
> log from Firefox Beta
> 
> Actual results:
> On Beta and Aurora the app is restarted but the user is not prompted if he
> wants to cancel the download. Tapping the notification dismisses it but the
> download is still active in the background and will eventualy display a
> Download Complete notification
> 
> On Nightly the notification is instantly dismissed and the download
> continues in the background.

Weird - on my Droid RAZR, clicking the notification reopens Fennec and shows the prompt, as expected.

Attaching the Fennec application context to the notification more of a hack than a fix. We should implement a real native download manager that won't require Gecko to stay alive during downloads, and I imagine it may also fix issues like this one.
Attached patch Remove NotificationHandler (obsolete) — Splinter Review
Something is broken about the way we broadcast intents to NotificationHandler. Following the STR for Nightly, I never see the intent being sent to or handled by NotificationHandler; the notification immediately dies when tapped. This looks like some side effect of setForeground() since this only happens for foreground in-progress notifications.

I found that opening the Activity directly fixes the issue, so we might as well just remove NotificationHandler since its only purpose is to forward the intent to GeckoApp anyway. I also removed the clearIntent code because we weren't actually doing anything with it.

Finally, I moved super.onDestroy() to the end of onDestroy() in BrowserApp because I was seeing an IllegalStateException in logcat for using the nfc API after being destroyed.
Assignee: nobody → bnicholson
Status: NEW → ASSIGNED
Attachment #725091 - Flags: review?(bugmail.mozilla)
Removed some fixes from local testing.
Attachment #725091 - Attachment is obsolete: true
Attachment #725091 - Flags: review?(bugmail.mozilla)
Attachment #725095 - Flags: review?(bugmail.mozilla)
Attachment #725095 - Flags: review?(bugmail.mozilla) → review+
Bug 823285 didn't land on beta since the risk was too high, so it won't be fixed in Fx20.
https://hg.mozilla.org/mozilla-central/rev/42caf4845677
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Status: RESOLVED → VERIFIED
Comment on attachment 725095 [details] [diff] [review]
Remove NotificationHandler, v2

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 823285
User impact if declined: the fix for bug 823285 won't work on some phones; also, this bug is needed to land bug 850693
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): low risk
String or UUID changes made by this patch: none
Attachment #725095 - Flags: approval-mozilla-aurora?
Comment on attachment 725095 [details] [diff] [review]
Remove NotificationHandler, v2

low risk uplift, aids fix a top-crasher . Approving for uplift.
Attachment #725095 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Verified on Firefox for Android 21.0b7 using: Nexus 4 (4.2.2)
tracking-fennec: ? → ---
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: