From 559e07904c5ba8126ffda7a481fee51f2f554a35 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 26 May 2017 10:31:05 +0200 Subject: [PATCH] remove unneeded call --- .../nightscout/androidaps/interfaces/PumpInterface.java | 3 --- .../plugins/ConfigBuilder/ConfigBuilderPlugin.java | 9 --------- .../androidaps/plugins/PumpDanaR/DanaRPlugin.java | 5 ----- .../plugins/PumpDanaRKorean/DanaRKoreanPlugin.java | 5 ----- .../androidaps/plugins/PumpDanaRv2/DanaRv2Plugin.java | 5 ----- .../nightscout/androidaps/plugins/PumpMDI/MDIPlugin.java | 5 ----- .../plugins/PumpVirtual/VirtualPumpPlugin.java | 5 ----- .../androidaps/plugins/Treatments/TreatmentsPlugin.java | 6 ++---- 8 files changed, 2 insertions(+), 41 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/interfaces/PumpInterface.java b/app/src/main/java/info/nightscout/androidaps/interfaces/PumpInterface.java index b48ff3153e..def7dcddd9 100644 --- a/app/src/main/java/info/nightscout/androidaps/interfaces/PumpInterface.java +++ b/app/src/main/java/info/nightscout/androidaps/interfaces/PumpInterface.java @@ -48,8 +48,5 @@ public interface PumpInterface { // Short info for SMS, Wear etc String shortStatus(boolean veryShort); - // Enforced Treatment plugin - String treatmentPlugin(); - boolean isFakingTempsByExtendedBoluses(); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index 67d40627f2..29658084aa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -694,15 +694,6 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain } } - @Override - public String treatmentPlugin() { - if (activePump != null) { - return activePump.treatmentPlugin(); - } else { - return null; - } - } - @Override public boolean isFakingTempsByExtendedBoluses() { return activePump.isFakingTempsByExtendedBoluses(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java index 46a3251b49..e035e67908 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java @@ -216,11 +216,6 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf this.fragmentPumpVisible = fragmentVisible; } - @Override - public String treatmentPlugin() { - return TreatmentsPlugin.class.getName(); - } - @Override public boolean isFakingTempsByExtendedBoluses() { return useExtendedBoluses; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/DanaRKoreanPlugin.java index 9f403c163d..48aa010569 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/DanaRKoreanPlugin.java @@ -215,11 +215,6 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints this.fragmentPumpVisible = fragmentVisible; } - @Override - public String treatmentPlugin() { - return TreatmentsPlugin.class.getName(); - } - @Override public boolean isFakingTempsByExtendedBoluses() { return useExtendedBoluses; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/DanaRv2Plugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/DanaRv2Plugin.java index 207ad20bfb..5fa1e9f490 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/DanaRv2Plugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/DanaRv2Plugin.java @@ -202,11 +202,6 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, ConstraintsInte this.fragmentPumpVisible = fragmentVisible; } - @Override - public String treatmentPlugin() { - return TreatmentsPlugin.class.getName(); - } - @Override public boolean isFakingTempsByExtendedBoluses() { return false; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMDI/MDIPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMDI/MDIPlugin.java index 330332b617..380e796aca 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMDI/MDIPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMDI/MDIPlugin.java @@ -117,11 +117,6 @@ public class MDIPlugin implements PluginBase, PumpInterface { return PluginBase.PUMP; } - @Override - public String treatmentPlugin() { - return TreatmentsPlugin.class.getName(); - } - @Override public boolean isFakingTempsByExtendedBoluses() { return false; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java index 789eee1ba7..51ea8cbc8c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java @@ -138,11 +138,6 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface { return PluginBase.PUMP; } - @Override - public String treatmentPlugin() { - return TreatmentsPlugin.class.getName(); - } - @Override public boolean isFakingTempsByExtendedBoluses() { return false; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java index 4dd1e712bb..d54c660559 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java @@ -81,8 +81,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface { @Override public boolean isEnabled(int type) { - boolean canBeEnabled = MainApp.getConfigBuilder().treatmentPlugin() == null ? true : MainApp.getConfigBuilder().treatmentPlugin().equals(getClass().getName()); - return type == TREATMENT && fragmentEnabled && canBeEnabled; + return type == TREATMENT && fragmentEnabled; } @Override @@ -102,8 +101,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface { @Override public boolean showInList(int type) { - boolean canBeEnabled = MainApp.getConfigBuilder().treatmentPlugin() == null ? true : MainApp.getConfigBuilder().treatmentPlugin().equals(getClass().getName()); - return canBeEnabled; + return true; } @Override