Closed Bug 669298 Opened 13 years ago Closed 5 years ago

Download notification is not triggered if Fennec performs this action before it loads for the first time

Categories

(Firefox for Android Graveyard :: General, defect)

Firefox 6
ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: xti, Unassigned)

Details

Attachments

(1 file)

Build id : Mozilla/5.0 (Android;Linux armv7l;rv:6.0a2)Gecko/20110704
Firefox/6.0a2 Fennec/6.0a2
Device: Motorola Droid 2
OS: Android 2.2

Steps to reproduce:
1. Install Aurora 6 build (do not open app after it has been installed)
2. Open the stock browser
3. Browse to http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-mozilla-central-android-r7/
4. Tap on fennec-7.0a1.multi.eabi-arm.apk
5. Choose from the "Complete actions using" list Aurora app

Expected result:
After step 5, Aurora app opens and a download notification triggers on the Android Notification Bar.

Actual result:
Download notification is not triggered.
Alex - Can you take a look at this?
Assignee: nobody → alexp
showAlertNotification is not called for some reason - need to debug to get more info.
Status: NEW → ASSIGNED
The problem here is that the "pageshow" and subsequently "UIReadyDelayed" events are not issued, so DownloadsView.init() function does not get called, and no download UI is displayed because of that.
An easiest fix would be to call DownloadsView.init() directly from the BrowserUI.init(), but this is not right.
I guess for this scenario we should call "UIReadyDelayed" at some point without waiting for the "pageshow" event. Any specific suggestions, when and where to do this?
This is a bit tricky since Fennec is loading a non-HTML file from an external source. Normally we load HTML type files and the normal "pageshow" / "UIReadyDelay" events are fired.

I guess we should look for ways to guess that the file is non-HTML and init DownloadView - maybe in BrowserCLH.js?

We could also check to see what events are fired in this situation.

Lastly, we could figure out what parts of DownloadView.init() are _really_ needed to catch this. I assume we need the download listener. We could figure out a way to only do the minimum initialization for the listener, and do it in a call from BrowserUI or BrowserCLH?
(In reply to comment #4)
> Lastly, we could figure out what parts of DownloadView.init() are _really_
> needed to catch this. I assume we need the download listener.

All the init() does now is adding the observers for "dl-start" and other "dl-*" topics, and this is actually all that's needed. The progress listener is added on receiving the "dl-start" in the observer. And the UI of the actual download view is initialized in delayedInit(), which is called when the panel is being opened, AFAIU.

It looks to me that we could just call DownloadView.init(), but do it in a proper place, probably in BrowserCLH.
Attached patch [WIP] FixSplinter Review
Call DownloadsView.init() from Browser.startup() in case an external commandURL is provided.

Unfortunately this also includes the case when an external URL is set as a home page. Not sure how bad this is.
BrowserCLH could be a better place for this - there we can detect a real command line argument, but DownloadsView is not currently accessible from BrowserCLH.

Mark, do you have suggestions how to implement this better taking the above into account?
Attachment #544939 - Flags: feedback?(mark.finkle)
If after step 5, when I go to Preferences > Sync, there is only Enable Sync option. If I switch it to No and then back to Yes, Connect button is displayed. I've tapped on Connect button and I've typed the jpack code on Firefox (Desktop), but even if it's displayed the message that the app is Synced, actually the Fennec it's not connected. If I try to Sync Fennec again, there is the same actual result. If I quit Fennec, after it reopens, it is connected to Sync. Is this related to this bug or should I file another bug for this issue? 

It occurs on:
Build id : Mozilla/5.0 (Android;Linux armv7l;rv:7.0a2)Gecko/20110717
Firefox/7.0a2 Fennec/7.0a2
Device: Motorola Droid 2
OS: Android 2.2
(In reply to comment #7)
> If after step 5, when I go to Preferences > Sync, there is only Enable Sync
> option. If I switch it to No and then back to Yes, Connect button is
> displayed. I've tapped on Connect button and I've typed the jpack code on
> Firefox (Desktop), but even if it's displayed the message that the app is
> Synced, actually the Fennec it's not connected. If I try to Sync Fennec
> again, there is the same actual result. If I quit Fennec, after it reopens,
> it is connected to Sync. Is this related to this bug or should I file
> another bug for this issue? 

Bug 669666
finkle, feedback ping?
Assignee: alexp → nobody
Comment on attachment 544939 [details] [diff] [review]
[WIP] Fix

Native fennec always inits the DM code now
Attachment #544939 - Flags: feedback?(mark.finkle)
No assignee, updating the status.
Status: ASSIGNED → NEW
No assignee, updating the status.
No assignee, updating the status.
No assignee, updating the status.
Closing all opened bug in a graveyard component
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: