From 4858a5167c8e211a4c80b5061918efe856a0ab6a Mon Sep 17 00:00:00 2001 From: Olivier Gaillard Date: Fri, 24 Feb 2023 09:15:55 +0000 Subject: [PATCH] For ANRs, reduce EXPIRED_REPORT_TIME_MS to 10s After 10s, the state of other processes is likely to not be useful anyway to debug the ANR. If there is already a delay on the queue, not dump all the proceses will also help to recover more quickly so that future ANR snapshots are more accurate (smaller latency) Change-Id: Ibc4c85d90389724a0bc214f789f64edebb59da78 Bug: 254634348 Test: unit tests --- services/core/java/com/android/server/am/AnrHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/AnrHelper.java b/services/core/java/com/android/server/am/AnrHelper.java index 463a2f84aa6b2..16219cd5b2ea9 100644 --- a/services/core/java/com/android/server/am/AnrHelper.java +++ b/services/core/java/com/android/server/am/AnrHelper.java @@ -49,7 +49,7 @@ class AnrHelper { * this time, the information might be outdated. So we only the dump the unresponsive process * instead of including other processes to avoid making the system more busy. */ - private static final long EXPIRED_REPORT_TIME_MS = TimeUnit.MINUTES.toMillis(1); + private static final long EXPIRED_REPORT_TIME_MS = TimeUnit.SECONDS.toMillis(10); /** * If the last ANR occurred within this given time, consider it's anomaly.