2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-02 15:15:09 +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,12 +502,16 @@ public class MprisMediaSession implements
@Override @Override
public void onListenerConnected(NotificationReceiver service) { public void onListenerConnected(NotificationReceiver service) {
try {
for (StatusBarNotification n : service.getActiveNotifications()) { for (StatusBarNotification n : service.getActiveNotifications()) {
if ("com.spotify.music".equals(n.getPackageName())) { if ("com.spotify.music".equals(n.getPackageName())) {
spotifyRunning = true; spotifyRunning = true;
updateMediaNotification(); updateMediaNotification();
} }
} }
} catch(SecurityException e) {
e.printStackTrace();
}
} }
@Override @Override