Я прочитал, что важность уведомлений для служб переднего плана должна быть по меньшей мере НИЗКОЙ, но когда я пытаюсь изменить значение на НИЗКАЯ или ВЫСОКАЯ, она игнорируется, а уведомление остается в СРЕДНЕМ значении.Почему и как это можно исправить?
Фрагмент кода:
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
String id = SYNC_CHANNEL;
String name = getApplicationContext().getResources().getString(R.string.sync_data);
String description = getApplicationContext().getResources().getString(R.string.sync_progress);
int importance = NotificationManager.IMPORTANCE_LOW; // Setting importance
NotificationChannel channel = new NotificationChannel(id, name, importance);
channel.setDescription(description);
channel.enableLights(false);
channel.enableVibration(false);
if (notificationManager == null) {
return;
}
notificationManager.createNotificationChannel(channel);
NotificationCompat.Builder b = new NotificationCompat.Builder(getApplicationContext(), id);
b.setSmallIcon(R.drawable.ic_refresh)
.setContentTitle(getApplicationContext().getResources().getString(R.string.app_name))
.setContentText(getApplicationContext().getResources().getString(R.string.sync_data))
.setOngoing(true);
startForeground(1547, b.build());