diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java index 0dc2065b56..4e7c187768 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java @@ -102,11 +102,13 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf @Subscribe public void onStatusEvent(final EventPreferenceChange s) { - boolean previousValue = useExtendedBoluses; - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); - useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false); - if (useExtendedBoluses != previousValue && isExtendedBoluslInProgress()) { - sExecutionService.extendedBolusStop(); + if (isEnabled(PUMP)) { + boolean previousValue = useExtendedBoluses; + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); + useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false); + if (useExtendedBoluses != previousValue && isExtendedBoluslInProgress()) { + sExecutionService.extendedBolusStop(); + } } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java index 145c72d154..740cdc791c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java @@ -101,11 +101,13 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints @Subscribe public void onStatusEvent(final EventPreferenceChange s) { - boolean previousValue = useExtendedBoluses; - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); - useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false); - if (useExtendedBoluses != previousValue && isExtendedBoluslInProgress()) { - sExecutionService.extendedBolusStop(); + if (isEnabled(PUMP)) { + boolean previousValue = useExtendedBoluses; + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); + useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false); + if (useExtendedBoluses != previousValue && isExtendedBoluslInProgress()) { + sExecutionService.extendedBolusStop(); + } } }