2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 06:05:12 +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
public void onListenerConnected(NotificationReceiver service) {
for (StatusBarNotification n : service.getActiveNotifications()) {
if ("com.spotify.music".equals(n.getPackageName())) {
spotifyRunning = true;
updateMediaNotification();
try {
for (StatusBarNotification n : service.getActiveNotifications()) {
if ("com.spotify.music".equals(n.getPackageName())) {
spotifyRunning = true;
updateMediaNotification();
}
}
} catch(SecurityException e) {
e.printStackTrace();
}
}