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

Commit 1e77d800 authored by Ray Kuo's avatar Ray Kuo Committed by android-build-merger
Browse files

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

am: b218a6b0

Change-Id: Idcbbf12a8da494f13e26b3e023c26a4541265d48
parents 61efd82a b218a6b0
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;
                    }