You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/platforms/android/configuration/app-not-respond.mdx
+27-3Lines changed: 27 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,26 +4,50 @@ sidebar_order: 3
4
4
description: "Learn how to turn off or specify ANR."
5
5
---
6
6
7
-
Whenever the main UI thread of the application is blocked for more than five seconds, the SDK will report the problem to the server.
7
+
The Android SDK uses different implementations to detect ANRs, depending on what version of Android the device is running:
8
+
9
+
- Below Android 11: Running a Watchdog thread (v1)
10
+
- Android 11 and above: Reading [ApplicationExitInfo](https://developer.android.com/reference/android/app/ApplicationExitInfo) (v2)
11
+
12
+
The new implementation (v2) uses the same data source as Google Play Console. This means the reported ANR events and [ANR rate](/platforms/android/performance/instrumentation/performance-metrics/#application-not-responding-anr-rate) should match with what you see on Sentry. The new implementation also captures a thread dump with additional information, like held locks, to help you resolve ANRs more efficiently.
13
+
14
+
While the original Watchdog approach (v1) reports many false positives and is based on heuristics, it still has some advantages over v2, like capturing screenshots and transactions with profiles at the time of ANR.
8
15
9
16
<Note>
10
17
11
-
Sentry does not report the ANR if the application is in debug mode.
18
+
We're considering SDK support for both approaches working alongside each other on Android 11 and up. Please upvote [this GitHub discussion](https://github.com/getsentry/sentry-java/discussions/2716) and share your feedback if you have a case for v1 and v2 working together.
12
19
13
20
</Note>
14
21
15
-
You can turn off monitoring the ANR by adding the following to your `AndroidManifest.xml`:
22
+
Both ANR detection implementations are controlled by the same flag:
Whenever the main UI thread of the application is blocked for more than five seconds, the SDK will report the problem to the server.
33
+
34
+
<Note>
35
+
36
+
Sentry does not report the ANR if the application is in debug mode.
37
+
38
+
</Note>
39
+
23
40
You can also specify how long the thread should be blocked before the ANR is reported. Provide the duration in the attribute `io.sentry.anr.timeout-interval-millis` in your `AndroidManifest.xml`:
0 commit comments