Fix un-initialized time owner/mode in manager
The timeOwner/Mode in Manager class has no init value, and it is
initialized with the cached time owner/mode in file system.
In most of time it is OK because there is cached time owner/mode.
But if the BMC does a factory reset, the cached values are cleaned up,
and in next reboot the timeOwner/Mode will not be initialized at all.
The fix is to give default time owner/mode, so when BMC comes from
factory reset it uses default time settings.
Tested: Verify the timeOwner/Mode have correct init values after factory
reset.
Change-Id: Ib1a8fba4d758f33ed09a7afdc9ed684867fca1c5
diff --git a/epoch_base.hpp b/epoch_base.hpp
index 4f23d51..79aca90 100644
--- a/epoch_base.hpp
+++ b/epoch_base.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include "config.h"
#include "property_change_listener.hpp"
#include <sdbusplus/bus.hpp>
@@ -38,10 +39,10 @@
sdbusplus::bus::bus& bus;
/** @brief The current time mode */
- Mode timeMode = Mode::Manual;
+ Mode timeMode = DEFAULT_TIME_MODE;
/** @brief The current time owner */
- Owner timeOwner = Owner::Both;
+ Owner timeOwner = DEFAULT_TIME_OWNER;
/** @brief Set current time to system
*