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

Commit b218a6b0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "AVRCP: Check mMediaSessionManager is not null before handling callback"

parents 81ce5210 073b261a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -626,6 +626,12 @@ public class MediaPlayerList {
                    android.media.session.MediaController controller =
                            new android.media.session.MediaController(mContext, token);

                    if (mMediaSessionManager == null) {
                        Log.w(TAG, "onAddressedPlayerChanged(Token): Unexpected callback "
                                + "from the MediaSessionManager");
                        return;
                    }

                    if (!mMediaPlayerIds.containsKey(controller.getPackageName())) {
                        // Since we have a controller, we can try to to recover by adding the
                        // player and then setting it as active.
@@ -640,6 +646,12 @@ public class MediaPlayerList {

                @Override
                public void onAddressedPlayerChanged(ComponentName receiver) {
                    if (mMediaSessionManager == null) {
                        Log.w(TAG, "onAddressedPlayerChanged(Component): Unexpected callback "
                                + "from the MediaSessionManager");
                        return;
                    }

                    if (receiver == null) {
                        return;
                    }