Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7fc099c authored by Mohamad Mahmoud's avatar Mohamad Mahmoud
Browse files

Enable pre-ANR method tracing via AnrTimer split point notifications

Adds support for triggering method tracing shortly before ANR expiry using AnrTimer split points, enabling proactive pre-anr notifications.

- Introduces split point support in AnrTimer, allowing early actions (trace, notify, expire) at specific percentages of timer duration.
- Adds a predefined 50% split point (`TOKEN_LONG_METHOD_TRACING`) used to trigger `LongMethodTracer` before the ANR.
- Extends `AnrTimer.Args` to configure long method tracing, controlled via the flag.
- Updates the native AnrTimerService to support multiple split points per timer with associated actions.
- Adds plumbing across Java, JNI and native, enabling early notifications to the Java layer via `notifyEarly`.

This enables triggering method traces before a timer-based ANR is triggered, enabling LMT for  Service and Broadcast timeouts.

Design Document: go/long-method-tracing-for-anrs
Test: manually tested with Services and Broadcasts, atest AnrTimerTest
Bug: 419753987
Flag: com.android.server.am.enable_long_method_tracing_on_anr_timer

Change-Id: I0a8b3518e1df54e3f5dfd73dfd91f9357d8ec495
parent 176736ca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment