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/manager.hpp b/manager.hpp
index e84652c..3256f59 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include "config.h"
#include "types.hpp"
#include "property_change_listener.hpp"
#include "settings.hpp"
@@ -64,10 +65,10 @@
std::string requestedOwner;
/** @brief The current time mode */
- Mode timeMode;
+ Mode timeMode = DEFAULT_TIME_MODE;
/** @brief The current time owner */
- Owner timeOwner;
+ Owner timeOwner = DEFAULT_TIME_OWNER;
/** @brief Restore saved settings */
void restoreSettings();