File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
backtrace-library/src/main/java/backtraceio/library/watchdog Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ public void setOnApplicationNotRespondingEvent(OnApplicationNotRespondingEvent
9797 */
9898 @ Override
9999 public void run () {
100+ Boolean reported = false ;
100101 while (!shouldStop && !isInterrupted ()) {
101102 String dateTimeNow = Calendar .getInstance ().getTime ().toString ();
102103 BacktraceLogger .d (LOG_TAG , "ANR WATCHDOG - " + dateTimeNow );
@@ -116,6 +117,7 @@ public void run() {
116117 threadWatcher .tickPrivateCounter ();
117118
118119 if (threadWatcher .getCounter () == threadWatcher .getPrivateCounter ()) {
120+ reported = false ;
119121 BacktraceLogger .d (LOG_TAG , "ANR is not detected" );
120122 continue ;
121123 }
@@ -125,6 +127,11 @@ public void run() {
125127 "is on and connected debugger" );
126128 continue ;
127129 }
130+ if (reported ) {
131+ // skipping, because we already reported an ANR report for current ANR
132+ continue ;
133+ }
134+ reported = true ;
128135 BacktraceWatchdogShared .sendReportCauseBlockedThread (backtraceClient ,
129136 Looper .getMainLooper ().getThread (), onApplicationNotRespondingEvent , LOG_TAG );
130137 }
You can’t perform that action at this time.
0 commit comments