Skip to content

Commit 5bd19b0

Browse files
committed
clarify open TODO RE: AbnormalExit discriminator for ANR hints
1 parent 8499a13 commit 5bd19b0

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

sentry-android-core/src/main/java/io/sentry/android/core/ApplicationExitInfoEventProcessor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,8 @@ private final class AnrHintEnricher implements HintEnricher {
682682

683683
@Override
684684
public boolean supports(@NotNull Object hint) {
685-
// TODO: not sure about this. all tests are written with AbnormalExit, but enrichment changes
686-
// are ANR-specific. I called it AnrHintEnricher because that is what it does, but it
687-
// actually triggers on AbnormalExit. Let me know what makes most sense.
685+
// While this is specifically an ANR enricher we discriminate enrichment application
686+
// on the broader AbnormalExit hints for now.
688687
return hint instanceof AbnormalExit;
689688
}
690689

sentry/src/main/java/io/sentry/hints/AbnormalExit.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
import org.jetbrains.annotations.Nullable;
44

5-
/** Marker interface for Sessions experiencing abnormal status */
5+
/**
6+
* Marker interface for Sessions experiencing abnormal status.
7+
*
8+
* <p><b>Note:</b> While this interface applies to the broad category of abnormal exits (meaning any
9+
* exits that weren't classified as normal terminations or crashes) it currently is exclusively used
10+
* as a hint marker for Android ANRs (both watchdog and ApplicationExitInfo based). If additional
11+
* categories of abnormal exits were introduced, all instances of discriminator code (`instanceof
12+
* AbnormalExit`) should be carefully reviewed for ANR specifics accidentally being applied.
13+
*/
614
public interface AbnormalExit {
715

816
/** What was the mechanism this Session has abnormal'ed with */

0 commit comments

Comments
 (0)