From 08bf9d86cd97f83de46d8cf1aba0bc6418b187a1 Mon Sep 17 00:00:00 2001 From: AgentConDier Date: Sun, 31 Jul 2022 15:07:59 +0200 Subject: [PATCH] Changed: Replace Notificaton `sound` option with `silent` The sound option is being ignored in favor of channel settings. Instead, add a silent option to be able to create notifications without playing any sound. --- app/src/main/java/com/termux/api/apis/NotificationAPI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/termux/api/apis/NotificationAPI.java b/app/src/main/java/com/termux/api/apis/NotificationAPI.java index caee093a3..4112991e0 100644 --- a/app/src/main/java/com/termux/api/apis/NotificationAPI.java +++ b/app/src/main/java/com/termux/api/apis/NotificationAPI.java @@ -174,7 +174,7 @@ static Pair buildNotification(final Context int ledOffMs = intent.getIntExtra("led-off", 800); long[] vibratePattern = intent.getLongArrayExtra("vibrate"); - boolean useSound = intent.getBooleanExtra("sound", false); + boolean silent = intent.getBooleanExtra("silent", false); boolean ongoing = intent.getBooleanExtra("ongoing", false); boolean alertOnce = intent.getBooleanExtra("alert-once", false); @@ -275,7 +275,7 @@ static Pair buildNotification(final Context notification.setVibrate(vibrateArg); } - if (useSound) notification.setSound(Settings.System.DEFAULT_NOTIFICATION_URI); + if (silent) notification.setSilent(true); notification.setAutoCancel(true);