Last Comment Bug 717231 - Downloads are not added to the Download Manager (stock ICS 4.0.3)
: Downloads are not added to the Download Manager (stock ICS 4.0.3)
Status: VERIFIED FIXED
: reproducible
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: Trunk
: ARM Android
: -- normal (vote)
: Firefox 12
Assigned To: Mark Finkle (:mfinkle) (use needinfo?)
:
Mentors:
: 717257 (view as bug list)
Depends on:
Blocks: download-manager
  Show dependency treegraph
 
Reported: 2012-01-11 06:49 PST by Aaron Train [:aaronmt]
Modified: 2012-01-16 22:30 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
verified


Attachments
patch (4.26 KB, patch)
2012-01-11 11:59 PST, Mark Finkle (:mfinkle) (use needinfo?)
mbrubeck: review+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Review

Description Aaron Train [:aaronmt] 2012-01-11 06:49:45 PST
I/GeckoAppShell( 1200): GeckoAppShell.alertsProgressListener_OnCancel('download:///mnt/sdcard/Download/Firefox%209.0b6.dmg')
I/GeckoApp( 1200): Got message: Downloads:Done
D/dalvikvm(  220): GC_FOR_ALLOC freed 423K, 11% free 10677K/11975K, paused 34ms
E/DatabaseUtils(  312): Writing exception to parcel
E/DatabaseUtils(  312): java.lang.SecurityException: Invalid value for visibility: 2
E/DatabaseUtils(  312): 	at com.android.providers.downloads.DownloadProvider.enforceAllowedValues(DownloadProvider.java:795)
E/DatabaseUtils(  312): 	at com.android.providers.downloads.DownloadProvider.checkInsertPermissions(DownloadProvider.java:740)
E/DatabaseUtils(  312): 	at com.android.providers.downloads.DownloadProvider.insert(DownloadProvider.java:472)
E/DatabaseUtils(  312): 	at android.content.ContentProvider$Transport.insert(ContentProvider.java:189)
E/DatabaseUtils(  312): 	at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:152)
E/DatabaseUtils(  312): 	at android.os.Binder.execTransact(Binder.java:338)
E/DatabaseUtils(  312): 	at dalvik.system.NativeStart.run(Native Method)
E/GeckoApp( 1200): Exception handling message "Downloads:Done":
E/GeckoApp( 1200): java.lang.SecurityException: Invalid value for visibility: 2
E/GeckoApp( 1200): 	at android.os.Parcel.readException(Parcel.java:1327)
E/GeckoApp( 1200): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:181)
E/GeckoApp( 1200): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
E/GeckoApp( 1200): 	at android.content.ContentProviderProxy.insert(ContentProviderNative.java:415)
E/GeckoApp( 1200): 	at android.content.ContentResolver.insert(ContentResolver.java:730)
E/GeckoApp( 1200): 	at android.app.DownloadManager.addCompletedDownload(DownloadManager.java:1150)
E/GeckoApp( 1200): 	at org.mozilla.gecko.GeckoApp.handleDownloadDone(GeckoApp.java:1314)
E/GeckoApp( 1200): 	at org.mozilla.gecko.GeckoApp.handleMessage(GeckoApp.java:982)
E/GeckoApp( 1200): 	at org.mozilla.gecko.GeckoAppShell.handleGeckoMessage(GeckoAppShell.java:1586)
E/GeckoApp( 1200): 	at org.mozilla.gecko.GeckoAppShell.nativeRun(Native Method)
E/GeckoApp( 1200): 	at org.mozilla.gecko.GeckoAppShell.nativeRun(Native Method)
E/GeckoApp( 1200): 	at org.mozilla.gecko.GeckoAppShell.runGecko(GeckoAppShell.java:453)
E/GeckoApp( 1200): 	at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:107)

STR:

1. Download something
2. Settings -> Downloads 

ER: Seeing the download 
AR: "No Downloads..."

--
Samsung Nexus S (Android 4.0.3)
20120111031049
http://hg.mozilla.org/mozilla-central/rev/e79ef0ffcb09
Comment 1 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-11 11:56:03 PST
*** Bug 717257 has been marked as a duplicate of this bug. ***
Comment 2 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-11 11:59:18 PST
Created attachment 587774 [details] [diff] [review]
patch

Works fin with this patch:
* Adds a permission to allow downloads without system notifications.Needed to avoid the SecurityException since we do not want addCompletedDownload to use an Android notification. We already use our own system notification.
* Uses a setTimeout(..., 0) to allow the local file to settle and we can get a real filesize.
* Adds a real mimeinfo when downloading the PDF

The new permission does not seem to appear in the list of user facing perms, but I think we'd want this even if it did.
Comment 3 Marco Bonardo [::mak] 2012-01-13 02:50:47 PST
https://hg.mozilla.org/mozilla-central/rev/67fe34d2c8af
Comment 4 Aaron Train [:aaronmt] 2012-01-13 07:43:59 PST
Verified on Nightly (12.0a1)
Samsung Nexus S (Android 4.0.3)
20120113052739
http://hg.mozilla.org/mozilla-central/rev/790cd9bba7f5
Comment 5 Aaron Train [:aaronmt] 2012-01-13 07:45:09 PST
Aurora nom?
Comment 6 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-13 07:47:58 PST
Comment on attachment 587774 [details] [diff] [review]
patch

[Approval Request Comment]
Needed to support adding downloads (and save to pdf) to the android download manager. Low risk.
Comment 7 Alex Keybl [:akeybl] 2012-01-16 13:14:25 PST
Comment on attachment 587774 [details] [diff] [review]
patch

[Triage Comment]
Mobile only - approved for Aurora.
Comment 8 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-16 22:30:36 PST
https://hg.mozilla.org/releases/mozilla-aurora/rev/bf7dad68779e

Note You need to log in before you can comment on or make changes to this bug.