mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-05-17 15:56:36 +03:00
setShowBadge = false
This commit is contained in:
parent
e4bf431cfe
commit
88f6bdb3a9
@ -174,14 +174,7 @@ public class MediaPlayerService extends Service
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Create Notification Channel
|
// Create Notification Channel
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
createNotificationChannel();
|
||||||
//The suggested importance of a startForeground service notification is IMPORTANCE_LOW
|
|
||||||
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, NOTIFICATION_CHANNEL_NAME, NotificationManager.IMPORTANCE_LOW);
|
|
||||||
channel.setLightColor(android.R.color.holo_blue_dark);
|
|
||||||
channel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
|
|
||||||
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
|
||||||
manager.createNotificationChannel(channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update notification early. It is better to show an empty one temporarily than waiting too long and letting Android kill the app
|
// Update notification early. It is better to show an empty one temporarily than waiting too long and letting Android kill the app
|
||||||
updateNotification(IDLE, null);
|
updateNotification(IDLE, null);
|
||||||
@ -644,6 +637,18 @@ public class MediaPlayerService extends Service
|
|||||||
mediaSession.setPlaybackState(playbackState.build());
|
mediaSession.setPlaybackState(playbackState.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void createNotificationChannel() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
//The suggested importance of a startForeground service notification is IMPORTANCE_LOW
|
||||||
|
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, NOTIFICATION_CHANNEL_NAME, NotificationManager.IMPORTANCE_LOW);
|
||||||
|
channel.setLightColor(android.R.color.holo_blue_dark);
|
||||||
|
channel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
|
||||||
|
channel.setShowBadge(false);
|
||||||
|
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
manager.createNotificationChannel(channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void updateNotification(PlayerState playerState, DownloadFile currentPlaying)
|
public void updateNotification(PlayerState playerState, DownloadFile currentPlaying)
|
||||||
{
|
{
|
||||||
if (Util.isNotificationEnabled(this)) {
|
if (Util.isNotificationEnabled(this)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user