After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759042 - Distinguish smartphones and tablets from media players
Distinguish smartphones and tablets from media players
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: mtp backend
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Philip Langdale
gvfs-maint
Depends on: 759335
Blocks:
 
 
Reported: 2015-12-04 19:10 UTC by Damon Lynch
Modified: 2018-09-21 17:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot with icons (28.71 KB, image/png)
2015-12-10 16:44 UTC, Ondrej Holy
  Details
mtp: Use phone icon for MTP devices (1.51 KB, patch)
2015-12-11 09:42 UTC, Ondrej Holy
committed Details | Review

Description Damon Lynch 2015-12-04 19:10:08 UTC
Problem: all MTP devices are identified as media players. That formerly made sense, but these days almost all MTP devices are smart phones or tablets, so it make increasingly less sense. 

When I plug in a smart phone or tablet in Nautilus, I'd prefer to see an icon for it than for a media player, even though the smartphone/tablet is almost certainly also a media player and a camera.

Solution: somewhere in the Linux stack (perhaps starting with libmtp?), tag a device as being a smartphone or tablet, if applicable. Nautilus can then query for that tag in udev/GIO and display the correct icon in the sidebar.

As at the time of filing this bug, I've yet to file a bug against libmtp, as I'm still determining if that bug report makes sense for that project.
Comment 1 Cosimo Cecchi 2015-12-05 09:52:39 UTC
-> gvfs

That would need to happen in gvfs.
Comment 2 Ondrej Holy 2015-12-08 14:07:51 UTC
The icon for MTP devices is set based on the following code:
https://git.gnome.org/browse/gvfs/tree/common/gvfsgphoto2utils.c#n123

ID_MEDIA_PLAYER_ICON_NAME udev property is used to set the icon if the property exists, otherwise "multimedia-player", or "camera-photo" is used depending on ID_MEDIA_PLAYER property. 

We might use "phone" icon instead of "multimedia-player", however I think it is still better to show "multimedia-player" for mobile phones, than "phone" for multimedia players...

Solution would be to provide some udev rules to set 
ID_MEDIA_PLAYER_ICON_NAME properly, or set something useful to determine what type of device it is...
Comment 3 Philip Langdale 2015-12-09 00:20:27 UTC
And ultimately, udev sets this flag based on whether libmtp recognises the device or libgphoto2 - roughly speaking.

There's no way for libmtp to distinguish a media player from a phone except through hard-coding based on device identity - the spec doesn't offer any way and even things like looking at the software stack id (android vs microsoft, etc) is insufficient. I think this is probably futile and not worth the (on going) effort required. I think it might well be reasonable to default to a phone icon though, given that it what the majority of devices will be.
Comment 4 Damon Lynch 2015-12-09 13:25:30 UTC
Since devices are already hard coded into libmtp's music-players.h, if I classified all its devices into one of [phone, tablet, music player, unknown], would the ongoing maintenance burden in future seem less of a problem? Please note I'm not offering to patch the actual source code. I am merely proposing to use python, Google and some common sense to extract into a text file the hard-coded model names, and append a classification to each. If it seems like a worthwhile plan I'd like a commitment from the libmtp maintainer(s) that they'd actually incorporate the classifications into code so that it can be picked up by udev ;-)
Comment 5 Philip Langdale 2015-12-10 03:51:15 UTC
If you're serious about such a proposal, you'd need to bring it up on the libmtp mailing list and see what the response is.
Comment 6 Ondrej Holy 2015-12-10 16:43:47 UTC
I am ok to use "phone" icon instead of "multimedia-player", however the "phone" icon looks pretty weird in the nautilus to me. Maybe we might use "phone-apple-iphone" which looks a bit better, however it seems there isn't color version for it and it isn't fallbacked to "phone". It is probably bug, because we are already using the icon for afc devices...  Maybe Jakub may do something with it, mayn't he?
Comment 7 Ondrej Holy 2015-12-10 16:44:30 UTC
Created attachment 317159 [details]
screenshot with icons
Comment 8 Lapo Calamandrei 2015-12-10 16:47:01 UTC
We should probably update the phone icon, that symbolic was made after the gnome-icon-theme phone icon which was made when cell-phones looked like that :-)
Comment 9 Philip Langdale 2015-12-11 07:09:17 UTC
I think a modern phone icon - a large screen with a small frame around it would also be a fair representation of a modern tablet or media player - so that's another reason why we don't need to distinguish them visually - there is no difference at this size :-)
Comment 10 Ondrej Holy 2015-12-11 09:42:04 UTC
Created attachment 317190 [details] [review]
mtp: Use phone icon for MTP devices

So I changed the icon to "phone" in master (commit 9843229) and file two bugs against adwaita-icon-theme (Bug 759335, Bug 759336).
Comment 11 Ondrej Holy 2015-12-11 09:43:40 UTC
I let the bug open to track Damon's work on libmtp...
Comment 12 Martin Pitt 2017-09-15 12:28:35 UTC
See https://bugs.freedesktop.org/show_bug.cgi?id=102731 for the corresponding media-player-info change to avoid regressing the icon for "classic" (non-phone) media players.
Comment 13 GNOME Infrastructure Team 2018-09-21 17:55:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/268.