From a9ca9cf352a554094c82a403ef440e1c5693b18b Mon Sep 17 00:00:00 2001 From: inoshperera Date: Mon, 28 Nov 2016 22:36:48 +0530 Subject: [PATCH] adding a fix for web app user retrival. --- .../ApplicationOperationsImpl.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 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 8ac07ce4c..fac72c893 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 @@ -234,12 +234,21 @@ public class ApplicationOperationsImpl implements ApplicationOperations { throws MobileApplicationException { List devices; + List deviceList = null; try { - List deviceList = MDMServiceAPIUtils - .getDeviceManagementService(applicationOperationDevice.getTenantId()). - getDevicesOfUser( - applicationOperationDevice.getCurrentUser().getUsername(), - applicationOperationDevice.getPlatform()); + if(MDMAppConstants.WEBAPP.equals + (applicationOperationDevice.getPlatform())) { + deviceList = MDMServiceAPIUtils + .getDeviceManagementService(applicationOperationDevice.getTenantId()). + getDevicesOfUser( + applicationOperationDevice.getCurrentUser().getUsername()); + } else { + deviceList = MDMServiceAPIUtils + .getDeviceManagementService(applicationOperationDevice.getTenantId()). + getDevicesOfUser( + applicationOperationDevice.getCurrentUser().getUsername(), + applicationOperationDevice.getPlatform()); + } devices = new ArrayList<>(deviceList.size()); if(log.isDebugEnabled()){ log.debug("device list got from mdm "+ deviceList.toString());