From aff82642af23ab44e5097f41bf34f5445ec93164 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Thu, 9 Feb 2017 23:39:23 +0100 Subject: [PATCH] wear multiple watch situation and disable fillbolus for wider testing --- .../plugins/Wear/ActionStringHandler.java | 13 ++++++++++++- .../nightscout/androidaps/data/ListenerService.java | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java index 56afc45f0c..280de7291e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java @@ -75,6 +75,17 @@ public class ActionStringHandler { rAction += "fill " + insulinAfterConstraints; + } else if ("fill".equals(act[0])) { + ///////////////////////////////////// PRIME/FILL + double amount = SafeParse.stringToDouble(act[1]); + + Double insulinAfterConstraints = MainApp.getConfigBuilder().applyBolusConstraints(amount); + rMessage += MainApp.instance().getString(R.string.primefill) + ": " + insulinAfterConstraints + "U"; + if (insulinAfterConstraints - amount != 0) + rMessage += "\n" + MainApp.instance().getString(R.string.constraintapllied); + + rAction += "fill " + insulinAfterConstraints; + } else if ("status".equals(act[0])) { ///////////////////////////////////// STATUS rTitle = "STATUS"; @@ -130,7 +141,7 @@ public class ActionStringHandler { // do the parsing, check constraints and enact! String[] act = actionString.split("\\s+"); - if ("fill".equals(act[0])){ + if (false && "fill".equals(act[0])){ Double amount = SafeParse.stringToDouble(act[1]); Double insulinAfterConstraints = MainApp.getConfigBuilder().applyBolusConstraints(amount); if(amount - insulinAfterConstraints != 0){ diff --git a/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java b/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java index d16f0d4324..00fddef72d 100644 --- a/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java +++ b/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java @@ -290,6 +290,8 @@ public class ListenerService extends WearableListenerService implements GoogleAp NotificationManagerCompat.from(this); notificationManager.notify(BOLUS_PROGRESS_NOTIF_ID, notificationBuilder.build()); + notificationManager.cancel(CONFIRM_NOTIF_ID); // multiple watch setup + if (progresspercent == 100){ scheduleDismiss(BOLUS_PROGRESS_NOTIF_ID, 5);