KeyEvent.KEYCODE_MEDIA_NEXT not received if no sound is played

I connected to a bluetooth headset. When a sound is played, KeyEvent.KEYCODE_MEDIA_NEXT and KeyEvent.KEYCODE_MEDIA_PREVIOUS are accepted in my BroadcastReceiver . When sound does not play, my receiver is not called for these key events.

In the same state, when the sound does not play, the same receiver is called to play / pause, KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE , so I know that this is not a problem for my registrar that is not registering.

As soon as the sound starts to play, I see through the logs that when the sound did not play, all KeyEvent.KEYCODE_MEDIA_NEXT events were queued and retransmitted after the sound started. Each of these events comes with KeyEvent.ACTION_DOWN.

Is this normal behavior? Do you use the following and previous buttons with Bluetooth only when playing sound?

+4
source share
1 answer

I ran into one problem with one pair of headphones. But when I tried a couple more headphones, my BroadcastReceiver got KEYCODE_MEDIA_PREVIOUS and KEYCODE_MEDIA_NEXT when the sound was not playing. It seems that the problem depends on the headphones you are using.

0
source

All Articles