Closed Bug 1176682 Opened 11 years ago Closed 11 years ago

Capturing photo with camera in <input type="file"> doesn't trigger its "onchange" event nor it fills the files list.

Categories

(Firefox for Android Graveyard :: Audio/Video, defect)

38 Branch
ARM
Android
defect
Not set
normal

Tracking

(firefox38.0.5 wontfix, firefox39 wontfix, firefox40 wontfix, firefox41 wontfix, firefox42 fixed, fennec+)

RESOLVED FIXED
Firefox 42
Tracking Status
firefox38.0.5 --- wontfix
firefox39 --- wontfix
firefox40 --- wontfix
firefox41 --- wontfix
firefox42 --- fixed
fennec + ---

People

(Reporter: derenio+firefox, Assigned: droeh)

References

Details

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Build ID: 20150513174244 Steps to reproduce: I've followed the tutorial from: https://developer.mozilla.org/en-US/docs/Web/Guide/API/Camera that is: <html> <body> <input type="file" id="take-picture" accept="image/*"> <script> var takePicture = document.querySelector("#take-picture"); takePicture.onchange = function (event) { console.log(this.files); console.log(event.target.files); // Get a reference to the taken picture or chosen file var files = event.target.files, file; if (files && files.length > 0) { file = files[0]; } }; takePicture.click = function (event) { console.log('click', event); }; </script> </body> </html> Actual results: If I click the file input and pick an existing photo from e.g. "photos" app it properly fills in the input, but if I choose the camera and take a new photo, it isn't filled in nor is the "onchange" callback called. Also I have the taken photo saved in the "/sdcard/" main directory. Expected results: The "onchange" event should be fired and the file input filled with the take photo.
OS: Unspecified → Android
Hardware: Unspecified → ARM
I should add that it fails on: - 2 different Nexus 4, Android 5.1.1 devices, It works on: - X86 emulator of Android 5.1, - and Moto X 2014 with Android 5.1
I think I can reproduce this on a Nexus 5 running the Android M preview. I cannot reproduce on a Samsung Galaxy S5 running Android 5.x.
Status: UNCONFIRMED → NEW
tracking-fennec: --- → ?
Ever confirmed: true
All current versions are affected.
1. load the testcase from comment 2 2. tap the browse button 3. select the camera app if needed 4. take a photo Expected results: text field updates to the file name, normally a date-time-string.jpg Actual results: text field still shows No file selected.
To debug this, we'd need to break in here: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/FilePickerResultHandler.java#62 and see what results we're getting. We don't support quite the "correct" way of handling this (i.e. pass a content-uri to the page, opening a java inputStream when it was requested by the page), but I'm not sure why our old method would have stopped working.
Assignee: nobody → droeh
tracking-fennec: ? → +
I can't reproduce this; following kbrosnan's steps from comment 5 produces the expected result (text field updates to the filename of the photo taken). This is on a Nexus 6 running 42.0a1 and android 5.1.1
Attached patch Proposed patch (obsolete) — Splinter Review
Android M seems to return an empty Intent rather than a null intent to onActivityResult from camera activity; updated the function to check for an empty Intent if the intent is not null.
Attachment #8630740 - Flags: review?(snorp)
Attachment #8630740 - Flags: review?(snorp) → review+
Comment on attachment 8630740 [details] [diff] [review] Proposed patch Review of attachment 8630740 [details] [diff] [review]: ----------------------------------------------------------------- Oops, I acted too quickly. This needs a better commit message. It should say what the patch does.
Attachment #8630740 - Flags: review+ → review-
Updated commit message.
Attachment #8630740 - Attachment is obsolete: true
Attachment #8630748 - Flags: review?(snorp)
Attachment #8630748 - Flags: review?(snorp) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
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: