public @NonNull RefWatcher
buildAndInstall() {
if (LeakCanaryInternals
.installedRefWatcher
!= null
) {
throw new UnsupportedOperationException("buildAndInstall() should only be called once.");
}
RefWatcher refWatcher
= build();
if (refWatcher
!= DISABLED
) {
if (enableDisplayLeakActivity
) {
LeakCanaryInternals
.setEnabledAsync(context
, DisplayLeakActivity
.class, true);
}
if (watchActivities
) {
ActivityRefWatcher
.install(context
, refWatcher
);
}
if (watchFragments
) {
FragmentRefWatcher
.Helper
.install(context
, refWatcher
);
}
}
LeakCanaryInternals
.installedRefWatcher
= refWatcher
;
return refWatcher
;
}
兔子兔兔兔
2121
21
nux kdj
1111
转载请注明原文地址: https://mac.8miu.com/read-488009.html