2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 13:47:41 +00:00

Added missing "unregister"

This commit is contained in:
Albert Vaca 2019-03-20 09:36:23 +01:00
parent 7799f7e817
commit 18548fb6df

View File

@ -79,6 +79,15 @@ public class MprisReceiverPlugin extends Plugin implements MediaSessionManager.O
return true; return true;
} }
@Override
public void onDestroy() {
super.onDestroy();
MediaSessionManager manager = (MediaSessionManager) context.getSystemService(Context.MEDIA_SESSION_SERVICE);
if (manager != null) {
manager.removeOnActiveSessionsChangedListener(MprisReceiverPlugin.this);
}
}
private void createPlayers(List<MediaController> sessions) { private void createPlayers(List<MediaController> sessions) {
for (MediaController controller : sessions) { for (MediaController controller : sessions) {
createPlayer(controller); createPlayer(controller);