Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9452bb9f authored by Santiago Seifert's avatar Santiago Seifert
Browse files

Remove callback upon MediaSession#release

This change prevents all callbacks from MediaSession after
the app calls MediaSession#release. Concretely, this change
fixes flakiness in MediaControllerTest, where the callback
implementation tries to access the media session after its
corresponding field has been set to null.

Bug: 294178159
Test: atest CtsMediaBetterTogetherTestCases
Change-Id: I112fa5df6aafdb2774ed65c2d08ab1eb680e6b47
parent 36d7fcd6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -442,6 +442,7 @@ public final class MediaSession {
     * but it must be released if your activity or service is being destroyed.
     */
    public void release() {
        setCallback(null);
        try {
            mBinder.destroySession();
        } catch (RemoteException e) {