Java 类com.squareup.leakcanary.DisplayLeakService 实例源码

项目:S1-Next    文件:LeaksUtil.java   
public static RefWatcher install(Application application) {
    if (BuildConfig.DEBUG) {
        ExcludedRefs excludedRefs = AndroidExcludedRefs.createAppDefaults()
                //exclude InputMethodManager
                .clazz("android.view.inputmethod.InputMethodManager")
                .build();
        return LeakCanary.refWatcher(application)
                .listenerServiceClass(DisplayLeakService.class)
                .excludedRefs(excludedRefs)
                .buildAndInstall();
    } else {
        return LeakCanary.install(application);
    }
}
项目:leakcanary-for-eclipse    文件:LeakCanaryWrapper.java   
@TargetApi(value = android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public static RefWatcher install(Application application, boolean debug) {
    RefWatcher watcher = null;
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        if (debug) {
            watcher = LeakCanary.install(application, DisplayLeakService.class);
        } else {
            watcher = ReleaseLeakCanary.install(application);
        }
    }

    return watcher;
}