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