From 4a09f65b86c6520195403b7fb52f5b6d255f6227 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Tue, 3 Oct 2023 12:22:13 -0700 Subject: Respect HwTimeoutMultiplier in IptablesRestoreController On slow hardware, iptables calls may take longer than 5 seconds. Provide a way to increase the timeout in these scenarios. Change-Id: I759f6de705fa81ccaa910738869f69875d88b4ca --- server/IptablesRestoreController.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/IptablesRestoreController.cpp b/server/IptablesRestoreController.cpp index dc718309..d0aaa638 100644 --- a/server/IptablesRestoreController.cpp +++ b/server/IptablesRestoreController.cpp @@ -22,8 +22,9 @@ #include #include -#include #include +#include +#include #include #include "Controllers.h" @@ -41,7 +42,7 @@ constexpr size_t PING_SIZE = sizeof(PING) - 1; // Not compile-time constants because they are changed by the unit tests. int IptablesRestoreController::MAX_RETRIES = 50; -int IptablesRestoreController::POLL_TIMEOUT_MS = 100; +int IptablesRestoreController::POLL_TIMEOUT_MS = 100 * android::base::HwTimeoutMultiplier(); class IptablesProcess { public: -- cgit v1.2.3