diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index 620d26bd8a..d9473b3575 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -208,7 +208,7 @@ public class MainApp extends Application { engineeringMode = engineeringModeSemaphore.exists() && engineeringModeSemaphore.isFile(); devBranch = BuildConfig.VERSION.contains("dev"); - if (!isDevModeOrRelease()) { + if (!isEngineeringModeOrRelease()) { Notification n = new Notification(Notification.TOAST_ALARM, gs(R.string.closed_loop_disabled_on_dev_branch), Notification.NORMAL); bus().post(new EventNewNotification(n)); } @@ -378,7 +378,7 @@ public class MainApp extends Application { return null; } - public static boolean isDevModeOrRelease() { + public static boolean isEngineeringModeOrRelease() { return engineeringMode || !devBranch; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java index 12c24b1595..8bc79e3ddc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java @@ -127,7 +127,7 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL return; } final PumpInterface pump = ConfigBuilderPlugin.getActivePump(); - final boolean basalprofileEnabled = MainApp.isDevModeOrRelease() + final boolean basalprofileEnabled = MainApp.isEngineeringModeOrRelease() && pump.getPumpDescription().isSetBasalProfileCapable; if (!basalprofileEnabled || !pump.isInitialized() || pump.isSuspended()) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java index 7686d76cc9..41a7c1eb00 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java @@ -102,7 +102,7 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface { **/ @Override public boolean isClosedModeEnabled() { - if (!MainApp.isDevModeOrRelease()) return false; + if (!MainApp.isEngineeringModeOrRelease()) return false; String mode = SP.getString("aps_mode", "open"); return mode.equals("closed") && BuildConfig.CLOSEDLOOP; } diff --git a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java index b3feea3751..a254855cab 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java +++ b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java @@ -293,7 +293,7 @@ public class CommandQueue { return false; } - if (!MainApp.isDevModeOrRelease()) { + if (!MainApp.isEngineeringModeOrRelease()) { 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) diff --git a/app/src/test/java/info/nightscout/androidaps/queue/CommandQueueTest.java b/app/src/test/java/info/nightscout/androidaps/queue/CommandQueueTest.java index ec9bd6ab08..f7064c80a8 100644 --- a/app/src/test/java/info/nightscout/androidaps/queue/CommandQueueTest.java +++ b/app/src/test/java/info/nightscout/androidaps/queue/CommandQueueTest.java @@ -1,7 +1,6 @@ package info.nightscout.androidaps.queue; import android.content.Context; -import android.text.Html; import com.squareup.otto.Bus; import com.squareup.otto.ThreadEnforcer; @@ -115,7 +114,7 @@ public class CommandQueueTest extends CommandQueue { PowerMockito.mockStatic(MainApp.class); MainApp mainApp = mock(MainApp.class); when(MainApp.getConfigBuilder()).thenReturn(configBuilderPlugin); - when(MainApp.isDevModeOrRelease()).thenReturn(true); + when(MainApp.isEngineeringModeOrRelease()).thenReturn(true); when(MainApp.instance()).thenReturn(mainApp); PowerMockito.mockStatic(ToastUtils.class);