Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More granularity for AndroidExcludedRefs #73

Merged
merged 1 commit into from
May 13, 2015
Merged

Conversation

pyricau
Copy link
Member

@pyricau pyricau commented May 13, 2015

The goal is to allow an app that fixed a known leak to stop excluding that leak, so that it gets reported if it's not correctly fixed.

  • AndroidExcludedRefs is an enum
  • AndroidExcludedRefs static methods are still here
  • However, you can also create you own enum set and build the corresponding ExcludedRefs from that.

API changes:

  • LeakCanary.install(Application, Class<? extends AbstractAnalysisResultService>, ExcludedRefs)
  • LeakCanary.androidWatcher(HeapDump.Listener, ExcludedRefs)

The goal is to allow an app that fixed a known leak to stop excluding that leak, so that it gets reported if it's not correctly fixed.

* `AndroidExcludedRefs` is an enum
* `AndroidExcludedRefs` static methods are still here
* However, you can also create you own enum set and build the corresponding ExcludedRefs from that.

API changes:

* `LeakCanary.install(Application, Class<? extends AbstractAnalysisResultService>, ExcludedRefs)`
* `LeakCanary.androidWatcher(HeapDump.Listener, ExcludedRefs)`
@@ -106,8 +88,10 @@
// Application.onCreate() and pass it the application context.
excluded.staticField("android.media.session.MediaSessionLegacyHelper", "sInstance");
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those diffs. I fucking love Git.

@pyricau
Copy link
Member Author

pyricau commented May 13, 2015

Thanks @fabiendevos for the idea!

@@ -31,51 +38,24 @@
* We filter on SDK versions and Manufacturers because many of those leaks are specific to a given
* manufacturer implementation, they usually share their builds across multiple models, and the
* leaks eventually get fixed in newer versions.
*
* Most app developers should use {@link #createAppDefaults()}. However, you can also pick the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<p> ?

@swankjesse
Copy link
Contributor

The enum is great.

swankjesse added a commit that referenced this pull request May 13, 2015
More granularity for AndroidExcludedRefs
@swankjesse swankjesse merged commit c635aa8 into master May 13, 2015
@fabiendevos
Copy link

Thanks @swankjesse :)

@pyricau pyricau deleted the py/excluded_enum branch May 13, 2015 13:21
Yky pushed a commit to Yky/leakcanary that referenced this pull request Feb 21, 2016
More granularity for AndroidExcludedRefs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants