Do not display notification on configuration changed if no media item is playing

This commit is contained in:
vfsfitvnm 2022-06-29 20:34:39 +02:00
parent 1fb50169ff
commit 8b345c2405

View file

@ -228,7 +228,7 @@ class PlayerService : Service(), Player.Listener, PlaybackStatsListener.Callback
}
override fun onConfigurationChanged(newConfig: Configuration) {
if (bitmapProvider.setDefaultBitmap()) {
if (bitmapProvider.setDefaultBitmap() && player.currentMediaItem != null) {
notificationManager.notify(NotificationId, notification())
}
super.onConfigurationChanged(newConfig)