From 101900068251e1e1330ec6f066c13bb2dd9d8b4e Mon Sep 17 00:00:00 2001 From: C Freeman Date: Mon, 25 Sep 2023 14:50:31 -0400 Subject: [PATCH] Timesync: Force call to delegate so we get time source (#29440) --- .../time-synchronization-server.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp index a20fbac65ade54..83f249fde66c12 100644 --- a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp +++ b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp @@ -466,13 +466,10 @@ void TimeSynchronizationServer::Init() { ClearDSTOffset(); } - System::Clock::Microseconds64 utcTime; - if (System::SystemClock().GetClock_RealTime(utcTime) == CHIP_NO_ERROR && - !RuntimeOptionsProvider::Instance().GetSimulateNoInternalTime()) - { - mGranularity = GranularityEnum::kMinutesGranularity; - } + // Set the granularity to none for now - this will force us to go to the delegate so it can + // properly report the time source + mGranularity = GranularityEnum::kNoTimeGranularity; // This can error, but it's not clear what should happen in this case. For now, just ignore it because we still // want time sync even if we can't register the deletgate here.