Package 

Object InstrumentUtility

    • Method Detail

      • getCause

         final static String getCause(Throwable e)

        Get the cause of the raised exception.

        Parameters:
        e - The Throwable containing the exception that was raised
      • getStackTrace

         final static String getStackTrace(Throwable e)

        Get the iterated call stack traces of the raised exception.

        Parameters:
        e - The Throwable containing the exception that was raised
      • getStackTrace

         final static String getStackTrace(Thread thread)

        Get the stack trace of the input Thread.

        Parameters:
        thread - The Thread to obtain the stack trace
      • isSDKRelatedException

         final static Boolean isSDKRelatedException(Throwable e)

        Check whether a Throwable is related to Facebook SDK by looking at iterated stack traces and return true if one of the traces has prefix "com.facebook".

        Parameters:
        e - The Throwable containing the exception that was raised
      • isSDKRelatedThread

         final static Boolean isSDKRelatedThread(Thread thread)

        Check whether an Thread is related to Facebook SDK by looking at iterated stack traces

        Parameters:
        thread - The Thread to obtain the stack trace
      • listAnrReportFiles

         final static Array<File> listAnrReportFiles()

        Get the list of anr report files from instrument report directory defined in InstrumentUtility.getInstrumentReportDir method.

        Note that the function should be called after FacebookSdk is initialized. Otherwise, exception FacebookSdkNotInitializedException will be thrown.

      • listExceptionReportFiles

         final static Array<File> listExceptionReportFiles()

        Get the list of exception report files from instrument report directory defined in method.

        Note that the function should be called after FacebookSdk is initialized. Otherwise, exception FacebookSdkNotInitializedException will be thrown.

      • readFile

         final static JSONObject readFile(String filename, Boolean deleteOnException)

        Read the content from the file which is denoted by filename and the directory is the instrument report directory defined in InstrumentUtility.getInstrumentReportDir method.

        Note that the function should be called after FacebookSdk is initialized. Otherwise, exception FacebookSdkNotInitializedException will be thrown.

      • writeFile

         final static Unit writeFile(String filename, String content)

        Write the content to the file which is denoted by filename and the file will be put in instrument report directory defined in InstrumentUtility.getInstrumentReportDir method.

        Note that the function should be called after FacebookSdk is initialized. Otherwise, exception FacebookSdkNotInitializedException will be thrown.

      • deleteFile

         final static Boolean deleteFile(String filename)

        Deletes the cache file under instrument report directory. If the instrument report directory exists and the file exists under the directory, the file will be deleted.

        Note that the function should be called after FacebookSdk is initialized. Otherwise, exception FacebookSdkNotInitializedException will be thrown.

      • getInstrumentReportDir

         final static File getInstrumentReportDir()

        Get the instrument directory for report if the directory exists. If the directory doesn't exist, will attempt to create the directory. Note that, the instrument directory is under cache directory of the Application.

        Note that the function should be called after FacebookSdk is initialized. Otherwise, exception FacebookSdkNotInitializedException will be thrown.