From a7e6b64f7033ba37769e15a1a64cd4020c64dff1 Mon Sep 17 00:00:00 2001 From: Pahansith Date: Wed, 20 Jan 2021 18:05:23 +0530 Subject: [PATCH] Fix review issues and format code --- .../core/event/config/GroupEventOperationExecutor.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/GroupEventOperationExecutor.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/GroupEventOperationExecutor.java index cef77c8675..a0e20f2e20 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/GroupEventOperationExecutor.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/event/config/GroupEventOperationExecutor.java @@ -53,7 +53,7 @@ public class GroupEventOperationExecutor implements Runnable { private static final Log log = LogFactory.getLog(GroupEventOperationExecutor.class); private final int groupId; - private final List deviceIdentifiers; + private final List deviceIdentifiers = new ArrayList<>(); private final int tenantId; private final String operationCode; private final GeoLocationProviderService geoLocationProviderService; @@ -62,7 +62,11 @@ public class GroupEventOperationExecutor implements Runnable { public GroupEventOperationExecutor(int groupId, List deviceIdentifiers, int tenantId, String operationCode) { this.groupId = groupId; - this.deviceIdentifiers = deviceIdentifiers; + for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) { + if (deviceIdentifier.getType().equalsIgnoreCase("android")) { + this.deviceIdentifiers.add(deviceIdentifier); + } + } this.tenantId = tenantId; this.operationCode = operationCode; this.geoLocationProviderService = DeviceManagementDataHolder.getInstance().getGeoLocationProviderService();