-
Notifications
You must be signed in to change notification settings - Fork 647
Open Fix missing KEYCODE_HEADSETHOOK caseMain #2816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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