Fixed crashes on pre-Marshmallow devices because of Notification

This commit is contained in:
Prathamesh More 2022-01-02 11:35:57 +05:30
parent 3f5d83b4d4
commit eb02b7eb1d
2 changed files with 3 additions and 4 deletions

View file

@ -431,9 +431,7 @@ public class MusicService extends MediaBrowserServiceCompat
registerReceiver(lockScreenReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
setSessionToken(mediaSession.getSessionToken());
if (VersionUtils.INSTANCE.hasMarshmallow()) {
notificationManager = getSystemService(NotificationManager.class);
}
notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
initNotification();
mediaStoreObserver = new MediaStoreObserver(this, playerHandler);