mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-03 15:45:10 +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:
@@ -264,15 +264,15 @@ public class MprisMediaSession implements
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Make sure our information is up-to-date
|
||||||
|
MprisPlugin.MprisPlayer currentPlayer = updateCurrentPlayer();
|
||||||
|
|
||||||
Device device = KdeConnect.getInstance().getDevice(notificationDevice);
|
Device device = KdeConnect.getInstance().getDevice(notificationDevice);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
closeMediaNotification();
|
closeMediaNotification();
|
||||||
return;
|
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 the player disappeared (and no other playing one found), just remove the notification
|
||||||
if (currentPlayer == null) {
|
if (currentPlayer == null) {
|
||||||
closeMediaNotification();
|
closeMediaNotification();
|
||||||
|
Reference in New Issue
Block a user