mirror of https://github.com/M66B/NetGuard.git
Use default notification audio attributes
This commit is contained in:
parent
89d9adb899
commit
0f5fa4bfe9
|
@ -21,6 +21,7 @@ package eu.faircode.netguard;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
import android.app.Notification;
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -57,15 +58,15 @@ public class ApplicationEx extends Application {
|
||||||
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
|
||||||
NotificationChannel foreground = new NotificationChannel("foreground", getString(R.string.channel_foreground), NotificationManager.IMPORTANCE_MIN);
|
NotificationChannel foreground = new NotificationChannel("foreground", getString(R.string.channel_foreground), NotificationManager.IMPORTANCE_MIN);
|
||||||
foreground.setSound(null, new AudioAttributes.Builder().build());
|
foreground.setSound(null, Notification.AUDIO_ATTRIBUTES_DEFAULT);
|
||||||
nm.createNotificationChannel(foreground);
|
nm.createNotificationChannel(foreground);
|
||||||
|
|
||||||
NotificationChannel notify = new NotificationChannel("notify", getString(R.string.channel_notify), NotificationManager.IMPORTANCE_DEFAULT);
|
NotificationChannel notify = new NotificationChannel("notify", getString(R.string.channel_notify), NotificationManager.IMPORTANCE_DEFAULT);
|
||||||
notify.setSound(null, new AudioAttributes.Builder().build());
|
notify.setSound(null, Notification.AUDIO_ATTRIBUTES_DEFAULT);
|
||||||
nm.createNotificationChannel(notify);
|
nm.createNotificationChannel(notify);
|
||||||
|
|
||||||
NotificationChannel access = new NotificationChannel("access", getString(R.string.channel_access), NotificationManager.IMPORTANCE_DEFAULT);
|
NotificationChannel access = new NotificationChannel("access", getString(R.string.channel_access), NotificationManager.IMPORTANCE_DEFAULT);
|
||||||
access.setSound(null, new AudioAttributes.Builder().build());
|
access.setSound(null, Notification.AUDIO_ATTRIBUTES_DEFAULT);
|
||||||
nm.createNotificationChannel(access);
|
nm.createNotificationChannel(access);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue