Class BacktraceANRWatchdog

  • All Implemented Interfaces:
    java.lang.Runnable

    public class BacktraceANRWatchdog
    extends java.lang.Thread
    This is the class that is responsible for monitoring the user interface thread and sending an error if it is blocked
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()
      Method which is using to check if the user interface thread has been blocked
      void setOnApplicationNotRespondingEvent​(OnApplicationNotRespondingEvent onApplicationNotRespondingEvent)  
      void stopMonitoringAnr()  
      • 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 exception
        timeout - 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 exception
        timeout - maximum time in milliseconds after which should check if the main thread is not hanged
        debug - enable debug mode - errors will not be sent if the debugger is connected
    • Method Detail

      • run

        public void run()
        Method which is using to check if the user interface thread has been blocked
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • stopMonitoringAnr

        public void stopMonitoringAnr()