Open Fix missing KEYCODE_HEADSETHOOK caseMain#2816
Open Fix missing KEYCODE_HEADSETHOOK caseMain#2816copybara-service[bot] merged 7 commits intoandroidx:mainfrom johngray1965:main
Conversation
…nnected_dispatchesEvent to include KEYCODE_MEDIA_PLAY_PAUSE & KEYCODE_HEADSETHOOK. Fixed a missing case for KEYCODE_HEADSETHOOK that caused the test above to fail.
…HOOK result in correct calls on the player
|
@marcbaechinger Here you go |
|
Many thanks! I'm going to send this for internal review now. You may see some more commits being added as I make changes in response to review feedback. Please refrain from pushing any more substantive changes as it will complicate the internal review - thanks! |
|
@marcbaechinger Thank you. I won't change anything unless I'm asked to. |
...ries/test_session_current/src/androidTest/java/androidx/media3/session/MediaSessionTest.java
Outdated
Show resolved
Hide resolved
|
Thanks John. I added a couple of test cases to make it obvious what your fix actually fixed. The test that your change makes pass is the unit test I added in I've added the test cases and sent that for review. The PR will be merged as soon as this is done. Please continue not adding further changes. :) Thanks a lot for that contribution. Very much appreciated! |
|
@marcbaechinger Thank you. I was tempted to add more tests myself, but I was trying to keep the PR as small as possible. |
|
@marcbaechinger the new tests look great, one suggestion, MediaButtonReceiver checks that the keyCode is KeyEvent.KEYCODE_MEDIA_PLAY, KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE, or KeyEvent.KEYCODE_HEADSETHOOK. Why not have the parameterized test do all three (I believe its not doing KeyEvent.KEYCODE_MEDIA_PLAY). I imagine that covered elsewhere, but why not cover it here too for completeness. |
|
Yeah, can do. I'll do that in a follow up CL if I get the approval. It's a bit easier for me then routing everything through GitHub and back to our internal repo. Will do that just after I have submitted internally. How does that sound? |
|
@marcbaechinger sounds good. I feel like the tests not exercising all the options is how this originally slipped through the cracks. |
|
Found another warning, so here we go. :) |
PiperOrigin-RevId: 814355296
Fixes #2768