Skip to content

Commit 3c0bd90

Browse files
authored
[Android] [FatalIssueReporter] Update background ANR logic (#462)
1 parent 730c667 commit 3c0bd90

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/AppExitAnrTraceProcessor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ internal object AppExitAnrTraceProcessor {
227227
val sanitizedDescription = description.lowercase()
228228

229229
return when {
230-
UserPerceivedAnr.matches(sanitizedDescription) -> UserPerceivedAnr
231230
BackgroundAnr.matches(sanitizedDescription) -> BackgroundAnr
231+
UserPerceivedAnr.matches(sanitizedDescription) -> UserPerceivedAnr
232232
BroadcastReceiver.matches(sanitizedDescription) -> BroadcastReceiver
233233
ServiceAnr.matches(sanitizedDescription) -> ServiceAnr
234234
ContentProvider.matches(sanitizedDescription) -> ContentProvider

platform/jvm/capture/src/test/kotlin/io/bitdrift/capture/FatalIssueReporterProcessorTest.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,17 @@ class FatalIssueReporterProcessorTest {
276276
)
277277
}
278278

279+
@Test
280+
fun persistAppExitReport_whenBgAnrAndInputDispatchingTimeout_shouldMatchAnrReason() {
281+
assertAnrReason(
282+
descriptionFromAppExit =
283+
"bg anr: Input dispatching timed out (85a07c0 " +
284+
"com.acme.app/com.acme.app.MainActivity is not responding. " +
285+
"Waited 5001ms for MotionEvent)\n",
286+
expectedMessage = "Background ANR",
287+
)
288+
}
289+
279290
@Test
280291
fun persistAppExitReport_whenNativeCrash_shouldCreateEmptyErrorModel() {
281292
val description = "Native crash"

0 commit comments

Comments
 (0)