Fix onAudioSessionIdChanged() handling in (Forwarding)SimpleBasePlayer#2978
Fix onAudioSessionIdChanged() handling in (Forwarding)SimpleBasePlayer#2978nift4 wants to merge 3 commits intoandroidx:mainfrom
Conversation
|
Hi @marcbaechinger, can you please check this PR? Thanks! |
|
Please can you add some tests for this |
|
@icbaker Thanks for the reminder, I added tests. Weirdly, ForwardingSimpleBasePlayerTest.getterMethods_noOtherMethodCalls_returnCurrentStateFromWrappedPlayer() was testing ForwardingPlayer instead of ForwardingSimpleBasePlayer, which I think might've been a mistake, so I fixed that. And then a lot of asserts started failing due to wrong available commands so I fixed that too. Please take a look whether that was correct, as it feels a bit odd that it was testing the wrong class? Edit: also, to be clear, there is already MediaControllerListenerTest.onAudioSessionIdChanged_isCalledAndUpdatesGetter() which covers MediaController, it seems controller itself never was affected and it just happens because both demo and my prod app use ForwardingSimpleBasePlayer. |
Thanks for flagging this! I agree it looks wrong. It seemed a bit messy to change the class-under-test in this PR (since it's not really related), so I submitted a separate change to make that fix: 4a32661 I've rebased & re-pushed this PR on top. |
|
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! |
Issue: #3140