From 672de3a09e464bf0ff5244bd4106799e91a8b2fd Mon Sep 17 00:00:00 2001 From: harshanl Date: Mon, 3 Oct 2016 14:57:46 +0530 Subject: [PATCH] Device status change fix for iOS --- .../mgt/core/operation/mgt/OperationManagerImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 284a3bc8922..5fc20e67d83 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -431,6 +431,18 @@ public class OperationManagerImpl implements OperationManager { "Identifier:" + deviceId.getId() + " and given type" + deviceId.getType()); } + int enrolmentId = enrolmentInfo.getId(); + //Changing the enrollment status & attempt count if the device is marked as inactive or unreachable + switch (enrolmentInfo.getStatus()) { + case ACTIVE: + this.resetAttemptCount(enrolmentId); + break; + case INACTIVE: + case UNREACHABLE: + this.resetAttemptCount(enrolmentId); + this.setEnrolmentStatus(enrolmentId, EnrolmentInfo.Status.ACTIVE); + break; + } try { OperationManagementDAOFactory.openConnection();