Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
USB headset: Device specification
Stay organized with collections
Save and categorize content based on your preferences.
For USB headsets to work seamlessly across the Android ecosystem, Android
devices must support them uniformly. This documentation specifies USB
behavior to support USB headsets and adapters across the Android ecosystem.
Software mapping
Compatible USB headsets are required to support compatible HID mappings.
Device support is required for the following keycode mappings.
Function |
Mappings |
Context |
Behavior |
A |
HID usage page: 0x0C
HID usage: 0x0CD
Kernel key: KEY_PLAYPAUSE
Android key: KEYCODE_MEDIA_PLAY_PAUSE |
Media playback |
Input: Short press
Output: Play or pause |
Input: Long press
Output: Launch voice command
Sends:
android.speech.action.VOICE_SEARCH_HANDS_FREE if the device
is locked or its screen is off. Sends
android.speech.RecognizerIntent.ACTION_WEB_SEARCH otherwise |
Incoming call |
Input: Short press
Output: Accept call |
Input: Long press
Output: Reject call |
Ongoing call |
Input: Short press
Output: End call |
Input: Long press
Output: Mute or unmute microphone |
B |
HID usage page: 0x0C
HID usage: 0x0E9
Kernel key: KEY_VOLUMEUP
Android key: VOLUME_UP |
Media playback, Ongoing call |
Input: Short or long press
Output: Increases the system or headset volume |
C |
HID usage page: 0x0C
HID usage: 0x0EA
Kernel key: KEY_VOLUMEDOWN
Android key: VOLUME_DOWN |
Media playback, Ongoing call |
Input: Short or long press
Output: Decreases the system or headset volume |
D |
HID usage page: 0x0C
HID usage: 0x0CF
Kernel key: KEY_VOICECOMMAND
Android key: KEYCODE_VOICE_ASSIST |
All. Can be triggered in any instance. |
Input: Short or long press
Output: Launch voice command |
Hardware
Device manufacturers should also see
USB digital audio for more
information about USB implementation on Android. Device manufacturers must also
follow the requirements in the
USB section of the Android CDD.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-08-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-26 UTC."],[],[],null,["# USB headset: Device specification\n\nFor USB headsets to work seamlessly across the Android ecosystem, Android\ndevices must support them uniformly. This documentation specifies USB\nbehavior to support USB headsets and adapters across the Android ecosystem.\n\nSoftware mapping\n----------------\n\n\nCompatible USB headsets are required to support compatible HID mappings.\nDevice support is required for the following keycode mappings.\n\n| Function | Mappings | Context | Behavior |\n|----------|-------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| A | **HID usage page** : 0x0C **HID usage** : 0x0CD **Kernel key** : `KEY_PLAYPAUSE` **Android key** : `KEYCODE_MEDIA_PLAY_PAUSE` | Media playback | **Input** : Short press **Output**: Play or pause |\n| A | **HID usage page** : 0x0C **HID usage** : 0x0CD **Kernel key** : `KEY_PLAYPAUSE` **Android key** : `KEYCODE_MEDIA_PLAY_PAUSE` | Media playback | **Input** : Long press **Output** : Launch voice command **Sends** : `android.speech.action.VOICE_SEARCH_HANDS_FREE` if the device is locked or its screen is off. Sends `android.speech.RecognizerIntent.ACTION_WEB_SEARCH` otherwise |\n| A | **HID usage page** : 0x0C **HID usage** : 0x0CD **Kernel key** : `KEY_PLAYPAUSE` **Android key** : `KEYCODE_MEDIA_PLAY_PAUSE` | Incoming call | **Input** : Short press **Output**: Accept call |\n| A | **HID usage page** : 0x0C **HID usage** : 0x0CD **Kernel key** : `KEY_PLAYPAUSE` **Android key** : `KEYCODE_MEDIA_PLAY_PAUSE` | Incoming call | **Input** : Long press **Output**: Reject call |\n| A | **HID usage page** : 0x0C **HID usage** : 0x0CD **Kernel key** : `KEY_PLAYPAUSE` **Android key** : `KEYCODE_MEDIA_PLAY_PAUSE` | Ongoing call | **Input** : Short press **Output**: End call |\n| A | **HID usage page** : 0x0C **HID usage** : 0x0CD **Kernel key** : `KEY_PLAYPAUSE` **Android key** : `KEYCODE_MEDIA_PLAY_PAUSE` | Ongoing call | **Input** : Long press **Output**: Mute or unmute microphone |\n| B | **HID usage page** : 0x0C **HID usage** : 0x0E9 **Kernel key** : `KEY_VOLUMEUP` **Android key** : `VOLUME_UP` | Media playback, Ongoing call | **Input** : Short or long press **Output**: Increases the system or headset volume |\n| C | **HID usage page** : 0x0C **HID usage** : 0x0EA **Kernel key** : `KEY_VOLUMEDOWN` **Android key** : `VOLUME_DOWN` | Media playback, Ongoing call | **Input** : Short or long press **Output**: Decreases the system or headset volume |\n| D | **HID usage page** : 0x0C **HID usage** : 0x0CF **Kernel key** : `KEY_VOICECOMMAND` **Android key** : `KEYCODE_VOICE_ASSIST` | All. Can be triggered in any instance. | **Input** : Short or long press **Output**: Launch voice command |\n\nHardware\n--------\n\n\nDevice manufacturers should also see\n[USB digital audio](/docs/core/audio/usb) for more\ninformation about USB implementation on Android. Device manufacturers must also\nfollow the requirements in the\n[USB section](/docs/compatibility/13/android-13-cdd#77_usb) of the Android CDD."]]