Closed Bug 1072997 Opened 5 years ago Closed 5 years ago

crash in java.lang.IllegalArgumentException: Unknown URL content://downloads/my_downloads at android.content.ContentResolver.insert(ContentResolver.java)

Categories

(Firefox for Android :: General, defect, critical)

35 Branch
All
Android
defect
Not set
critical

Tracking

()

VERIFIED FIXED
Firefox 37
Tracking Status
firefox34 --- unaffected
firefox35 + verified
firefox36 --- verified
firefox37 --- verified
fennec 35+ ---

People

(Reporter: aaronmt, Assigned: mfinkle)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-6ea6a1bf-f296-40d5-ad73-485ca2140924.
=============================================================

java.lang.IllegalArgumentException: Unknown URL content://downloads/my_downloads
	at android.content.ContentResolver.insert(ContentResolver.java:862)
	at android.app.DownloadManager.addCompletedDownload(DownloadManager.java:1646)
	at org.mozilla.gecko.GeckoAppShell.scanMedia(GeckoAppShell.java:1812)
	at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
	at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
	at org.mozilla.gecko.GeckoAppShell.runGecko(GeckoAppShell.java:365)
	at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:186)
This is happening on devices where people have "disabled" the Download Manager [1][2]. You can do this by going into Settings > Apps > All Apps, and picking "Download Manager" then tapping "Disable". Android gives you a warning about doing this to a built-in app.

I can reproduce the crash when disabling the Download Manager, which is the backend provider, not the UI, which can be called Downloads in the Settings.

[1] http://stackoverflow.com/questions/10852821/downloadmanager-sends-status-successful-for-failed-download
[2] http://stackoverflow.com/questions/18979160/android-download-manager-issue-in-samsung-tab-gt-p3100
tracking-fennec: --- → 35+
This patch pulls the System DM checks into a helper function. The function also tests for a disabled DM. I am checking the backend provider, not the Downloads UI. I am also testing for IllegalArgumentException in case the applet is not even installed.

There are several COMPONENT_ENABLED_STATE_DISABLED* flags, so I test for ENABLED and DEFAULT.

Testing shows the patch works for adding and removing downloads without crashing.

For more info: http://developer.android.com/reference/android/content/pm/PackageManager.html#getApplicationEnabledSetting%28java.lang.String%29
Assignee: nobody → mark.finkle
Attachment #8542274 - Flags: review?(margaret.leibovic)
Comment on attachment 8542274 [details] [diff] [review]
sysdm-disabled v0.1

Review of attachment 8542274 [details] [diff] [review]:
-----------------------------------------------------------------

Looks reasonable.

::: mobile/android/base/DownloadsIntegration.java
@@ +90,5 @@
>              removeDownload(d);
>          }
>      }
>  
> +    public static boolean useSystemDownloadManager() {

This can be private.
Attachment #8542274 - Flags: review?(margaret.leibovic) → review+
Comment on attachment 8542274 [details] [diff] [review]
sysdm-disabled v0.1

Approval Request Comment
[Feature/regressing bug #]:
[User impact if declined]: #2 crash on Fx35 beta
[Describe test coverage new/current, TBPL]: Just landed, but we need to get this on Fx35 ASAP after a short bake time. 
[Risks and why]: Low risk. Minor code changes supported by all Android API levels.
[String/UUID change made/needed]: None
Attachment #8542274 - Flags: approval-mozilla-beta?
Attachment #8542274 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/09c3bfc70592
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
Attachment #8542274 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment on attachment 8542274 [details] [diff] [review]
sysdm-disabled v0.1

Alright - let's get this into the final mobile beta asap.
Attachment #8542274 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
The crash is no longer reproducible, but after re-enabling the download manager Firefox becomes unresponsive.
Flags: needinfo?(mark.finkle)
Verified as fixed in builds:
- 35 beta 10;
- 36.0a2 (2015-01-06);
- 37.0a1 (2015-01-06).
Device: Asus Transformer Tab (Android 4.2.1).
(In reply to Flaviu Cos, QA [:flaviu] from comment #11)
> The crash is no longer reproducible, but after re-enabling the download
> manager Firefox becomes unresponsive.

We found that clearing data or rebooting the phone fixed the responsiveness. Given the unsupported nature of disabling system services, rebooting the device is a fine workaround.
Flags: needinfo?(mark.finkle)
Could you just catch and kgnore this exception?
You need to log in before you can comment on or make changes to this bug.