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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user