Modify thresholds for crashing from missing sensors
Modifies timeout for SEE coming online from 60 to 30 seconds while
increasing the time we allow a crash from missing sensors to always be
15 seconds beyond whatever the SEE timeout is.
Bug: 131330968
Test: compile
Change-Id: Id0262d86245c183bff4381737d075619aaf71fbb
diff --git a/platform/slpi/include/chre/platform/slpi/see/see_helper.h b/platform/slpi/include/chre/platform/slpi/see/see_helper.h
index c9f7218..01bd5ee 100644
--- a/platform/slpi/include/chre/platform/slpi/see/see_helper.h
+++ b/platform/slpi/include/chre/platform/slpi/see/see_helper.h
@@ -81,7 +81,7 @@
//! Default timeout for waitForService. Have a longer timeout since there may be
//! external dependencies blocking SEE initialization.
-constexpr Nanoseconds kDefaultSeeWaitTimeout = Seconds(60);
+constexpr Nanoseconds kDefaultSeeWaitTimeout = Seconds(30);
//! Default timeout for sendReq response
constexpr Nanoseconds kDefaultSeeRespTimeout = Seconds(1);
diff --git a/platform/slpi/see/platform_sensor.cc b/platform/slpi/see/platform_sensor.cc
index 16b6639..75e0dd7 100644
--- a/platform/slpi/see/platform_sensor.cc
+++ b/platform/slpi/see/platform_sensor.cc
@@ -153,11 +153,12 @@
void handleMissingSensor() {
// Try rebooting if a sensor is missing, which might help recover from a
// transient failure/race condition at startup. But to avoid endless crashes,
- // only do this within the first 45 seconds after boot - we rely on knowledge
- // that getMonotonicTime() maps into QTimer here, and QTimer only resets when
- // the entire system is rebooted (it continues increasing after SLPI SSR).
+ // only do this within 15 seconds of the timeout on initializing SEE - we rely
+ // on knowledge that getMonotonicTime() maps into QTimer here, and QTimer only
+ // resets when the entire system is rebooted (it continues increasing after
+ // SLPI SSR).
#ifndef CHRE_LOG_ONLY_NO_SENSOR
- if (SystemTime::getMonotonicTime() < Seconds(45)) {
+ if (SystemTime::getMonotonicTime() < (kDefaultSeeWaitTimeout + Seconds(15))) {
FATAL_ERROR("Missing required sensor(s)");
} else
#endif