MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / onStart

Method onStart

Tactility/Source/service/displayidle/DisplayIdle.cpp:200–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200bool DisplayIdleService::onStart(ServiceContext& service) {
201 // Seed random number generator for varied screensaver patterns
202 srand(static_cast<unsigned int>(time(nullptr)));
203
204 cachedDisplaySettings = settings::display::loadOrGetDefault();
205
206 timer = std::make_unique<Timer>(Timer::Type::Periodic, kernel::millisToTicks(TICK_INTERVAL_MS), [this]{ this->tick(); });
207 timer->setCallbackPriority(Thread::Priority::Lower);
208 timer->start();
209 return true;
210}
211
212void DisplayIdleService::onStop(ServiceContext& service) {
213 if (timer) {

Callers

nothing calls this directly

Calls 5

tickMethod · 0.95
millisToTicksFunction · 0.85
setCallbackPriorityMethod · 0.80
loadOrGetDefaultFunction · 0.50
startMethod · 0.45

Tested by

no test coverage detected