Remove sound from notification channel

This commit is contained in:
TebbeUbben 2020-03-09 23:19:16 +01:00
parent 5e778f1e76
commit 206813ae4b
2 changed files with 3 additions and 2 deletions

View file

@ -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);

View file

@ -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) {