Closed Bug 816429 Opened 12 years ago Closed 12 years ago

Can't access DeviceStorage in Bluetooth app

Categories

(Firefox OS Graveyard :: Gaia::Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 814323

People

(Reporter: echou, Assigned: iliu)

References

Details

Originally, when users try to send a file, a prompt would be shown to ask for user's approval to access device storage. After Bug 814294 landed, no prompt appears even if we share a file via Bluetooth, and we will get a "Bluetooth.getFile: SecurityError" error message from logcat.
cc Gregor, assignee of bug 814294

Hi Gregor,

  I'm not sure how to make permission prompt to be shown while Bluetooth app trying to access DeviceStorage for Bluetooth file-sharing. Could you help us?

  Thanks in advance.

Eric
Summary: Can't access evice storage in Bluetooth app → Can't access DeviceStorage in Bluetooth app
Blocks: 812715
You need the right permission for it. Currently I see for the bluetooth app:
    "device-storage:pictures":{ "access": "readwrite" },
    "device-storage:music":{ "access": "readwrite" }
What media type do you want to access?
Also try a make reset-gaia to make sure you have the current version of the permission DB.
If the right permission is in the manifest, please look at b2g/components/ContentPermissionPrompt.js and let me know what variables (request.type and request.access) you see in the handleExistingPermission function for the failing prompt.
Gregor, we are using navigator.getDeviceStorage('sdcard') in bluetooth app, so what's the current permission we should write?
(In reply to Dominic Kuo [:dkuo] from comment #4)
> Gregor, we are using navigator.getDeviceStorage('sdcard') in bluetooth app,
> so what's the current permission we should write?

Then you have to add the sdcard permission to the manifest:
"device-storage:sdcard":{ "access": "readwrite" }
Does this work now?
(In reply to Gregor Wagner [:gwagner] from comment #6)
> Does this work now?

Yes, it works. I think Ian or Dominic will send a patch tomorrow.

Thank you, Gregor.
Component: DOM: Device Interfaces → Gaia::Bluetooth File Transfer
Product: Core → Boot2Gecko
QA Contact: wachen
Assignee: nobody → dkuo
blocking-basecamp: --- → ?
Ian has sent a patch includes that change we mention above
https://github.com/mozilla-b2g/gaia/pull/6706

Re-assigning to Ian, thanks.
Assignee: dkuo → iliu
What's the reason we need to ask the user for permission here?  Please help clarify, thanks.
(In reply to Chris Lee [:clee] from comment #9)
> What's the reason we need to ask the user for permission here?  Please help
> clarify, thanks.

We won't ask the user for permission in this scenario.
We had a bug in our permission implementation so that missing permissions in the manifest file resulted in prompting and not in an automatic deny. So the prompt was wrong in the first place.
This has been resolved in Bug 814323 by Ian.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
blocking-basecamp: ? → ---
You need to log in before you can comment on or make changes to this bug.