mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-01 22:55:10 +00:00
Fix NPE
This commit is contained in:
@@ -495,7 +495,7 @@ public class MprisMediaSession implements SharedPreferences.OnSharedPreferenceCh
|
|||||||
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
|
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
|
||||||
@Override
|
@Override
|
||||||
public void onNotificationPosted(StatusBarNotification n) {
|
public void onNotificationPosted(StatusBarNotification n) {
|
||||||
if (n.getPackageName().equals("com.spotify.music")) {
|
if ("com.spotify.music".equals(n.getPackageName())) {
|
||||||
spotifyRunning = true;
|
spotifyRunning = true;
|
||||||
updateMediaNotification();
|
updateMediaNotification();
|
||||||
}
|
}
|
||||||
@@ -504,7 +504,7 @@ public class MprisMediaSession implements SharedPreferences.OnSharedPreferenceCh
|
|||||||
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
|
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
|
||||||
@Override
|
@Override
|
||||||
public void onNotificationRemoved(StatusBarNotification n) {
|
public void onNotificationRemoved(StatusBarNotification n) {
|
||||||
if (n.getPackageName().equals("com.spotify.music")) {
|
if ("com.spotify.music".equals(n.getPackageName())) {
|
||||||
spotifyRunning = false;
|
spotifyRunning = false;
|
||||||
updateMediaNotification();
|
updateMediaNotification();
|
||||||
}
|
}
|
||||||
@@ -514,7 +514,7 @@ public class MprisMediaSession implements SharedPreferences.OnSharedPreferenceCh
|
|||||||
@Override
|
@Override
|
||||||
public void onListenerConnected(NotificationReceiver service) {
|
public void onListenerConnected(NotificationReceiver service) {
|
||||||
for (StatusBarNotification n : service.getActiveNotifications()) {
|
for (StatusBarNotification n : service.getActiveNotifications()) {
|
||||||
if (n.getPackageName().equals("com.spotify.music")) {
|
if ("com.spotify.music".equals(n.getPackageName())) {
|
||||||
spotifyRunning = true;
|
spotifyRunning = true;
|
||||||
updateMediaNotification();
|
updateMediaNotification();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user