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
(cherry picked from commit ca61ac6ca35427a697a6645c90cc8e12889c78f7)
This commit is contained in:
ibaker 2024-01-23 03:47:30 -08:00 committed by SheenaChhabra
parent 21e6c1c43e
commit dd9f61005e

View File

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