Debug: notifications' status

This commit is contained in:
M66B 2022-06-09 15:11:02 +02:00
parent 0d30b4376b
commit 4f034b157e
1 changed files with 10 additions and 0 deletions

View File

@ -2580,6 +2580,16 @@ public class Log {
try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) {
NotificationManager nm = Helper.getSystemService(context, NotificationManager.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
boolean enabled = nm.areNotificationsEnabled();
size += write(os, String.format("Enabled=%b %s\r\n",
enabled, (enabled ? "" : "!!!")));
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
boolean paused = nm.areNotificationsPaused();
size += write(os, String.format("Paused=%b %s\r\n",
paused, (paused ? "!!!" : "")));
}
String name;
int filter = nm.getCurrentInterruptionFilter();