page.title=USB Headset: Accessory Specification @jd:body
This documentation specifies USB headset buttons behavior to function uniformly across the Android ecosystem. Device manufacturers should also consult the USB Digital Audio page for more information about USB implementation on Android and the Android Compatibility Definition Document (CDD) for requirements related to Android devices.
There are also specifications for 3.5 mm headsets for accessory manufacturers and 3.5 mm jacks for device manufacturers.
This documentation specifies the minimum requirements: accessory manufacturers are encouraged to add features while keeping these requirements in mind.
Control Function | Accessory Support | Description |
---|---|---|
Function A | Required | Play/pause (short press), launch voice assistance (long press), next (double press) |
Function B | Optional | Vol+ |
Function C | Optional | Vol- |
Function D | Optional | Launch voice assistance |
Assign functions to buttons as follows:
Note: No key latching allowed. Each key press by the end user must generate the corresponding "down" and "up" key event, matching the end user action. In other words, the keys for functions A through D are never "latched" or implemented to be used as a toggle (where the "up" event only follows "down" on a second key press).
Compatible USB headsets are required to support the following software mappings for the headset buttons. Device support is required for the following software mappings.
Function | Mappings | Context | Behavior |
---|---|---|---|
Function 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 assistance Sends: android.intent.action.VOICE_SEARCH_HANDS_FREE |
|||
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 |
|||
Function 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 |
Function 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 |
Function 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 assistance |
Accessory manufacturers must follow the requirements for USB connectors as specified by USB.org.
Device manufacturers must follow the requirements in the USB section of the Android CDD.