From c36681baac027a0dc7c28c99d0b24302366625c2 Mon Sep 17 00:00:00 2001 From: inoshperera Date: Mon, 28 Nov 2016 16:18:46 +0530 Subject: [PATCH] Fixing the issue of duplicate application operations being set to the same device. --- .../mdm/osgiconnector/ApplicationOperationsImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/extensions/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java b/components/extensions/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java index b0a5ea3f1e..8ac07ce4c1 100644 --- a/components/extensions/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java +++ b/components/extensions/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java @@ -75,7 +75,10 @@ public class ApplicationOperationsImpl implements ApplicationOperations { for (org.wso2.carbon.device.mgt.common.Device device : deviceList) { if(MDMAppConstants.WEBAPP.equals(applicationOperationAction.getApp().getPlatform()) || applicationOperationAction.getApp().getPlatform().equalsIgnoreCase(device.getType())){ - deviceIdentifiers.add(getDeviceIdentifierByDevice(device)); + if (MDMAppConstants.ACTIVE.equalsIgnoreCase(device.getEnrolmentInfo(). + getStatus().toString())) { + deviceIdentifiers.add(getDeviceIdentifierByDevice(device)); + } } } } @@ -96,7 +99,9 @@ public class ApplicationOperationsImpl implements ApplicationOperations { getAllDevicesOfRole(userRole); for (org.wso2.carbon.device.mgt.common.Device device : deviceList) { - deviceIdentifiers.add(getDeviceIdentifierByDevice(device)); + if (MDMAppConstants.ACTIVE.equalsIgnoreCase(device.getEnrolmentInfo().getStatus().toString())) { + deviceIdentifiers.add(getDeviceIdentifierByDevice(device)); + } } } } catch (DeviceManagementException devMgtEx) {