From 206813ae4b27c7127ee3055a349a263db8615b26 Mon Sep 17 00:00:00 2001 From: TebbeUbben Date: Mon, 9 Mar 2020 23:19:16 +0100 Subject: [PATCH] Remove sound from notification channel --- .../androidaps/plugins/pump/insight/InsightAlertService.java | 2 +- .../androidaps/plugins/pump/insight/LocalInsightPlugin.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java index 53ce3a7d5e..4a543f27c5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java @@ -129,8 +129,8 @@ public class InsightAlertService extends Service implements InsightConnectionSer private void queryActiveAlert() { while (!Thread.currentThread().isInterrupted()) { try { - Alert alert = connectionService.requestMessage(new GetActiveAlertMessage()).await().getAlert(); synchronized ($alertLock) { + Alert alert = connectionService.requestMessage(new GetActiveAlertMessage()).await().getAlert(); if (alert == null || (alert.getAlertType() == ignoreType && System.currentTimeMillis() - ignoreTimestamp < 10000)) { if (connectionRequested) { connectionService.withdrawConnectionRequest(this); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 66ee0bed5a..89e20de90e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -257,6 +257,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { NotificationManager notificationManager = (NotificationManager) MainApp.instance().getSystemService(Context.NOTIFICATION_SERVICE); NotificationChannel channel = new NotificationChannel(ALERT_CHANNEL_ID, MainApp.gs(R.string.insight_alert_notification_channel), NotificationManager.IMPORTANCE_HIGH); + channel.setSound(null, null); notificationManager.createNotificationChannel(channel); } } @@ -661,9 +662,9 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con cancelBolusMessage.setBolusID(bolusID); connectionService.requestMessage(cancelBolusMessage).await(); bolusCancelled = true; + confirmAlert(AlertType.WARNING_38); alertService.ignore(null); } - confirmAlert(AlertType.WARNING_38); } catch (AppLayerErrorException e) { log.info("Exception while canceling bolus: " + e.getClass().getCanonicalName() + " (" + e.getErrorCode() + ")"); } catch (InsightException e) {