Rename method to reflect jomoto code review
This commit is contained in:
parent
18521d6634
commit
f0bec534fa
5 changed files with 6 additions and 7 deletions
|
@ -208,7 +208,7 @@ public class MainApp extends Application {
|
||||||
engineeringMode = engineeringModeSemaphore.exists() && engineeringModeSemaphore.isFile();
|
engineeringMode = engineeringModeSemaphore.exists() && engineeringModeSemaphore.isFile();
|
||||||
devBranch = BuildConfig.VERSION.contains("dev");
|
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);
|
Notification n = new Notification(Notification.TOAST_ALARM, gs(R.string.closed_loop_disabled_on_dev_branch), Notification.NORMAL);
|
||||||
bus().post(new EventNewNotification(n));
|
bus().post(new EventNewNotification(n));
|
||||||
}
|
}
|
||||||
|
@ -378,7 +378,7 @@ public class MainApp extends Application {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDevModeOrRelease() {
|
public static boolean isEngineeringModeOrRelease() {
|
||||||
return engineeringMode || !devBranch;
|
return engineeringMode || !devBranch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final PumpInterface pump = ConfigBuilderPlugin.getActivePump();
|
final PumpInterface pump = ConfigBuilderPlugin.getActivePump();
|
||||||
final boolean basalprofileEnabled = MainApp.isDevModeOrRelease()
|
final boolean basalprofileEnabled = MainApp.isEngineeringModeOrRelease()
|
||||||
&& pump.getPumpDescription().isSetBasalProfileCapable;
|
&& pump.getPumpDescription().isSetBasalProfileCapable;
|
||||||
|
|
||||||
if (!basalprofileEnabled || !pump.isInitialized() || pump.isSuspended())
|
if (!basalprofileEnabled || !pump.isInitialized() || pump.isSuspended())
|
||||||
|
|
|
@ -102,7 +102,7 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface {
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public boolean isClosedModeEnabled() {
|
public boolean isClosedModeEnabled() {
|
||||||
if (!MainApp.isDevModeOrRelease()) return false;
|
if (!MainApp.isEngineeringModeOrRelease()) return false;
|
||||||
String mode = SP.getString("aps_mode", "open");
|
String mode = SP.getString("aps_mode", "open");
|
||||||
return mode.equals("closed") && BuildConfig.CLOSEDLOOP;
|
return mode.equals("closed") && BuildConfig.CLOSEDLOOP;
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,7 +293,7 @@ public class CommandQueue {
|
||||||
return false;
|
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);
|
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));
|
MainApp.bus().post(new EventNewNotification(notification));
|
||||||
if (callback != null)
|
if (callback != null)
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package info.nightscout.androidaps.queue;
|
package info.nightscout.androidaps.queue;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.Html;
|
|
||||||
|
|
||||||
import com.squareup.otto.Bus;
|
import com.squareup.otto.Bus;
|
||||||
import com.squareup.otto.ThreadEnforcer;
|
import com.squareup.otto.ThreadEnforcer;
|
||||||
|
@ -115,7 +114,7 @@ public class CommandQueueTest extends CommandQueue {
|
||||||
PowerMockito.mockStatic(MainApp.class);
|
PowerMockito.mockStatic(MainApp.class);
|
||||||
MainApp mainApp = mock(MainApp.class);
|
MainApp mainApp = mock(MainApp.class);
|
||||||
when(MainApp.getConfigBuilder()).thenReturn(configBuilderPlugin);
|
when(MainApp.getConfigBuilder()).thenReturn(configBuilderPlugin);
|
||||||
when(MainApp.isDevModeOrRelease()).thenReturn(true);
|
when(MainApp.isEngineeringModeOrRelease()).thenReturn(true);
|
||||||
when(MainApp.instance()).thenReturn(mainApp);
|
when(MainApp.instance()).thenReturn(mainApp);
|
||||||
|
|
||||||
PowerMockito.mockStatic(ToastUtils.class);
|
PowerMockito.mockStatic(ToastUtils.class);
|
||||||
|
|
Loading…
Reference in a new issue