Bug 1123898 - new rule for libmtp-udev
Summary: new rule for libmtp-udev
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Marcus Meissner
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-31 16:18 UTC by Kieran Ramos
Modified: 2019-02-09 17:25 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
lsusb -d 2a70:4ee7 -v (2.14 KB, text/plain)
2019-02-01 16:02 UTC, Kieran Ramos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kieran Ramos 2019-01-31 16:18:21 UTC
Could you please add the following rule for the OnePlus 3T to libmtp-udev?

# OnePlus 3T
ATTR{idVendor}=="2a70", ATTR{idProduct}=="4ee7", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
Comment 1 Kieran Ramos 2019-01-31 18:09:11 UTC
I have actually realized that this product id is used when the phone is in 'charge only mode' with android debugging enabled. Without the rule I listed its impossible to access the device with `adb` due to a permissions error when in 'charge only mode'. Although the rule fixes that it shows the device as an MTP device, but no media can be accessed unless the phone is put into its MTP mode. While in the MTP mode the phone shows up as a media player correctly without the new rule and can be accessed using `adb`.

Is it possible to have a rule that gives access to the phone through `adb` when in 'charge only mode' yet does not show the phone as a media player?
Comment 2 Marcus Meissner 2019-02-01 06:36:39 UTC
can you run lsusb -v  and paste the part from charger mode?

I think it will likely just seem to be a "HID" device there, and we would need to know what HID control to send to turn it back on.
Comment 3 Kieran Ramos 2019-02-01 16:02:50 UTC
Created attachment 795826 [details]
lsusb -d 2a70:4ee7 -v

So it doesn't show up as HID, but "Vendor Specific Class", though the interface shows up as "ADB Interface". Please refer to the attachment.
Comment 4 Marcus Meissner 2019-02-04 09:31:27 UTC
but this is probably just the ADP bridge, not MTP.

android-tools adb rules should probably learn about 2a70 vendor:

/usr/lib/udev/rules.d/51-android.rules
Comment 5 Marcus Meissner 2019-02-04 09:38:54 UTC
hmpf, i see android-tools ios gone... not sure if it wasw repalced by anything.

you can add least add the rule to libmtp rules even if its not a libmtp device
Comment 6 Kieran Ramos 2019-02-04 19:57:47 UTC
Yes I also noticed there are no android rules, I searched and didn't find any android or adb related packages.

I have added the rule for libmtp and its fine for me, but I thought it'd be useful for others to get it incorporated in the right way and right package. I only realized that libmtp is not quite the right designation until after my bug report.

I'm not sure why there is no 51-android.rules file in Tumbleweed, but this version already has the correct rule for 2a70:

https://github.com/M0Rf30/android-udev-rules/blob/master/51-android.rules
Comment 7 Kieran Ramos 2019-02-09 17:25:53 UTC
It looks as though 51-android.rules was deemed unnecessary and dropped at the end of 2015 with the assumption that the udev rules in libmtp enable adb to work.

https://bugzilla.opensuse.org/show_bug.cgi?id=938659#c65

That is generally true, but for this phone it fails. Perhaps then its necessary to add the rule I provided to libmtp-udev or some modified form of it that doesn't show the device as a media player but still allows access to the adb interface. I image there are other cases as well that are not covered by libmtp-udev that could be discovered from the previously linked 51-android.rules file on github.