[camera] activities must be initiated from an event handler

VERIFIED FIXED

Status

Firefox OS
Gaia
VERIFIED FIXED
6 years ago
5 years ago

People

(Reporter: djf, Assigned: daleharvey)

Tracking

unspecified
x86
Mac OS X

Firefox Tracking Flags

(blocking-basecamp:+)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
A recent change to the security model for activities only allows them to be launched in response to user input. (See https://mxr.mozilla.org/mozilla-central/source/dom/activities/src/Activity.cpp#59)

This seems to mean that you have to call MozActivity() from a click handler or similar. But Camera (and other media apps) use device storage and often the event handler makes a device storage request and then launches the activity from the device storage event hander.  But that isn't user input and the the activity's onerror handler is called with a NotUserInput error.

For camera, the filmstrip is short and I think it could just keep track of the 4 or 5 blobs so it can launch the activity directly without the device storage (or mediadb) call.

It appears to me that the completely breaks the camera filmstrip and will have to be blocking, since I doubt we can get the security people to revert their change.
(Reporter)

Updated

6 years ago
blocking-basecamp: --- → ?
(Assignee)

Comment 1

6 years ago
Cheers, good catch, will fix this asap
Assignee: nobody → dale
(Assignee)

Updated

6 years ago
Duplicate of this bug: 798156
(Assignee)

Comment 3

6 years ago
Created attachment 683184 [details]
Remove async getFile call before launching activity
Attachment #683184 - Flags: review?(dflanagan)
(Reporter)

Comment 4

6 years ago
Comment on attachment 683184 [details]
Remove async getFile call before launching activity

I've noted some nits on github but once you fix those, I think it is good to go.
Attachment #683184 - Flags: review?(dflanagan) → review+
(Assignee)

Comment 5

6 years ago
fixed in https://github.com/mozilla-b2g/gaia/commit/4a9938435c22aa18dd13082f5642bc09f2bf5895
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Comment 6

5 years ago
Verified as fixed in build 20130104070203 on Unagi.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.