Skip to content

Commit 76fa2a1

Browse files
conditional statements were joined incorrectly, now camera popup should only appear when camera is in use AND video settings appear incorrect. (#33)
1 parent 10d44e0 commit 76fa2a1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

sensorhub-android-app/src/org/sensorhub/android/MainActivity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,10 @@ public void onClick(DialogInterface dialog, int whichButton)
450450
AndroidSensorsConfig androidSensorConfig = (AndroidSensorsConfig) sensorhubConfig.get("ANDROID_SENSORS");
451451
VideoEncoderConfig videoConfig = androidSensorConfig.videoConfig;
452452

453-
if ((androidSensorConfig.activateBackCamera || androidSensorConfig.activateFrontCamera) && videoConfig.selectedPreset < 0 || videoConfig.selectedPreset >= videoConfig.presets.length) {
453+
boolean cameraInUse = (androidSensorConfig.activateBackCamera || androidSensorConfig.activateFrontCamera);
454+
boolean improperVideoSettings = (videoConfig.selectedPreset < 0 || videoConfig.selectedPreset >= videoConfig.presets.length);
455+
456+
if (cameraInUse && improperVideoSettings) {
454457
showVideoConfigErrorPopup();
455458
newStatusMessage("Video Config Error: Check Settings");
456459
} else {

0 commit comments

Comments
 (0)