Skip to content

Commit

Permalink
conditional statements were joined incorrectly, now camera popup shou…
Browse files Browse the repository at this point in the history
…ld only appear when camera is in use AND video settings appear incorrect. (#33)
  • Loading branch information
ChainReaction31 authored Sep 15, 2021
1 parent 10d44e0 commit 76fa2a1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,10 @@ public void onClick(DialogInterface dialog, int whichButton)
AndroidSensorsConfig androidSensorConfig = (AndroidSensorsConfig) sensorhubConfig.get("ANDROID_SENSORS");
VideoEncoderConfig videoConfig = androidSensorConfig.videoConfig;

if ((androidSensorConfig.activateBackCamera || androidSensorConfig.activateFrontCamera) && videoConfig.selectedPreset < 0 || videoConfig.selectedPreset >= videoConfig.presets.length) {
boolean cameraInUse = (androidSensorConfig.activateBackCamera || androidSensorConfig.activateFrontCamera);
boolean improperVideoSettings = (videoConfig.selectedPreset < 0 || videoConfig.selectedPreset >= videoConfig.presets.length);

if (cameraInUse && improperVideoSettings) {
showVideoConfigErrorPopup();
newStatusMessage("Video Config Error: Check Settings");
} else {
Expand Down

0 comments on commit 76fa2a1

Please sign in to comment.