From c34dc0ee114b0e292fa68a93e5d82b8dfcf038dd Mon Sep 17 00:00:00 2001 From: Olivier Gaillard Date: Thu, 6 Jul 2023 15:53:59 +0000 Subject: [PATCH] Allow smaller watchdog timeouts for user debug builds to detect more regressions. Change-Id: I47f48e9a4fa89cfa31968a73f37f9ec76e21f580 Bug: 209932320 --- services/core/java/com/android/server/Watchdog.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/Watchdog.java b/services/core/java/com/android/server/Watchdog.java index 48de441806c1e..6baae4b393740 100644 --- a/services/core/java/com/android/server/Watchdog.java +++ b/services/core/java/com/android/server/Watchdog.java @@ -453,7 +453,7 @@ public class Watchdog implements Dumpable { mInterestingJavaPids.add(Process.myPid()); // See the notes on DEFAULT_TIMEOUT. - assert DB || + assert DB || Build.IS_USERDEBUG || DEFAULT_TIMEOUT > ZygoteConnectionConstants.WRAPPED_PID_TIMEOUT_MILLIS; mTraceErrorLogger = new TraceErrorLogger(); @@ -527,7 +527,8 @@ public class Watchdog implements Dumpable { */ void updateWatchdogTimeout(long timeoutMillis) { // See the notes on DEFAULT_TIMEOUT. - if (!DB && timeoutMillis <= ZygoteConnectionConstants.WRAPPED_PID_TIMEOUT_MILLIS) { + if (!DB && !Build.IS_USERDEBUG + && timeoutMillis <= ZygoteConnectionConstants.WRAPPED_PID_TIMEOUT_MILLIS) { timeoutMillis = ZygoteConnectionConstants.WRAPPED_PID_TIMEOUT_MILLIS + 1; } mWatchdogTimeoutMillis = timeoutMillis;