From 79a6b65bb95a5e50b915b5a653470db6334d10bf Mon Sep 17 00:00:00 2001 From: warstar2187 Date: Wed, 26 Oct 2016 19:38:36 +0900 Subject: [PATCH 1/2] Update SmsCommunicatorPlugin.java --- .../plugins/SmsCommunicator/SmsCommunicatorPlugin.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java index 1a8e66125b..9693849eb6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java @@ -167,6 +167,7 @@ public class SmsCommunicatorPlugin implements PluginBase { if (loopPlugin != null && loopPlugin.isEnabled(PluginBase.LOOP)) { loopPlugin.setFragmentEnabled(PluginBase.LOOP, false); reply = MainApp.sResources.getString(R.string.smscommunicator_loophasbeendisabled); + newSms = new Sms(receivedSms.phoneNumber, reply, new Date()); } receivedSms.processed = true; break; @@ -175,6 +176,7 @@ public class SmsCommunicatorPlugin implements PluginBase { if (loopPlugin != null && !loopPlugin.isEnabled(PluginBase.LOOP)) { loopPlugin.setFragmentEnabled(PluginBase.LOOP, true); reply = MainApp.sResources.getString(R.string.smscommunicator_loophasbeenenabled); + newSms = new Sms(receivedSms.phoneNumber, reply, new Date()); } receivedSms.processed = true; break; @@ -186,6 +188,7 @@ public class SmsCommunicatorPlugin implements PluginBase { } else { reply = MainApp.sResources.getString(R.string.smscommunicator_loopisdisabled); } + newSms = new Sms(receivedSms.phoneNumber, reply, new Date()); } receivedSms.processed = true; break; @@ -199,6 +202,7 @@ public class SmsCommunicatorPlugin implements PluginBase { MainApp.instance().getApplicationContext().sendBroadcast(restartNSClient); List q = MainApp.instance().getApplicationContext().getPackageManager().queryBroadcastReceivers(restartNSClient, 0); reply = "TERATMENTS REFRESH " + q.size() + " receivers"; + newSms = new Sms(receivedSms.phoneNumber, reply, new Date()); receivedSms.processed = true; break; } @@ -210,6 +214,7 @@ public class SmsCommunicatorPlugin implements PluginBase { MainApp.instance().getApplicationContext().sendBroadcast(restartNSClient); List q = MainApp.instance().getApplicationContext().getPackageManager().queryBroadcastReceivers(restartNSClient, 0); reply = "NSCLIENT RESTART " + q.size() + " receivers"; + newSms = new Sms(receivedSms.phoneNumber, reply, new Date()); receivedSms.processed = true; break; } @@ -218,6 +223,7 @@ public class SmsCommunicatorPlugin implements PluginBase { DanaRPlugin danaRPlugin = (DanaRPlugin) MainApp.getSpecificPlugin(DanaRPlugin.class); if (danaRPlugin != null && danaRPlugin.isEnabled(PluginBase.PUMP)) reply = danaRPlugin.shortStatus(); + newSms = new Sms(receivedSms.phoneNumber, reply, new Date()); receivedSms.processed = true; break; case "BASAL": From 5443bb4fba33465aec0486840522631bccb8038f Mon Sep 17 00:00:00 2001 From: warstar2187 Date: Thu, 27 Oct 2016 02:23:47 +0900 Subject: [PATCH 2/2] Update SmsCommunicatorPlugin.java --- .../plugins/SmsCommunicator/SmsCommunicatorPlugin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java index 9693849eb6..365027c012 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java @@ -264,6 +264,7 @@ public class SmsCommunicatorPlugin implements PluginBase { case "BOLUS": if (new Date().getTime() - lastRemoteBolusTime.getTime() < Constants.remoteBolusMinDistance) { reply = MainApp.sResources.getString(R.string.remotebolusnotallowed); + newSms = new Sms(receivedSms.phoneNumber, reply, new Date()); } else if (splited.length > 1) { amount = SafeParse.stringToDouble(splited[1]); amount = MainApp.getConfigBuilder().applyBolusConstraints(amount);