A partire dal 27 marzo 2025, ti consigliamo di utilizzare android-latest-release
anziché aosp-main
per compilare e contribuire ad AOSP. Per ulteriori informazioni, vedi Modifiche ad AOSP.
Cuffie USB: specifiche del dispositivo
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Affinché le cuffie USB funzionino perfettamente nell'ecosistema Android, i dispositivi Android devono supportarle in modo uniforme. Questa documentazione specifica il comportamento USB per supportare cuffie e adattatori USB nell'ecosistema Android.
Mappatura del software
Sono necessarie cuffie USB compatibili per supportare le mappature HID compatibili.
Il supporto del dispositivo è necessario per le seguenti mappature di codici a tasti.
Funzione |
Mappature |
Contesto |
Comportamento |
A |
Pagina di utilizzo HID: 0x0C
Utilizzo HID: 0x0CD
Chiave del kernel: KEY_PLAYPAUSE
Chiave Android: KEYCODE_MEDIA_PLAY_PAUSE |
Riproduzione di contenuti multimediali |
Input: pressione breve
Output: riproduzione o messa in pausa |
Input: pressione prolungata
Output: avvia il comando vocale
Invia:android.speech.action.VOICE_SEARCH_HANDS_FREE se il dispositivo è bloccato o lo schermo è spento. Inviaandroid.speech.RecognizerIntent.ACTION_WEB_SEARCH in caso contrario |
Chiamata in arrivo |
Input: pressione breve
Output: accetta chiamata |
Input: pressione prolungata
Output: Rifiuta chiamata |
Chiamata in corso |
Input: pressione breve
Output: termina chiamata |
Input: pressione prolungata
Output: disattiva o riattiva il microfono |
B |
Pagina di utilizzo HID: 0x0C
Utilizzo HID: 0x0E9
Chiave del kernel: KEY_VOLUMEUP
Chiave Android: VOLUME_UP |
Riproduzione di contenuti multimediali, Chiamata in corso |
Input: pressione breve o prolungata
Output: aumenta il volume del sistema o delle cuffie |
C |
Pagina di utilizzo HID: 0x0C
Utilizzo HID: 0x0EA
Chiave del kernel: KEY_VOLUMEDOWN
Chiave Android: VOLUME_DOWN |
Riproduzione di contenuti multimediali, Chiamata in corso |
Input: pressione breve o prolungata
Output: riduce il volume del sistema o delle cuffie |
D |
Pagina di utilizzo HID: 0x0C
Utilizzo HID: 0x0CF
Chiave del kernel: KEY_VOICECOMMAND
Chiave Android: KEYCODE_VOICE_ASSIST |
Tutti. Può essere attivato in qualsiasi istanza. |
Input: pressione breve o lunga
Output: avvia il comando vocale |
Hardware
I produttori di dispositivi devono anche consultare la sezione Audio digitale USB per ulteriori informazioni sull'implementazione USB su Android. I produttori di dispositivi devono inoltre rispettare i requisiti riportati nella sezione USB del CDD di Android.
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-27 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."]]