From 6544191c7824b041096f1c135248b4dd9503d7f4 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 1 Aug 2018 23:26:01 +0200 Subject: [PATCH] fix state plugin change handling --- .../java/info/nightscout/androidaps/interfaces/PluginBase.java | 2 +- .../androidaps/plugins/PumpDanaR/AbstractDanaRPlugin.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java b/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java index b9df338821..494cd9e1ae 100644 --- a/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java +++ b/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java @@ -120,7 +120,7 @@ public abstract class PluginBase { } } else { // disabling plugin if (state == State.ENABLED) { - onStateChange(type, state, State.ENABLED); + onStateChange(type, state, State.DISABLED); state = State.DISABLED; onStop(); if (L.isEnabled(L.CORE)) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/AbstractDanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/AbstractDanaRPlugin.java index 81f301b81b..63390621ec 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/AbstractDanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/AbstractDanaRPlugin.java @@ -67,7 +67,7 @@ public abstract class AbstractDanaRPlugin extends PluginBase implements PumpInte @Override public void onStateChange(PluginType type, State oldState, State newState) { // if pump profile was enabled need to switch to another too - if (type == PluginType.PUMP && newState == State.ENABLED && newState == State.DISABLED && isProfileInterfaceEnabled) { + if (type == PluginType.PUMP && newState == State.DISABLED && isProfileInterfaceEnabled) { setPluginEnabled(PluginType.PROFILE, false); NSProfilePlugin.getPlugin().setPluginEnabled(PluginType.PROFILE, true); NSProfilePlugin.getPlugin().setFragmentVisible(PluginType.PROFILE, true);