public static class XCrash.InitParameters
extends java.lang.Object
| Constructor and Description |
|---|
InitParameters() |
| Modifier and Type | Method and Description |
|---|---|
XCrash.InitParameters |
disableAnrCrashHandler()
Disable the ANR capture feature.
|
XCrash.InitParameters |
disableJavaCrashHandler()
Disable the Java exception capture feature.
|
XCrash.InitParameters |
disableNativeCrashHandler()
Disable the native crash capture feature.
|
XCrash.InitParameters |
enableAnrCrashHandler()
Enable the ANR capture feature.
|
XCrash.InitParameters |
enableJavaCrashHandler()
Enable the Java exception capture feature.
|
XCrash.InitParameters |
enableNativeCrashHandler()
Enable the native crash capture feature.
|
XCrash.InitParameters |
setAnrCallback(ICrashCallback callback)
Set a callback to be executed when an ANR occurred.
|
XCrash.InitParameters |
setAnrCheckProcessState(boolean checkProcessState)
Set whether the process error state (from "ActivityManager#getProcessesInErrorState()") is a necessary condition for ANR.
|
XCrash.InitParameters |
setAnrDumpFds(boolean flag)
Set if dumping FD list when an ANR occurred.
|
XCrash.InitParameters |
setAnrDumpNetwork(boolean flag)
Set if dumping network info when an ANR occurred.
|
XCrash.InitParameters |
setAnrLogcatEventsLines(int logcatEventsLines)
Set the maximum number of rows to get from "logcat -b events" when an ANR occurred.
|
XCrash.InitParameters |
setAnrLogcatMainLines(int logcatMainLines)
Set the maximum number of rows to get from "logcat -b main" when an ANR occurred.
|
XCrash.InitParameters |
setAnrLogcatSystemLines(int logcatSystemLines)
Set the maximum number of rows to get from "logcat -b system" when an ANR occurred.
|
XCrash.InitParameters |
setAnrLogCountMax(int countMax)
Set the maximum number of ANR log files to save in the log directory.
|
XCrash.InitParameters |
setAnrRethrow(boolean rethrow)
Set whether xCrash should rethrow the ANR native signal to system
after it has been handled.
|
XCrash.InitParameters |
setAppVersion(java.lang.String appVersion)
Set App version.
|
XCrash.InitParameters |
setJavaCallback(ICrashCallback callback)
Set a callback to be executed when a Java exception occurred.
|
XCrash.InitParameters |
setJavaDumpAllThreads(boolean flag)
Set if dumping threads info (stacktrace) for all threads (not just the thread that has crashed)
when a Java exception occurred.
|
XCrash.InitParameters |
setJavaDumpAllThreadsCountMax(int countMax)
Set the maximum number of other threads to dump when a Java exception occurred.
|
XCrash.InitParameters |
setJavaDumpAllThreadsWhiteList(java.lang.String[] whiteList)
Set a thread name (regular expression) whitelist to filter which threads need to be dumped when a Java exception occurred.
|
XCrash.InitParameters |
setJavaDumpFds(boolean flag)
Set if dumping FD list when a java crash occurred.
|
XCrash.InitParameters |
setJavaDumpNetworkInfo(boolean flag)
Set if dumping network info when a java crash occurred.
|
XCrash.InitParameters |
setJavaLogcatEventsLines(int logcatEventsLines)
Set the maximum number of rows to get from "logcat -b events" when a Java exception occurred.
|
XCrash.InitParameters |
setJavaLogcatMainLines(int logcatMainLines)
Set the maximum number of rows to get from "logcat -b main" when a Java exception occurred.
|
XCrash.InitParameters |
setJavaLogcatSystemLines(int logcatSystemLines)
Set the maximum number of rows to get from "logcat -b system" when a Java exception occurred.
|
XCrash.InitParameters |
setJavaLogCountMax(int countMax)
Set the maximum number of Java crash log files to save in the log directory.
|
XCrash.InitParameters |
setJavaRethrow(boolean rethrow)
Set whether xCrash should rethrow the Java exception to system
after it has been handled.
|
XCrash.InitParameters |
setLibLoader(ILibLoader libLoader)
Set a libLoader implementation for xCrash to load native library.
|
XCrash.InitParameters |
setLogDir(java.lang.String dir)
Set the directory to save crash log files.
|
XCrash.InitParameters |
setLogFileMaintainDelayMs(int logFileMaintainDelayMs)
Set delay in milliseconds before the log file maintain task is to be executed.
|
XCrash.InitParameters |
setLogger(ILogger logger)
Set a logger implementation for xCrash to log message and exception.
|
XCrash.InitParameters |
setNativeCallback(ICrashCallback callback)
Set a callback to be executed when a native crash occurred.
|
XCrash.InitParameters |
setNativeDumpAllThreads(boolean flag)
Set if dumping threads info (registers, backtrace and stack) for all threads (not just the thread that has crashed)
when a native crash occurred.
|
XCrash.InitParameters |
setNativeDumpAllThreadsCountMax(int countMax)
Set the maximum number of other threads to dump when a native crash occurred.
|
XCrash.InitParameters |
setNativeDumpAllThreadsWhiteList(java.lang.String[] whiteList)
Set a thread name (regular expression) whitelist to filter which threads need to be dumped when a native crash occurred.
|
XCrash.InitParameters |
setNativeDumpElfHash(boolean flag)
Set if dumping ELF file's MD5 hash in Build-Id section when a native crash occurred.
|
XCrash.InitParameters |
setNativeDumpFds(boolean flag)
Set if dumping FD list when a native crash occurred.
|
XCrash.InitParameters |
setNativeDumpMap(boolean flag)
Set if dumping memory map when a native crash occurred.
|
XCrash.InitParameters |
setNativeDumpNetwork(boolean flag)
Set if dumping network info when a native crash occurred.
|
XCrash.InitParameters |
setNativeLogcatEventsLines(int logcatEventsLines)
Set the maximum number of rows to get from "logcat -b events" when a native crash occurred.
|
XCrash.InitParameters |
setNativeLogcatMainLines(int logcatMainLines)
Set the maximum number of rows to get from "logcat -b main" when a native crash occurred.
|
XCrash.InitParameters |
setNativeLogcatSystemLines(int logcatSystemLines)
Set the maximum number of rows to get from "logcat -b system" when a native crash occurred.
|
XCrash.InitParameters |
setNativeLogCountMax(int countMax)
Set the maximum number of native crash log files to save in the log directory.
|
XCrash.InitParameters |
setNativeRethrow(boolean rethrow)
Set whether xCrash should rethrow the crash native signal to system
after it has been handled.
|
XCrash.InitParameters |
setPlaceholderCountMax(int countMax)
Set the maximum number of placeholder files in the log directory.
|
XCrash.InitParameters |
setPlaceholderSizeKb(int sizeKb)
Set the KB of each placeholder files in the log directory.
|
public XCrash.InitParameters setAppVersion(java.lang.String appVersion)
PackageInfo.versionName)appVersion - App version string.public XCrash.InitParameters setLogDir(java.lang.String dir)
Context.getFilesDir() + "/tombstones")dir - Absolute path to the directory.public XCrash.InitParameters setLogFileMaintainDelayMs(int logFileMaintainDelayMs)
logFileMaintainDelayMs - Delay in milliseconds before the log file maintain task is to be executed.public XCrash.InitParameters setLogger(ILogger logger)
logger - An instance of ILogger.public XCrash.InitParameters setLibLoader(ILibLoader libLoader)
libLoader - An instance of ILibLoader.public XCrash.InitParameters setPlaceholderCountMax(int countMax)
Note: Set this value to 0 means disable the placeholder feature.
countMax - The maximum number of placeholder files.public XCrash.InitParameters setPlaceholderSizeKb(int sizeKb)
sizeKb - The KB of each placeholder files.public XCrash.InitParameters enableJavaCrashHandler()
public XCrash.InitParameters disableJavaCrashHandler()
public XCrash.InitParameters setJavaRethrow(boolean rethrow)
rethrow - If true, the Java exception will be rethrown to Android System.public XCrash.InitParameters setJavaLogCountMax(int countMax)
countMax - The maximum number of Java crash log files.public XCrash.InitParameters setJavaLogcatSystemLines(int logcatSystemLines)
logcatSystemLines - The maximum number of rows.public XCrash.InitParameters setJavaLogcatEventsLines(int logcatEventsLines)
logcatEventsLines - The maximum number of rows.public XCrash.InitParameters setJavaLogcatMainLines(int logcatMainLines)
logcatMainLines - The maximum number of rows.public XCrash.InitParameters setJavaDumpFds(boolean flag)
flag - True or false.public XCrash.InitParameters setJavaDumpNetworkInfo(boolean flag)
flag - True or false.public XCrash.InitParameters setJavaDumpAllThreads(boolean flag)
flag - True or false.public XCrash.InitParameters setJavaDumpAllThreadsCountMax(int countMax)
Note: This option is only useful when "JavaDumpAllThreads" is enabled by calling setJavaDumpAllThreads(boolean).
countMax - The maximum number of other threads to dump.public XCrash.InitParameters setJavaDumpAllThreadsWhiteList(java.lang.String[] whiteList)
Note: This option is only useful when "JavaDumpAllThreads" is enabled by calling setJavaDumpAllThreads(boolean).
whiteList - A thread name (regular expression) whitelist.public XCrash.InitParameters setJavaCallback(ICrashCallback callback)
callback - An instance of ICrashCallback.public XCrash.InitParameters enableNativeCrashHandler()
public XCrash.InitParameters disableNativeCrashHandler()
public XCrash.InitParameters setNativeRethrow(boolean rethrow)
rethrow - If true, the native signal will be rethrown to Android System.public XCrash.InitParameters setNativeLogCountMax(int countMax)
countMax - The maximum number of native crash log files.public XCrash.InitParameters setNativeLogcatSystemLines(int logcatSystemLines)
logcatSystemLines - The maximum number of rows.public XCrash.InitParameters setNativeLogcatEventsLines(int logcatEventsLines)
logcatEventsLines - The maximum number of rows.public XCrash.InitParameters setNativeLogcatMainLines(int logcatMainLines)
logcatMainLines - The maximum number of rows.public XCrash.InitParameters setNativeDumpElfHash(boolean flag)
flag - True or false.public XCrash.InitParameters setNativeDumpMap(boolean flag)
flag - True or false.public XCrash.InitParameters setNativeDumpFds(boolean flag)
flag - True or false.public XCrash.InitParameters setNativeDumpNetwork(boolean flag)
flag - True or false.public XCrash.InitParameters setNativeDumpAllThreads(boolean flag)
flag - True or false.public XCrash.InitParameters setNativeDumpAllThreadsCountMax(int countMax)
Note: This option is only useful when "NativeDumpAllThreads" is enabled by calling setNativeDumpAllThreads(boolean).
countMax - The maximum number of other threads to dump.public XCrash.InitParameters setNativeDumpAllThreadsWhiteList(java.lang.String[] whiteList)
Note: This option is only useful when "NativeDumpAllThreads" is enabled by calling setNativeDumpAllThreads(boolean).
Warning: The regular expression used here only supports POSIX ERE (Extended Regular Expression). Android bionic's regular expression is different from Linux libc's regular expression. See: https://android.googlesource.com/platform/bionic/+/refs/heads/master/libc/include/regex.h .
whiteList - A thread name (regular expression) whitelist.public XCrash.InitParameters setNativeCallback(ICrashCallback callback)
callback - An instance of ICrashCallback.public XCrash.InitParameters enableAnrCrashHandler()
public XCrash.InitParameters disableAnrCrashHandler()
public XCrash.InitParameters setAnrRethrow(boolean rethrow)
Note: This option is only valid if Android API level greater than or equal to 21.
Warning: It is highly recommended NOT to modify the default value (true) in most cases unless you know that you are doing.
rethrow - If true, the native signal will be rethrown to Android System.public XCrash.InitParameters setAnrCheckProcessState(boolean checkProcessState)
Note: On some Android TV box devices, the ANR is not reflected by process error state. In this case, set this option to false.
checkProcessState - If true, process state error will be a necessary condition for ANR.public XCrash.InitParameters setAnrLogCountMax(int countMax)
countMax - The maximum number of ANR log files.public XCrash.InitParameters setAnrLogcatSystemLines(int logcatSystemLines)
logcatSystemLines - The maximum number of rows.public XCrash.InitParameters setAnrLogcatEventsLines(int logcatEventsLines)
logcatEventsLines - The maximum number of rows.public XCrash.InitParameters setAnrLogcatMainLines(int logcatMainLines)
logcatMainLines - The maximum number of rows.public XCrash.InitParameters setAnrDumpFds(boolean flag)
flag - True or false.public XCrash.InitParameters setAnrDumpNetwork(boolean flag)
flag - True or false.public XCrash.InitParameters setAnrCallback(ICrashCallback callback)
callback - An instance of ICrashCallback.