Closed Bug 1043136 Opened 11 years ago Closed 11 years ago

Add device storage API support to permissions prompt

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 34

People

(Reporter: jchen, Assigned: jchen)

Details

Attachments

(4 files)

Right now the permissions prompt fails when using device storage API
Requests with access property use a permission that's a combination of the type and the access.
Attachment #8464015 - Flags: review?(mark.finkle)
Comment on attachment 8464015 [details] [diff] [review] Handle access in permission prompt (v1) I assume this won't break other permission prompts coming into this code path?
Attachment #8464015 - Flags: review?(mark.finkle) → review+
Similar to b2g [1], when a permission has unknown action, we should only prompt the user for certain permissions. For permissions like contacts and device-storage, we should default to deny and not prompt. This only applies to web content. For web apps, all unknown permissions are denied by default. [1] http://mxr.mozilla.org/mozilla-central/source/b2g/components/ContentPermissionPrompt.js#16
Attachment #8464016 - Flags: review?(mark.finkle)
Add permission strings for device storage. Asking Ian to review the string wording.
Attachment #8464017 - Flags: review?(mark.finkle)
Attachment #8464017 - Flags: review?(ibarlow)
(In reply to Mark Finkle (:mfinkle) from comment #2) > Comment on attachment 8464015 [details] [diff] [review] > Handle access in permission prompt (v1) > > I assume this won't break other permission prompts coming into this code > path? Right. Existing permissions like geolocation don't have the access property and are not affected.
Jim, can you please provide a little more context about what this is, why we're doing it, and when/how a user might see such a prompt?
Comment on attachment 8464016 [details] [diff] [review] Only prompt for certain permissions when action is unknown (v1) ># HG changeset patch ># User Jim Chen <nchen@mozilla.com> > >Bug 1043136 - Only prompt for certain permissions when action is unknown; > >diff --git a/mobile/android/components/ContentPermissionPrompt.js b/mobile/android/components/ContentPermissionPrompt.js >- if (isApp && (result == Ci.nsIPermissionManager.UNKNOWN_ACTION && !!kEntities[type])) { >+ if (denyUnknown && result == Ci.nsIPermissionManager.UNKNOWN_ACTION) { I was worried about this change, but as you say, "contacts" is already defaulting to DENY and I assume somewhere "device-storage" is as well. That leaves "desktop-notification" and "geolocation", which you handle with the PROMPT_FOR_UNKNOWN check.
Attachment #8464016 - Flags: review?(mark.finkle) → review+
Attachment #8464017 - Flags: review?(mark.finkle) → review+
(In reply to Ian Barlow (:ibarlow) from comment #6) > Jim, can you please provide a little more context about what this is, why > we're doing it, and when/how a user might see such a prompt? This is for the Device Storage API, which is a web API we're enabling to have parity with B2G. The purpose of this API is to let web apps access the user's pictures, music, videos, etc. For example, a web app can display the user's existing pictures, or it can save pictures to the user's pictures directory. When a web app uses this API, the user will be prompted for permission, similar to geolocation, etc. The strings added here will be what's shown to the user.
Here is a screenshot of a web app requesting access to device storage.
Ian, see comment 8 and comment 9. Just wanted to make sure the wording of the prompts in attachment 8464017 [details] [diff] [review] looks okay.
Flags: needinfo?(ibarlow)
Oh hey Jim, thanks for the nudge. Lost this bug in my inbox :P This looks good overall. One question / comment: What do you think about saying "SD card" instead of "external storage"? Currently it seems a bit unspecific to me, I'm curious if we can be clearer about what the website is asking for?
Flags: needinfo?(ibarlow)
(In reply to Ian Barlow (:ibarlow) from comment #11) > Oh hey Jim, thanks for the nudge. Lost this bug in my inbox :P > > This looks good overall. One question / comment: > > What do you think about saying "SD card" instead of "external storage"? > Currently it seems a bit unspecific to me, I'm curious if we can be clearer > about what the website is asking for? Thanks! My only concern is many devices don't use SD cards and use non-removable storage instead. "External storage" seems to be the Android lingo for "either the SD card or the non-removable storage".
Oh, ok. If that's pretty standard terminology then i would be cool to just go with that then. Especially if "SD card" wouldn't be a universally accurate phrase.
Comment on attachment 8464017 [details] [diff] [review] Add permission prompt for device storage API (v1) Thanks Ian!
Attachment #8464017 - Flags: review?(ibarlow)
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 34
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: