2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-02 23:25:10 +00:00

Catch SecurityException when calling getActiveNotifications

It's okay to ignore this since we were only using it to check if Spotify
was running.
This commit is contained in:
Albert Vaca Cintora
2023-07-08 00:38:50 +02:00
parent 1c3389efa0
commit 48cccf3fca

View File

@@ -502,11 +502,15 @@ public class MprisMediaSession implements
@Override @Override
public void onListenerConnected(NotificationReceiver service) { public void onListenerConnected(NotificationReceiver service) {
for (StatusBarNotification n : service.getActiveNotifications()) { try {
if ("com.spotify.music".equals(n.getPackageName())) { for (StatusBarNotification n : service.getActiveNotifications()) {
spotifyRunning = true; if ("com.spotify.music".equals(n.getPackageName())) {
updateMediaNotification(); spotifyRunning = true;
updateMediaNotification();
}
} }
} catch(SecurityException e) {
e.printStackTrace();
} }
} }