sangho
Committed by Gerrit Code Review

Pushes the flow rules also when devices are available (with DEVICE_AVAILABLLITY_CHANGED event).

Change-Id: Ia92df8c5da5828a9db2492e93a42bfd9a5136d25
......@@ -265,10 +265,17 @@ public class PacketManager
@Override
public void event(DeviceEvent event) {
Device device = event.subject();
if (event.type() == DeviceEvent.Type.DEVICE_ADDED) {
for (PacketRequest request : store.existingRequests()) {
pushRule(device, request);
}
switch (event.type()) {
case DEVICE_ADDED:
case DEVICE_AVAILABILITY_CHANGED:
if (deviceService.isAvailable(event.subject().id())) {
for (PacketRequest request : store.existingRequests()) {
pushRule(device, request);
}
}
break;
default:
break;
}
}
}
......