Ignore DEVICE_ADDED event while availability is false

For p4 devices, the device will be added but unavailable at the beginning.
The device will later on being marked as available once the pipeline is pushed
to the device.

Change-Id: I186ddfbf34cfc1e80493248a123bd2931e7c6729
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index 19b0304..08d18ab 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -1307,6 +1307,13 @@
                                  event.type(), ((Device) event.subject()).id());
                         processDeviceAdded((Device) event.subject());
                     } else {
+                        if (event.type() == DeviceEvent.Type.DEVICE_ADDED) {
+                            // Note: For p4 devices, the device will be added but unavailable at the beginning.
+                            //       The device will later on being marked as available once the pipeline is pushed
+                            //       to the device.
+                            log.info("** DEVICE ADDED but unavailable. Ignore");
+                            return;
+                        }
                         log.info(" ** DEVICE DOWN Processing device event {}"
                                 + " for unavailable device {}",
                                  event.type(), ((Device) event.subject()).id());