mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 13:47:41 +00:00
Fix IllegalArgumentException crashes
This commit is contained in:
@@ -430,10 +430,13 @@ public class MprisMediaSession implements SharedPreferences.OnSharedPreferenceCh
|
|||||||
playbackActions |= PlaybackStateCompat.ACTION_SKIP_TO_NEXT;
|
playbackActions |= PlaybackStateCompat.ACTION_SKIP_TO_NEXT;
|
||||||
++numActions;
|
++numActions;
|
||||||
}
|
}
|
||||||
|
// Documentation says that this was added in Lollipop (21) but we had crashes on Marshmallow (23)
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
if (notificationPlayer.isSeekAllowed()) {
|
if (notificationPlayer.isSeekAllowed()) {
|
||||||
playbackActions |= PlaybackStateCompat.ACTION_SEEK_TO;
|
playbackActions |= PlaybackStateCompat.ACTION_SEEK_TO;
|
||||||
++numActions;
|
++numActions;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
playbackState.setActions(playbackActions);
|
playbackState.setActions(playbackActions);
|
||||||
mediaSession.setPlaybackState(playbackState.build());
|
mediaSession.setPlaybackState(playbackState.build());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user