Simplify logic in device status

Arshana 4 weeks ago
parent ccacc44d9a
commit 4dd1e1b17e

@ -3498,7 +3498,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
throws MetadataManagementException, DeviceManagementDAOException { throws MetadataManagementException, DeviceManagementDAOException {
boolean isEnableDeviceStatusCheck = deviceStatusManagementService.getDeviceStatusCheck(tenantId); boolean isEnableDeviceStatusCheck = deviceStatusManagementService.getDeviceStatusCheck(tenantId);
boolean isValidState = deviceStatusManagementService.isDeviceStatusValid(type, enrolmentInfo.getStatus().name(), tenantId); boolean isValidState = deviceStatusManagementService.isDeviceStatusValid(type, enrolmentInfo.getStatus().name(), tenantId);
if (updatedRows == 1 && (!isEnableDeviceStatusCheck || (isEnableDeviceStatusCheck && isValidState))) { if (updatedRows == 1 && (!isEnableDeviceStatusCheck || isValidState)) {
enrollmentDAO.addDeviceStatus(enrolmentInfo.getId(), enrolmentInfo.getStatus()); enrollmentDAO.addDeviceStatus(enrolmentInfo.getId(), enrolmentInfo.getStatus());
} }
} }

Loading…
Cancel
Save