check if plugin is enabled before accepting message
This commit is contained in:
parent
064de0f64e
commit
f75c2f8f91
2 changed files with 14 additions and 10 deletions
|
@ -102,11 +102,13 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onStatusEvent(final EventPreferenceChange s) {
|
public void onStatusEvent(final EventPreferenceChange s) {
|
||||||
boolean previousValue = useExtendedBoluses;
|
if (isEnabled(PUMP)) {
|
||||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
boolean previousValue = useExtendedBoluses;
|
||||||
useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false);
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
||||||
if (useExtendedBoluses != previousValue && isExtendedBoluslInProgress()) {
|
useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false);
|
||||||
sExecutionService.extendedBolusStop();
|
if (useExtendedBoluses != previousValue && isExtendedBoluslInProgress()) {
|
||||||
|
sExecutionService.extendedBolusStop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,11 +101,13 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onStatusEvent(final EventPreferenceChange s) {
|
public void onStatusEvent(final EventPreferenceChange s) {
|
||||||
boolean previousValue = useExtendedBoluses;
|
if (isEnabled(PUMP)) {
|
||||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
boolean previousValue = useExtendedBoluses;
|
||||||
useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false);
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
||||||
if (useExtendedBoluses != previousValue && isExtendedBoluslInProgress()) {
|
useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false);
|
||||||
sExecutionService.extendedBolusStop();
|
if (useExtendedBoluses != previousValue && isExtendedBoluslInProgress()) {
|
||||||
|
sExecutionService.extendedBolusStop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue