From ba24c1a03e10343e5f8b7c5f6d34934ece7e45bd Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Wed, 28 Aug 2019 13:06:22 +0530 Subject: [PATCH] Fix ent.app install issue when installing via roles --- .../mdm/osgiconnector/ApplicationOperationsImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java index 25dbe42421..5977deeb3d 100644 --- a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java +++ b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java @@ -109,8 +109,13 @@ public class ApplicationOperationsImpl implements ApplicationOperations { .getDeviceManagementService(applicationOperationAction.getTenantId()). getAllDevicesOfRole(userRole); for (org.wso2.carbon.device.mgt.common.Device device : deviceList) { - if (MDMAppConstants.ACTIVE.equalsIgnoreCase(device.getEnrolmentInfo().getStatus().toString())) { - deviceIdentifiers.add(getDeviceIdentifierByDevice(device)); + if (MDMAppConstants.WEBAPP.equals(applicationOperationAction.getApp().getPlatform()) + || applicationOperationAction.getApp().getPlatform() + .equalsIgnoreCase(device.getType())) { + if (MDMAppConstants.ACTIVE + .equalsIgnoreCase(device.getEnrolmentInfo().getStatus().toString())) { + deviceIdentifiers.add(getDeviceIdentifierByDevice(device)); + } } } }