Merge pull request #1131 from charithag/master

Fixed https://github.com/wso2/product-iots/issues/1523
revert-70aa11f8
Ruwan 7 years ago committed by GitHub
commit c93b53f453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,6 +22,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.ntask.core.Task;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
@ -75,7 +76,10 @@ public class DelegationTask implements Task {
//HashMap<Integer, Integer> deviceIdPolicy = policyManager.getAppliedPolicyIdsDeviceIds();
for (Device device : devices) {
// if (deviceIdPolicy.containsKey(device.getId())) {
if (device != null && device.getEnrolmentInfo() != null
&& device.getEnrolmentInfo().getStatus() != EnrolmentInfo.Status.REMOVED) {
toBeNotified.add(device);
}
// }
}
if (!toBeNotified.isEmpty()) {

Loading…
Cancel
Save