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 ...@@ -265,10 +265,17 @@ public class PacketManager
265 @Override 265 @Override
266 public void event(DeviceEvent event) { 266 public void event(DeviceEvent event) {
267 Device device = event.subject(); 267 Device device = event.subject();
268 - if (event.type() == DeviceEvent.Type.DEVICE_ADDED) { 268 + switch (event.type()) {
269 - for (PacketRequest request : store.existingRequests()) { 269 + case DEVICE_ADDED:
270 - pushRule(device, request); 270 + case DEVICE_AVAILABILITY_CHANGED:
271 - } 271 + if (deviceService.isAvailable(event.subject().id())) {
272 + for (PacketRequest request : store.existingRequests()) {
273 + pushRule(device, request);
274 + }
275 + }
276 + break;
277 + default:
278 + break;
272 } 279 }
273 } 280 }
274 } 281 }
......