public final class InstrumentUtility
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ANALYSIS_REPORT_PREFIX |
static java.lang.String |
CRASH_REPORT_PREFIX |
static java.lang.String |
CRASH_SHIELD_PREFIX |
static java.lang.String |
ERROR_REPORT_PREFIX |
static java.lang.String |
THREAD_CHECK_PREFIX |
| Constructor and Description |
|---|
InstrumentUtility() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
deleteFile(java.lang.String filename)
Deletes the cache file under instrument report directory.
|
static java.lang.String |
getCause(java.lang.Throwable e)
Get the cause of the raised exception.
|
static java.io.File |
getInstrumentReportDir()
Get the instrument directory for report if the directory exists.
|
static java.lang.String |
getStackTrace(java.lang.Throwable e)
Get the iterated call stack traces of the raised exception.
|
static boolean |
isSDKRelatedException(java.lang.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".
|
static java.io.File[] |
listExceptionAnalysisReportFiles()
Get the list of exception analysis report files from instrument report directory defined in
getInstrumentReportDir() method. |
static java.io.File[] |
listExceptionReportFiles()
Get the list of exception report files from instrument report directory defined in
getInstrumentReportDir() method. |
static org.json.JSONObject |
readFile(java.lang.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
getInstrumentReportDir()
method. |
static void |
sendReports(java.lang.String key,
org.json.JSONArray reports,
GraphRequest.Callback callback)
Create Graph Request for Instrument reports and send the reports to Facebook.
|
static void |
writeFile(java.lang.String filename,
java.lang.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
getInstrumentReportDir()
method. |
public static final java.lang.String ANALYSIS_REPORT_PREFIX
public static final java.lang.String CRASH_REPORT_PREFIX
public static final java.lang.String CRASH_SHIELD_PREFIX
public static final java.lang.String THREAD_CHECK_PREFIX
public static final java.lang.String ERROR_REPORT_PREFIX
@Nullable public static java.lang.String getCause(java.lang.Throwable e)
e - The Throwable containing the exception that was raised@Nullable public static java.lang.String getStackTrace(java.lang.Throwable e)
e - The Throwable containing the exception that was raisedpublic static boolean isSDKRelatedException(@Nullable
java.lang.Throwable e)
e - The Throwable containing the exception that was raisedpublic static java.io.File[] listExceptionAnalysisReportFiles()
getInstrumentReportDir() method.
Note that the function should be called after FacebookSdk is initialized. Otherwise,
exception FacebookSdkNotInitializedException will be thrown.public static java.io.File[] listExceptionReportFiles()
getInstrumentReportDir() method.
Note that the function should be called after FacebookSdk is initialized. Otherwise,
exception FacebookSdkNotInitializedException will be thrown.@Nullable
public static org.json.JSONObject readFile(@Nullable
java.lang.String filename,
boolean deleteOnException)
getInstrumentReportDir()
method.
Note that the function should be called after FacebookSdk is initialized. Otherwise,
exception FacebookSdkNotInitializedException will be thrown.public static void writeFile(@Nullable
java.lang.String filename,
@Nullable
java.lang.String content)
getInstrumentReportDir()
method.
Note that the function should be called after FacebookSdk is initialized. Otherwise,
exception FacebookSdkNotInitializedException will be thrown.public static boolean deleteFile(@Nullable
java.lang.String filename)
public static void sendReports(java.lang.String key,
org.json.JSONArray reports,
GraphRequest.Callback callback)
@Nullable public static java.io.File getInstrumentReportDir()