Loading
AVRCP: Check mMediaSessionManager is not null before handling callback
While the Bluetooth is turning off and MediaPlayerList is cleaned up, handling the unexpected onAddressedPlayerChanged() callback from the MediaSessionManager causes the NPE. This NPE happens at getActivePlayer().unregisterCallback() in the setActivePlayer() function due to the return value of getActivePlayer() will be null. Before handling the onAddressedPlayerChanged() callback, add a check of mMediaSessionManager is not cleaned up to fix this issue. Bug: 135727092 Test: make, tune the timing of cleaning up MediaPlayerList to hit this issue, perform Airplane mode on/off and AVRCP related tests. Change-Id: I7ef66d1977a6e31c989e2d1ec4a87ca8144b3778