Skip to content

Commit

Permalink
修正displayNotification 为false ,onBlock不回调的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
benson.zheng committed Jan 19, 2017
1 parent 5aba128 commit 8b8187f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void onBlockEvent(long realTimeStart, long realTimeEnd,
.flushString();
LogWriter.save(blockInfo.toString());

if (getContext().displayNotification() && mInterceptorChain.size() != 0) {
if (mInterceptorChain.size() != 0) {
for (BlockInterceptor interceptor : mInterceptorChain) {
interceptor.onBlock(getContext().provideContext(), blockInfo);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ public final class BlockCanary {
private BlockCanary() {
BlockCanaryInternals.setContext(BlockCanaryContext.get());
mBlockCanaryCore = BlockCanaryInternals.getInstance();
mBlockCanaryCore.addBlockInterceptor(BlockCanaryContext.get());
if (!BlockCanaryContext.get().displayNotification()) {
return;
}
mBlockCanaryCore.addBlockInterceptor(new DisplayService());
mBlockCanaryCore.addBlockInterceptor(BlockCanaryContext.get());

}

/**
Expand Down

0 comments on commit 8b8187f

Please sign in to comment.