Disable profile switch if not in Engineering mode and on dev branch
This commit is contained in:
parent
e38f10dba0
commit
39aae28101
2 changed files with 11 additions and 2 deletions
|
@ -201,7 +201,9 @@ public class MainApp extends Application {
|
|||
}
|
||||
}).start();
|
||||
|
||||
engineeringMode = new File(System.getProperty("EXT_FILES_DIR"),"engineering_mode").canRead();
|
||||
File engineeringModeSemaphore = new File(System.getProperty("EXT_FILES_DIR"),"engineering_mode");
|
||||
|
||||
engineeringMode = engineeringModeSemaphore.exists() && engineeringModeSemaphore.isFile();
|
||||
devBranch = BuildConfig.VERSION.contains("dev");
|
||||
|
||||
if (devBranch && !engineeringMode) {
|
||||
|
@ -374,6 +376,10 @@ public class MainApp extends Application {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static boolean isDevModeOrRelease() {
|
||||
return (devBranch && engineeringMode) || !devBranch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTerminate() {
|
||||
super.onTerminate();
|
||||
|
|
|
@ -127,7 +127,10 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
|
|||
return;
|
||||
}
|
||||
final PumpInterface pump = ConfigBuilderPlugin.getActivePump();
|
||||
if (!pump.getPumpDescription().isSetBasalProfileCapable || !pump.isInitialized() || pump.isSuspended())
|
||||
final boolean basalprofileEnabled = MainApp.isDevModeOrRelease()
|
||||
&& pump.getPumpDescription().isSetBasalProfileCapable;
|
||||
|
||||
if (!basalprofileEnabled || !pump.isInitialized() || pump.isSuspended())
|
||||
profileSwitch.setVisibility(View.GONE);
|
||||
else
|
||||
profileSwitch.setVisibility(View.VISIBLE);
|
||||
|
|
Loading…
Reference in a new issue