New issue
Advanced search Search tips

Issue 803660 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

mediaGalleries: "contents_changed" event doesn't work on devices connected via ptp/mtp

Reported by anyw...@gmail.com, Jan 18 2018

Issue description

UserAgent: Mozilla/5.0 (X11; CrOS x86_64 10032.86.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.140 Safari/537.36
Platform: 10032.86.0 (Official Build) stable-channel link

Steps to reproduce the problem:
1. Connect a phone or a dslr camera to your chromebook
2. Make sure device is connected via ptp or mtp
3. getMediaFileSystems and chrome.mediaGalleries.addGalleryWatch
4. Take a photo or remove a photo from your phone

What is the expected behavior?
chrome.mediaGalleries.onGalleryChanged.addListener callback with event "contents_changed" is fired

What went wrong?
Callback not fired

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 63.0.3239.140  Channel: stable
OS Version: 10032.86.0
Flash Version: 

Callback fires on sdcard from a camera that is directly attached to a chromebook. Interestingly, getMediaFileSystemMetadata on sdcard says that isMediaDevice is true. Is this a bug too?
 

Comment 1 by anyw...@gmail.com, Jan 19 2018

It's really useful feature now when we have the Pixelbook with large storage that fit pretty good for simple tethered shooting. It's when you're shooting with your dslr camera or even phone and see a preview on your chromebook that is connected to the camera. Or even saving photos to your chromebook.

Of course I can workaround this problem by using polling but it would be great if "contents_changed" worked.

Components: Platform>Apps>FileManager Platform>Extensions>API
Labels: CrOS-FilesApp
Status: Untriaged (was: Unconfirmed)
<files-triage>

Comment 4 by sashab@chromium.org, Feb 28 2018

Labels: -CrOS-FilesApp
Owner: tommycli@chromium.org
Status: Assigned (was: Untriaged)
Assigning to tommycli@ for triage.
Cc: tommycli@chromium.org reillyg@chromium.org
Labels: -Pri-2 Pri-3
Owner: thestig@chromium.org
I believe we use file system monitors for addGalleryWatch. I would not be surprised if they do not work for PTP/MTP devices. I also doubt we will add support for watching PTP/MTP galleries.

I'll bounce this to thestig@ who is is the MTPd author if he has any further comment.
Cc: thestig@chromium.org donna...@intel.com
Owner: ----
Status: Available (was: Assigned)
I don't have to work on this, but happy to help review code if someone else wants to take this bug.

Donna, would you be intersted in taking a look after finishing the servification work with the MTP code?

What needs to happen is:

a) mtpd has to listen for LIBMTP_EVENT_OBJECT_ADDED / LIBMTP_EVENT_OBJECT_REMOVED events from the device. It already listens for LIBMTP_EVENT_STORE_ADDED / LIBMTP_EVENT_STORE_REMOVED.
b) Add new DBus signals and fire them. See MtpdServer::StorageAttached() and dbus_bindings/org.chromium.Mtpd.xml.
c) On the Chromium side, the browser has to listen for the new signals and plumb them up to the extensions code. (This one is the most hand-wavy)

Even with all the code written, we still need to see what PTP/MTP devices actually send object added / removed events. If a particular phone or camera doesn't send the first place, all the work here won't help.

Comment 8 by donna...@intel.com, Mar 25 2018

Hi Lei, I'd like to take this issue after MTP servicification and these hints are good points to follow. The only concern is that, I don't have a ChromeBook on hand, it may take some time to find a device for verification. Or, is ChromeBook a hard need to verify the issue?

Comment 9 by donna...@intel.com, Mar 28 2018

Owner: donna...@intel.com
I found a pixelbook, so take this bug.
Status: Assigned (was: Available)
Labels: CrOSFilesFeature-ExternalMedia

Sign in to add a comment