diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index c478e4ccd..1d01b0bd9 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -399,6 +399,17 @@ public class NotificationService { public void startRinging(final AbstractJingleConnection.Id id, final Set media) { showIncomingCallNotification(id, media); + final NotificationManager notificationManager = (NotificationManager) mXmppConnectionService.getSystemService(Context.NOTIFICATION_SERVICE); + final int currentInterruptionFilter; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && notificationManager != null) { + currentInterruptionFilter = notificationManager.getCurrentInterruptionFilter(); + } else { + currentInterruptionFilter = 1; //INTERRUPTION_FILTER_ALL + } + if (currentInterruptionFilter != 1) { + Log.d(Config.LOGTAG,"do not ring or vibrate because interruption filter has been set to "+currentInterruptionFilter); + return; + } this.vibrationFuture = SCHEDULED_EXECUTOR_SERVICE.scheduleAtFixedRate( new VibrationRunnable(), 0,