Merge remote-tracking branch 'origin/dev' into combo-scripter-v2

* origin/dev:
  Remove missed reference to pref in NSProfilePlugin.
  Remove 'sync to profile' pref.

# Conflicts:
#	app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfilePlugin.java
This commit is contained in:
Johannes Mockenhaupt 2017-12-20 13:28:41 +01:00
commit a3db2136e1
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 10 additions and 12 deletions

View file

@ -120,19 +120,17 @@ public class NSProfilePlugin implements PluginBase, ProfileInterface {
profile = new ProfileStore(newProfile.getData());
storeNSProfile();
MainApp.bus().post(new EventNSProfileUpdateGUI());
if (SP.getBoolean(R.string.key_sync_profile_to_pump, false)) {
ConfigBuilderPlugin.getCommandQueue().setProfile(MainApp.getConfigBuilder().getProfile(), new Callback() {
@Override
public void run() {
if (result.enacted) {
SmsCommunicatorPlugin smsCommunicatorPlugin = MainApp.getSpecificPlugin(SmsCommunicatorPlugin.class);
if (smsCommunicatorPlugin != null && smsCommunicatorPlugin.isEnabled(PluginBase.GENERAL)) {
smsCommunicatorPlugin.sendNotificationToAllNumbers(MainApp.sResources.getString(R.string.profile_set_ok));
}
ConfigBuilderPlugin.getCommandQueue().setProfile(MainApp.getConfigBuilder().getProfile(), new Callback() {
@Override
public void run() {
if (result.enacted) {
SmsCommunicatorPlugin smsCommunicatorPlugin = MainApp.getSpecificPlugin(SmsCommunicatorPlugin.class);
if (smsCommunicatorPlugin != null && smsCommunicatorPlugin.isEnabled(PluginBase.GENERAL)) {
smsCommunicatorPlugin.sendNotificationToAllNumbers(MainApp.sResources.getString(R.string.profile_set_ok));
}
}
});
}
}
});
}
private static void storeNSProfile() {

View file

@ -59,7 +59,7 @@ public class KeepAliveReceiver extends BroadcastReceiver {
LocalAlertUtils.checkPumpUnreachableAlarm(lastConnection, isStatusOutdated);
if (SP.getBoolean("syncprofiletopump", false) && !pump.isThisProfileSet(profile)) {
if (!pump.isThisProfileSet(profile)) {
MainApp.getConfigBuilder().getCommandQueue().setProfile(profile, null);
} else if (isStatusOutdated && !pump.isBusy()) {
MainApp.getConfigBuilder().getCommandQueue().readStatus("KeepAlive. Status outdated.", null);