mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fixing the issue which cause policy not bieng applied to device which were enrolled before the adding the policy to the system
This commit is contained in:
parent
813f9072d8
commit
0f146e83fa
@ -32,7 +32,6 @@ import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager;
|
|||||||
import org.wso2.carbon.policy.mgt.core.mgt.impl.PolicyManagerImpl;
|
import org.wso2.carbon.policy.mgt.core.mgt.impl.PolicyManagerImpl;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -73,13 +72,13 @@ public class DelegationTask implements Task {
|
|||||||
throw new PolicyManagementException("Error occurred while taking the devices", e);
|
throw new PolicyManagementException("Error occurred while taking the devices", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HashMap<Integer, Integer> deviceIdPolicy = policyManager.getAppliedPolicyIdsDeviceIds();
|
// HashMap<Integer, Integer> deviceIdPolicy = policyManager.getAppliedPolicyIdsDeviceIds();
|
||||||
List<Device> toBeNotified = new ArrayList<>();
|
List<Device> toBeNotified = new ArrayList<>();
|
||||||
|
|
||||||
for (Device device : devices) {
|
for (Device device : devices) {
|
||||||
if (deviceIdPolicy.containsKey(device.getId())) {
|
// if (deviceIdPolicy.containsKey(device.getId())) {
|
||||||
toBeNotified.add(device);
|
toBeNotified.add(device);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
if (!toBeNotified.isEmpty()) {
|
if (!toBeNotified.isEmpty()) {
|
||||||
PolicyEnforcementDelegator enforcementDelegator = new PolicyEnforcementDelegatorImpl(toBeNotified);
|
PolicyEnforcementDelegator enforcementDelegator = new PolicyEnforcementDelegatorImpl(toBeNotified);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user