Release MediaSession and ExoPlayer in MediaControllerStubTest

Due to poor isolation between the session tests, in particular the
static state in `MediaSession.SESSION_ID_TO_SESSION_MAP`, an unreleased
session at the end of one test can cause subsequent tests to fail with
obscure errors like `Session ID must be unique`.

#minor-release

PiperOrigin-RevId: 600737697
This commit is contained in:
ibaker 2024-01-23 03:47:30 -08:00 committed by Copybara-Service
parent 94ce356bc1
commit ca61ac6ca3

View File

@ -139,5 +139,8 @@ public class MediaControllerStubTest {
/* query= */ "", /* query= */ "",
/* itemCount= */ 1, /* itemCount= */ 1,
/* libraryParams= */ getThrowingBundle()); /* libraryParams= */ getThrowingBundle());
session.release();
player.release();
} }
} }