Disallow profile store on pump if on dev branch but not in engineering mode

This commit is contained in:
Markus M. May 2018-03-15 23:00:08 +01:00
parent 39aae28101
commit 2c3f28670c
4 changed files with 10 additions and 2 deletions

View file

@ -135,7 +135,6 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
else else
profileSwitch.setVisibility(View.VISIBLE); profileSwitch.setVisibility(View.VISIBLE);
if (!pump.getPumpDescription().isExtendedBolusCapable || !pump.isInitialized() || pump.isSuspended() || pump.isFakingTempsByExtendedBoluses()) { if (!pump.getPumpDescription().isExtendedBolusCapable || !pump.isInitialized() || pump.isSuspended() || pump.isFakingTempsByExtendedBoluses()) {
extendedBolus.setVisibility(View.GONE); extendedBolus.setVisibility(View.GONE);
extendedBolusCancel.setVisibility(View.GONE); extendedBolusCancel.setVisibility(View.GONE);

View file

@ -59,6 +59,7 @@ public class Notification {
public static final int MINIMAL_BASAL_VALUE_REPLACED = 29; public static final int MINIMAL_BASAL_VALUE_REPLACED = 29;
public static final int BASAL_PROFILE_NOT_ALIGNED_TO_HOURS = 30; public static final int BASAL_PROFILE_NOT_ALIGNED_TO_HOURS = 30;
public static final int ZERO_VALUE_IN_PROFILE = 31; public static final int ZERO_VALUE_IN_PROFILE = 31;
public static final int NOT_ENG_MODE_OR_RELEASE = 32;
public int id; public int id;
public Date date; public Date date;

View file

@ -293,6 +293,14 @@ public class CommandQueue {
return false; return false;
} }
if (!MainApp.isDevModeOrRelease()) {
Notification notification = new Notification(Notification.NOT_ENG_MODE_OR_RELEASE, MainApp.sResources.getString(R.string.not_eng_mode_or_release), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
if (callback != null)
callback.result(new PumpEnactResult().success(false).comment(MainApp.sResources.getString(R.string.not_eng_mode_or_release))).run();
return false;
}
// Compare with pump limits // Compare with pump limits
Profile.BasalValue[] basalValues = profile.getBasalValues(); Profile.BasalValue[] basalValues = profile.getBasalValues();
PumpInterface pump = ConfigBuilderPlugin.getActivePump(); PumpInterface pump = ConfigBuilderPlugin.getActivePump();

View file

@ -971,7 +971,6 @@
<string name="fabric_upload">Fabric Upload</string> <string name="fabric_upload">Fabric Upload</string>
<string name="allow_automated_crash_reporting">Allow automated crash reporting and feature usage data to be sent to the developers via the fabric.io service.</string> <string name="allow_automated_crash_reporting">Allow automated crash reporting and feature usage data to be sent to the developers via the fabric.io service.</string>
<string name="g5appnotdetected">Please update your G5 app to supported version</string> <string name="g5appnotdetected">Please update your G5 app to supported version</string>
<string name="suspendloopfor30min">Suspend for 30 min</string> <string name="suspendloopfor30min">Suspend for 30 min</string>
<string name="start_activity_tt">Start Activity TT</string> <string name="start_activity_tt">Start Activity TT</string>
<string name="start_eating_soon_tt">Start Eating soon TT</string> <string name="start_eating_soon_tt">Start Eating soon TT</string>
@ -984,5 +983,6 @@
<string name="key_ns_autobackfill" translatable="false">ns_autobackfill</string> <string name="key_ns_autobackfill" translatable="false">ns_autobackfill</string>
<string name="closed_loop_disabled_on_dev_branch">Running dev version. Closed loop is disabled</string> <string name="closed_loop_disabled_on_dev_branch">Running dev version. Closed loop is disabled</string>
<string name="engineering_mode_enabled">Engineering mode enabled</string> <string name="engineering_mode_enabled">Engineering mode enabled</string>
<string name="not_eng_mode_or_release">Engineering mode not enabled and not on release branch</string>
</resources> </resources>