From 361331e54f0e80b7e50d2f3a94e5fcf4f5e7d201 Mon Sep 17 00:00:00 2001 From: Dibyendu Saha Date: Fri, 10 Apr 2020 12:21:58 +0530 Subject: [PATCH] for commit #2676 : it is better to have audio attribute as USAGE_NOTIFICATION instead of USAGE_ALARM, as it will give control to device notification volume instead of alarm --- .../plugin/notification/NotificationChannelManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/notification/NotificationChannelManager.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/notification/NotificationChannelManager.java index 6a76adf8da..bff32262b5 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/notification/NotificationChannelManager.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/notification/NotificationChannelManager.java @@ -83,7 +83,7 @@ public void createChannel(JSObject channel) { } AudioAttributes audioAttributes = new AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) - .setUsage(AudioAttributes.USAGE_ALARM).build(); + .setUsage(AudioAttributes.USAGE_NOTIFICATION).build(); Uri soundUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.getPackageName() + "/raw/" + sound); notificationChannel.setSound(soundUri, audioAttributes); }