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,6 +102,7 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onStatusEvent(final EventPreferenceChange s) {
|
public void onStatusEvent(final EventPreferenceChange s) {
|
||||||
|
if (isEnabled(PUMP)) {
|
||||||
boolean previousValue = useExtendedBoluses;
|
boolean previousValue = useExtendedBoluses;
|
||||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
||||||
useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false);
|
useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false);
|
||||||
|
@ -109,6 +110,7 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
sExecutionService.extendedBolusStop();
|
sExecutionService.extendedBolusStop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Plugin base interface
|
// Plugin base interface
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -101,6 +101,7 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onStatusEvent(final EventPreferenceChange s) {
|
public void onStatusEvent(final EventPreferenceChange s) {
|
||||||
|
if (isEnabled(PUMP)) {
|
||||||
boolean previousValue = useExtendedBoluses;
|
boolean previousValue = useExtendedBoluses;
|
||||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
||||||
useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false);
|
useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false);
|
||||||
|
@ -108,6 +109,7 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
|
||||||
sExecutionService.extendedBolusStop();
|
sExecutionService.extendedBolusStop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Plugin base interface
|
// Plugin base interface
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue