Bugzilla – Bug 1123898
new rule for libmtp-udev
Last modified: 2019-02-09 17:25:53 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"
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?
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.
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.
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
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
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
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.