From 675843d7f75de29adef2fa385f45540ea7789622 Mon Sep 17 00:00:00 2001 From: harshanl Date: Tue, 30 Aug 2016 15:53:07 +0530 Subject: [PATCH] Added Valid device list to Activity response --- .../core/operation/mgt/OperationManagerImpl.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 97c04c0d6a..bf09bd367c 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 @@ -185,14 +185,6 @@ public class OperationManagerImpl implements OperationManager { String deviceType) { List activityStatuses = new ArrayList<>(); ActivityStatus activityStatus; - //Add the valid DeviceIds - for (DeviceIdentifier id : deviceIdValidationResult.getValidDeviceIDList()) { - activityStatus = new ActivityStatus(); - activityStatus.setDeviceIdentifier(id); - activityStatus.setStatus(ActivityStatus.Status.PENDING); - activityStatuses.add(activityStatus); - } - //Add the invalid DeviceIds for (String id : deviceIdValidationResult.getErrorDeviceIdList()) { activityStatus = new ActivityStatus(); @@ -208,6 +200,14 @@ public class OperationManagerImpl implements OperationManager { activityStatus.setStatus(ActivityStatus.Status.UNAUTHORIZED); activityStatuses.add(activityStatus); } + + //Add the authorized DeviceIds + for (DeviceIdentifier id : deviceAuthResult.getValidDeviceIDList()) { + activityStatus = new ActivityStatus(); + activityStatus.setDeviceIdentifier(id); + activityStatus.setStatus(ActivityStatus.Status.PENDING); + activityStatuses.add(activityStatus); + } return activityStatuses; }