@@ -77,6 +77,20 @@ ENV{DDC_DEVICE}=="?*", TAG+="uaccess"
7777# media player raw devices (for user-mode drivers, Android SDK, etc.)
7878SUBSYSTEM=="usb", ENV{ID_MEDIA_PLAYER}=="?*", TAG+="uaccess"
7979
80+ # Android devices (ADB DbC, ADB, Fastboot)
81+ # Used to interact with devices over Android Debug Bridge and Fastboot protocols, see:
82+ # * https://developer.android.com/tools/adb
83+ # * https://source.android.com/docs/setup/test/running
84+ # * https://source.android.com/docs/setup/test/flash
85+ #
86+ # The bInterfaceClass and bInterfaceSubClass used are documented in source code here:
87+ # * https://android.googlesource.com/platform/packages/modules/adb/+/d0db47dcdf941673f405e1095e6ffb5e565902e5/adb.h#199
88+ # * https://android.googlesource.com/platform/system/core/+/7199051aaf0ddfa2849650933119307327d8669c/fastboot/fastboot.cpp#244
89+ #
90+ # Since it's using a generic vendor specific interface class, this can potentially result
91+ # in a rare case where non-ADB/Fastboot device ends up with an ID_DEBUG_APPLIANCE="android".
92+ SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:dc0201:*|*:ff4201:*|*:ff4203:*", ENV{ID_DEBUG_APPLIANCE}="android"
93+
8094# software-defined radio communication devices
8195ENV{ID_SOFTWARE_RADIO}=="?*", TAG+="uaccess"
8296
@@ -111,4 +125,7 @@ SUBSYSTEM=="hidraw", ENV{ID_HARDWARE_WALLET}=="1", TAG+="uaccess"
111125# As defined in https://en.wikipedia.org/wiki/3Dconnexion
112126SUBSYSTEM=="hidraw", ENV{ID_INPUT_3D_MOUSE}=="1", TAG+="uaccess"
113127
128+ # Debug interfaces (e.g. Android Debug Bridge)
129+ ENV{ID_DEBUG_APPLIANCE}=="?*", TAG+="uaccess"
130+
114131LABEL="uaccess_end"
0 commit comments