2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 06:05:12 +00:00

Unbreak Mpris media notifications

Because notificationDevice is only set on updateCurrentPlayer(), we
ought to call it before checking if the device is null.
This commit is contained in:
Łukasz Patron
2023-07-07 20:48:43 +02:00
parent cafbfcaee8
commit 1273cb641a

View File

@@ -264,15 +264,15 @@ public class MprisMediaSession implements
return;
}
//Make sure our information is up-to-date
MprisPlugin.MprisPlayer currentPlayer = updateCurrentPlayer();
Device device = KdeConnect.getInstance().getDevice(notificationDevice);
if (device == null) {
closeMediaNotification();
return;
}
//Make sure our information is up-to-date
MprisPlugin.MprisPlayer currentPlayer = updateCurrentPlayer();
//If the player disappeared (and no other playing one found), just remove the notification
if (currentPlayer == null) {
closeMediaNotification();