Closed Bug 948362 Opened 7 years ago Closed 7 years ago

[Gaia][Gallery] gallery application: handle data transfer


(Firefox OS Graveyard :: Gaia::Gallery, defect, P1)

Gonk (Firefox OS)


(Not tracked)

1.4 S1 (14feb)


(Reporter: johnhu, Assigned: johnhu)



(Whiteboard: [FT:RIL] sharing video/audio/image [fxos:media])


(4 files)

+++ This bug was initially created as a clone of Bug #903253 +++

During the image sharing via NFC, data transfer needs to be handle.
This is a cloned bug for gallery app. We don't need to depend on bug 903253
No longer depends on: 903253
Summary: [Gaia] Video/image application: handle data transfer → [Gaia][Gallery] image application: handle data transfer
blocking-b2g: --- → 1.4?
Summary: [Gaia][Gallery] image application: handle data transfer → [Gaia][Gallery] gallery application: handle data transfer
According to bug 933093, what we need to do is to put the following code at the correct place:
window.navigator.mozNfc.onpeerfound = function(nfcPeer) {
  // Negotiates WiFi or BT connection, presenting UI 

The correct place means where the app is under single file sharable context.
Depends on: 952217
Bug 952217 is a blocker for this bug.
Does gallery have nfc-manager permissions? If so, why does it need it?

952217 only hides a manager interface from the app, but the app level usage should not be changing, and should not block. The interface in question is:

    * Users of this API should have valid permissions 'nfc-manager'
    * and 'nfc-write'
   DOMRequest checkP2PRegistration(DOMString manifestUrl);
Whiteboard: [FT:RIL] sharing video/audio/image
are you on top of this?
Flags: needinfo?(dmarcos)
No. I'm not working on this at the moment. Do you want to take it?
Actually I'm not a developer. Just trying to see if we can have a estimated time of landing. Let me initiate the schedule discussion offline.
Depends on: 961913
Depends on: 960790
No longer depends on: 961913
Priority: -- → P1
Target Milestone: --- → 1.3 C3/1.4 S3(31jan)
As offline discussion with Hema, I am taking over this bug.
Assignee: nobody → johu
Flags: needinfo?(dmarcos)
No longer depends on: 962390
only upload this patch but not set review because this patch is tested in real workable device.
Depends on: 963471
Attached file 15682[1]
Hi John,

Find the patch for sharing Gallery Image/Video files. Necessary functions and handlers added.
Implementation Details:

1. Add/Remove the nfcpeerready_handler
2. Get the Current file from the opened Index
3. Check the file info either Video or Image
4. Get the Blob image of the File
5. Get the NFC peer connectivity
6. Send the File content
7. Handle the response of the transmission.
Depends on: 964672
Depends on: 964693
Comment on attachment 8364154 [details] [review]
patch to share file through nfc

1. add "onpeerready" callback when the video is in player view
2. remove "onpeerready" callback when the video is not in player view

To test this patch, we need to have the patch of the following bugs: bug 963471 (add this.doFileTransfer.bind(this) to nfc_handover_manager.js), bug 964672 (remove the doPair call in doFileTransfer), and bug 962310 (gecko).
Attachment #8364154 - Flags: review?(dmarcos)
Depends on: 962310
Attachment #8364154 - Flags: review?(dmarcos) → review+
Whiteboard: [FT:RIL] sharing video/audio/image → [FT:RIL] sharing video/audio/image [fxos:media]
Target Milestone: 1.3 C3/1.4 S3(31jan) → 1.4 S1 (14feb)
merged to master:
Closed: 7 years ago
Resolution: --- → FIXED
blocking-b2g: 1.4? → ---
You need to log in before you can comment on or make changes to this bug.