Package backtraceio.library.watchdog
Class BacktraceANRWatchdog
- java.lang.Object
-
- java.lang.Thread
-
- backtraceio.library.watchdog.BacktraceANRWatchdog
-
- All Implemented Interfaces:
java.lang.Runnable
public class BacktraceANRWatchdog extends java.lang.ThreadThis is the class that is responsible for monitoring the user interface thread and sending an error if it is blocked
-
-
Constructor Summary
Constructors Constructor Description BacktraceANRWatchdog(BacktraceClient client)Initialize new instance of BacktraceANRWatchdog with default timeoutBacktraceANRWatchdog(BacktraceClient client, int timeout)Initialize new instance of BacktraceANRWatchdog without debuggingBacktraceANRWatchdog(BacktraceClient client, int timeout, boolean debug)Initialize new instance of BacktraceANRWatchdog
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()Method which is using to check if the user interface thread has been blockedvoidsetOnApplicationNotRespondingEvent(OnApplicationNotRespondingEvent onApplicationNotRespondingEvent)voidstopMonitoringAnr()-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
BacktraceANRWatchdog
public BacktraceANRWatchdog(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
-
BacktraceANRWatchdog
public BacktraceANRWatchdog(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
-
BacktraceANRWatchdog
public BacktraceANRWatchdog(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
public void setOnApplicationNotRespondingEvent(OnApplicationNotRespondingEvent onApplicationNotRespondingEvent)
-
run
public void run()
Method which is using to check if the user interface thread has been blocked- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
stopMonitoringAnr
public void stopMonitoringAnr()
-
-