Committed by
Gerrit Code Review
Pushes the flow rules also when devices are available (with DEVICE_AVAILABLLITY_CHANGED event).
Change-Id: Ia92df8c5da5828a9db2492e93a42bfd9a5136d25
Showing
1 changed file
with
8 additions
and
1 deletions
... | @@ -265,11 +265,18 @@ public class PacketManager | ... | @@ -265,11 +265,18 @@ 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 | + case DEVICE_ADDED: | ||
270 | + case DEVICE_AVAILABILITY_CHANGED: | ||
271 | + if (deviceService.isAvailable(event.subject().id())) { | ||
269 | for (PacketRequest request : store.existingRequests()) { | 272 | for (PacketRequest request : store.existingRequests()) { |
270 | pushRule(device, request); | 273 | pushRule(device, request); |
271 | } | 274 | } |
272 | } | 275 | } |
276 | + break; | ||
277 | + default: | ||
278 | + break; | ||
279 | + } | ||
273 | } | 280 | } |
274 | } | 281 | } |
275 | 282 | ... | ... |
-
Please register or login to post a comment