public class BlockCanaryContext
extends java.lang.Object
| 构造器和说明 |
|---|
BlockCanaryContext() |
| 限定符和类型 | 方法和说明 |
|---|---|
java.util.List<java.lang.String> |
concernPackages()
Packages that developer concern, by default it uses process name,
put high priority one in pre-order.
|
boolean |
deleteFilesInWhiteList()
Whether to delete files whose stack is in white list, used with white-list.
|
boolean |
displayNotification()
If need notification to notice block.
|
boolean |
filterNonConcernStack()
Filter stack without any in concern package, used with @{code concernPackages}.
|
static BlockCanaryContext |
get() |
void |
onBlock(android.content.Context context,
BlockInfo blockInfo)
Block interceptor, developer may provide their own actions.
|
int |
provideBlockThreshold()
Config block threshold (in millis), dispatch over this duration is regarded as a BLOCK.
|
android.content.Context |
provideContext()
Provide application context.
|
int |
provideDumpInterval()
Thread stack dump interval, use when block happens, BlockCanary will dump on main thread
stack according to current sample cycle.
|
int |
provideMonitorDuration()
Config monitor duration, after this time BlockCanary will stop, use
with
BlockCanary's isMonitorDurationEnd |
java.lang.String |
provideNetworkType()
Network type
|
java.lang.String |
providePath()
Path to save log, like "/blockcanary/", will save to sdcard if can.
|
java.lang.String |
provideQualifier()
Implement in your project.
|
java.lang.String |
provideUid()
Implement in your project.
|
java.util.List<java.lang.String> |
provideWhiteList()
Provide white list, entry in white list will not be shown in ui list.
|
boolean |
reportRecentOneMessage()
Default method will collect several messages when detect block what we not need
|
boolean |
stopWhenDebugging()
Whether to stop monitoring when in debug mode.
|
void |
upload(java.io.File zippedFile)
Implement in your project, bundled log files.
|
boolean |
zip(java.io.File[] src,
java.io.File dest)
Implement in your project, bundle files into a zip file.
|
public static BlockCanaryContext get()
public android.content.Context provideContext()
public java.lang.String provideQualifier()
public java.lang.String provideUid()
public java.lang.String provideNetworkType()
String like 2G, 3G, 4G, wifi, etc.public int provideMonitorDuration()
BlockCanary's isMonitorDurationEndpublic int provideBlockThreshold()
public int provideDumpInterval()
Because the implementation mechanism of Looper, real dump interval would be longer than the period specified here (especially when cpu is busier).
public java.lang.String providePath()
public boolean displayNotification()
public boolean zip(java.io.File[] src,
java.io.File dest)
src - files before compressdest - files compressedpublic void upload(java.io.File zippedFile)
zippedFile - zipped filepublic java.util.List<java.lang.String> concernPackages()
public boolean filterNonConcernStack()
public java.util.List<java.lang.String> provideWhiteList()
public boolean deleteFilesInWhiteList()
public void onBlock(android.content.Context context,
BlockInfo blockInfo)
public boolean stopWhenDebugging()
public boolean reportRecentOneMessage()