Input Devices & Peripherals Subsystem
Input device diagnostics identifies all connected physical and virtual controllers: capacitive touchscreens, active digitizer pens (styluses), hardware volume/power keys, external Bluetooth/USB keyboards, mice, and gaming gamepads.
Physical Hardware vs. System-Generated Virtual Inputs
When inspecting input devices, Android enumerates both true physical silicon peripherals and synthetic software-generated drivers. For example, modern devices register virtual input devices like uinput-goodix or gpio-keys for hardware power/volume buttons. Introduced in Android 4.1 (API 16), InputDevice.isVirtual() allows Voodoo to distinguish physical peripherals from virtual software drivers.
On Android 4.4+ (API 19+), getVendorId() and getProductId() reveal exact USB/HID hex identifiers, allowing precise hardware identification for game controllers (e.g. Sony DualSense vs Xbox Wireless Controller).
For active pens and touchscreens, Voodoo queries supported motion ranges: X/Y axis bounds, physical pressure sensitivity levels, contact size, and tool major/minor orientation ellipse axes.
How Voodoo Inspects Input Devices
1. Primary Call & API-Level Fallback Chain
Extracted from InputCollector.kt. Uses InputDevice.getDeviceIds() (API 9+), falling back to parsing Linux /proc/bus/input/devices on Android 2.0–2.2:
// Excerpt from com.tool3.hardwareinfo.categories.input.InputCollector.kt
val deviceIds = if (Build.VERSION.SDK_INT >= 9) {
Api9InputHelper.getDeviceIds()
} else {
IntArray(0)
}
for (id in deviceIds) {
val dev = InputDevice.getDevice(id) ?: continue
val name = dev.name
val sources = dev.sources
// API 16+ Virtual check and API 19+ VID/PID
val isVirtual = if (Build.VERSION.SDK_INT >= 16) ModernInputHelper.isVirtual(dev) else false
val vid = if (Build.VERSION.SDK_INT >= 19) ModernInputHelper.getVendorId(dev) else 0
val pid = if (Build.VERSION.SDK_INT >= 19) ModernInputHelper.getProductId(dev) else 0
}
2. Permission & Privilege Gate
Querying connected input devices requires zero runtime permissions. The Android windowing and input subsystem exposes device descriptors to all applications.
3. Interpretation & Normalization Logic
- Source Bitmask Decomposition (
InputSourceHelper.kt): Breaks down the integer bitmask into active flags:SOURCE_TOUCHSCREEN,SOURCE_KEYBOARD,SOURCE_GAMEPAD,SOURCE_STYLUS,SOURCE_MOUSE. - Hexadecimal VID/PID Formatting: Raw integer IDs are converted to standard 4-digit hexadecimal strings (e.g.
0x045E:0x02EAfor Microsoft Xbox controller).
4. Availability-State Triggers
- VID and PID queries on Android < 4.4 trigger
AvailabilityState.UNSUPPORTED. isVirtualcheck on Android < 4.1 triggersAvailabilityState.UNSUPPORTED.
Subsystem Field Inventory
| Field ID | Display Name | Type | Primary Source / API | Min API |
|---|---|---|---|---|
| input.device_count | Total Input Devices | INTEGER | InputDevice.getDeviceIds().size | API 9 |
| input.touchscreen_name | Touchscreen Hardware Model | STRING | InputDevice matching SOURCE_TOUCHSCREEN | API 9 |
| input.has_stylus | Active Stylus Digitizer | BOOLEAN | InputDevice matching SOURCE_STYLUS | API 14 |
| input.has_gamepad | Gamepad Controller Connected | BOOLEAN | InputDevice matching SOURCE_GAMEPAD | API 12 |