From 74a3b0e3460d844dc4fcbd52403921d2d8e5f674 Mon Sep 17 00:00:00 2001 From: harshanl Date: Tue, 3 Nov 2015 18:58:52 +0530 Subject: [PATCH] Fixed EMM-910 --- .../mgt/core/service/DeviceManagementProviderServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 054e4c5e3b..979adf852f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -144,7 +144,9 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv this.modifyEnrollment(device); status = true; } else { - this.setStatus(deviceIdentifier, existingEnrolmentInfo.getOwner(), EnrolmentInfo.Status.INACTIVE); + if (!EnrolmentInfo.Status.REMOVED.equals(existingEnrolmentInfo.getStatus())) { + this.setStatus(deviceIdentifier, existingEnrolmentInfo.getOwner(), EnrolmentInfo.Status.INACTIVE); + } int enrolmentId; try { DeviceManagementDAOFactory.beginTransaction();