-
- All Implemented Interfaces:
-
backtraceio.library.anr.BacktraceANRHandler
,java.lang.Runnable
public class BacktraceANRHandlerWatchdog extends Thread implements BacktraceANRHandler
This is the class that is responsible for monitoring the user interface thread and sending an error if it is blocked
-
-
Field Summary
Fields Modifier and Type Field Description private OnApplicationNotRespondingEvent
onApplicationNotRespondingEvent
-
Constructor Summary
Constructors Constructor Description BacktraceANRHandlerWatchdog(BacktraceClient client)
Initialize new instance of BacktraceANRWatchdog with default timeout BacktraceANRHandlerWatchdog(BacktraceClient client, int timeout)
Initialize new instance of BacktraceANRWatchdog without debugging BacktraceANRHandlerWatchdog(BacktraceClient client, int timeout, boolean debug)
Initialize new instance of BacktraceANRWatchdog
-
Method Summary
Modifier and Type Method Description void
setOnApplicationNotRespondingEvent(OnApplicationNotRespondingEvent onApplicationNotRespondingEvent)
void
run()
Method which is using to check if the user interface thread has been blocked void
stopMonitoringAnr()
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, start, stop, suspend, toString, yield
-
Methods inherited from class backtraceio.library.anr.BacktraceANRHandler
setOnApplicationNotRespondingEvent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
BacktraceANRHandlerWatchdog
BacktraceANRHandlerWatchdog(BacktraceClient client)
Initialize new instance of BacktraceANRWatchdog with default timeout- Parameters:
client
- current Backtrace client instance which will be used to send information about exception
-
BacktraceANRHandlerWatchdog
BacktraceANRHandlerWatchdog(BacktraceClient client, int timeout)
Initialize new instance of BacktraceANRWatchdog without debugging- Parameters:
client
- current Backtrace client instance which will be used to send information about exceptiontimeout
- maximum time in milliseconds after which should check if the main thread is not hanged
-
BacktraceANRHandlerWatchdog
BacktraceANRHandlerWatchdog(BacktraceClient client, int timeout, boolean debug)
Initialize new instance of BacktraceANRWatchdog- Parameters:
client
- current Backtrace client instance which will be used to send information about exceptiontimeout
- maximum time in milliseconds after which should check if the main thread is not hangeddebug
- enable debug mode - errors will not be sent if the debugger is connected
-
-
Method Detail
-
setOnApplicationNotRespondingEvent
void setOnApplicationNotRespondingEvent(OnApplicationNotRespondingEvent onApplicationNotRespondingEvent)
-
run
void run()
Method which is using to check if the user interface thread has been blocked
-
stopMonitoringAnr
void stopMonitoringAnr()
-
-
-
-