Skip to content

Commit

Permalink
Merge pull request #82 from MMCBen/master
Browse files Browse the repository at this point in the history
修正displayNotification 为false ,onBlock不回调的问题
  • Loading branch information
markzhai authored Jan 19, 2017
2 parents 5aba128 + 8b8187f commit 6372faf
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 6372faf

Please sign in to comment.