Closed Bug 877061 Opened 12 years ago Closed 12 years ago

PluginProvider can't find "Home" plugins on Android

Categories

(Toolkit :: Add-ons Manager, defect, P1)

ARM
Android
defect

Tracking

()

RESOLVED FIXED
mozilla24
Tracking Status
firefox23 + fixed
firefox24 --- fixed

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

Attachments

(1 file, 1 obsolete file)

AddonManager.getAllAddons(...); => WARN addons.manager: Exception calling callback: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIProperties.get]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://gre/modules/PluginProvider.jsm :: <TOP_LEVEL> :: line 434" data: no]" {file: "resource://gre/modules/PluginProvider.jsm" line: 434}] // Plugins anywhere else in the user's home are in the user scope dir = Services.dirsvc.get("Home", Ci.nsIFile); <<<<<<<<<<<<<<<<< if (path.substring(0, dir.path.length) == dir.path) return AddonManager.SCOPE_USER; Presumably the PluginProvider is overly optimistic in expecting there to be a home directory on Android. This is blocking Bug 875400, and thus FHR on Android. Can I get review (or even a patch!) for a quick fix here, like an obvious try..catch? I'd also be happy with a workaround that can safely grab every installed add-on on Android devices. (Similar to Bug 566787, perhaps?)
File a patch with the obvious try...catch and I'll r+ it
Attached patch Proposed patch. v1 (obsolete) — Splinter Review
Added catch block for the precise error code raised in this case. I also switched all of the substring== checks for startsWith, because new JS features are awesome. Incidentally, this was complaining for /data/data/com.adobe.flashplayer/lib/libflashplayer.so
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Attachment #755426 - Flags: review?(dtownsend+bugmail)
And here's with a qref for the error code safety check I just added. *sigh*
Attachment #755426 - Attachment is obsolete: true
Attachment #755426 - Flags: review?(dtownsend+bugmail)
Attachment #755427 - Flags: review?(dtownsend+bugmail)
Comment on attachment 755427 [details] [diff] [review] Proposed patch. v2 Review of attachment 755427 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/mozapps/extensions/PluginProvider.jsm @@ +426,2 @@ > return AddonManager.SCOPE_APPLICATION; > + } Nit: Single line blocks don't have bracing in this file @@ +432,2 @@ > return AddonManager.SCOPE_PROFILE; > + } Ditto @@ +437,5 @@ > + try { > + dir = Services.dirsvc.get("Home", Ci.nsIFile); > + if (path.startsWith(dir.path)) { > + return AddonManager.SCOPE_USER; > + } Ditto
Attachment #755427 - Flags: review?(dtownsend+bugmail) → review+
Related error during shutdown, btw: 05-29 11:30:22.485 E/GeckoConsole(29398): [JavaScript Error: "ERROR addons.manager: Exception calling provider shutdown: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIProperties.get]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://gre/modules/FileUtils.jsm :: FileUtils_getDir :: line 63" data: no]" {file: "resource://gre/modules/FileUtils.jsm" line: 63}]
Comment on attachment 755427 [details] [diff] [review] Proposed patch. v2 [Approval Request Comment] Bug caused by (feature/regressing bug #): Long-standing issue; apparently nobody has ever called AddonManager.getAllAddons() on an Android device. User impact if declined: Unable to ship FHR on Android. Testing completed (on m-c, etc.): Just landed on m-c. Tested by hand. Risk to taking this patch (and alternatives if risky): Very slim: just a catch block. String or IDL/UUID changes made by this patch: None
Attachment #755427 - Flags: approval-mozilla-aurora?
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Attachment #755427 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: