I want to make my headphone buttons work through an USB-C adapter because my phone is so hip and modern that it doesn't have a 3.5mm jack.
The buttons work: using the app "KeyEvent Display", I figured out that
Vol+
triggers "linux key code number" 114Vol-
triggers "linux key code number" 259Play/Pause
triggers "linux key code number" 226
By changing /system/usr/keylayout/Generic.kl
to
key 114 VOLUME_UP
key 226 HEADSETHOOK
key 259 VOLUME_DOWN
I got the expected behaviour of the headset buttons, but it interfered with the regular buttons on the phone. That's why I want to create a device-specific config file. For this, I need either the device name or the vendor and product IDs. (As explained in the android documentation.)
How can I do this?
PS: The app "USB Device Info" didn't show any connected devices. Here you can find the output of cat /proc/bus/input/devices
. Relevant output of the app "Under the Hood": pastebin.com/kDeBNS0H
PPS: Solving this problem will give you extra karma, because the solution will be fed into LineageOS, solving the problem for many people!