Wired Headset Button Events

Search This thread

joshiameya

Senior Member
Nov 10, 2014
474
152
Hi,

I am trying to understand, how android os or audio layer interprets 2 taps of button A as skip to next track event. Here is the website for reference

https://source.android.com/devices/accessories/headset/expected-behavior

When user presses the middle button on wired headset, the os will receive

Keyevent ACTION_DOWN, KEYCODE_MEDIA_PLAY_PAUSE

keyevent ACTION_UP, KEYCODE_MEDIA_PLAY_PAUSE

twice in sequence and somehow that gets converted to MEdia_next event so that players like vlc skip to next track in the Playlist

I don't think it's the app doing anything but the os in the middle interpretating those events in sequence as next event.

Can someone help me where should I look

Regards