propertywatch: Add ignore_start_callback config

Add an optional `ignore_start_callback` config to indicate if the
callback shall be ignored on start.

By default the callbacks in property watch are called on start.
There are cases where we do not want such behavior and only expect
callbacks on property changes.

Add the `ignore_start_callback` so that we could config a watch to not
trigger the start callback.

Tested: Verify the callback is not called if the watch config has
        `ignore_start_callback: true`

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I7e5887cc8b0d0775d9b3d689f1511250667aaa5b
diff --git a/src/propertywatch.hpp b/src/propertywatch.hpp
index 84b6af7..8a3c07b 100644
--- a/src/propertywatch.hpp
+++ b/src/propertywatch.hpp
@@ -39,9 +39,11 @@
     PropertyWatch& operator=(PropertyWatch&&) = default;
     virtual ~PropertyWatch() = default;
     PropertyWatch(const PropertyIndex& watchIndex,
+                  bool ignoreStartCallback = false,
                   Callback* callback = nullptr) :
         Watch(),
-        index(watchIndex), cb(callback), alreadyRan(false)
+        index(watchIndex), cb(callback), alreadyRan(false),
+        ignoreStartCallback(ignoreStartCallback)
     {
     }
 
@@ -101,6 +103,9 @@
 
     /** @brief The start method should only be invoked once. */
     bool alreadyRan;
+
+    /** @brief Ignore callback on start */
+    bool ignoreStartCallback;
 };
 
 /** @class PropertyWatchOfType
@@ -120,14 +125,18 @@
     PropertyWatchOfType& operator=(PropertyWatchOfType&&) = default;
     ~PropertyWatchOfType() = default;
     PropertyWatchOfType(const PropertyIndex& watchIndex, Callback& callback,
+                        bool ignoreStartCallback = false,
                         Filters* filterOps = nullptr) :
-        PropertyWatch<DBusInterfaceType>(watchIndex, &callback),
+        PropertyWatch<DBusInterfaceType>(watchIndex, ignoreStartCallback,
+                                         &callback),
         filterOps(filterOps)
     {
     }
     PropertyWatchOfType(const PropertyIndex& watchIndex,
+                        bool ignoreStartCallback = false,
                         Filters* filterOps = nullptr) :
-        PropertyWatch<DBusInterfaceType>(watchIndex, nullptr),
+        PropertyWatch<DBusInterfaceType>(watchIndex, ignoreStartCallback,
+                                         nullptr),
         filterOps(filterOps)
     {
     }