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

Lazily enable the Android components #1002

Merged
merged 1 commit into from
Jun 16, 2018
Merged

Lazily enable the Android components #1002

merged 1 commit into from
Jun 16, 2018

Conversation

pyricau
Copy link
Member

@pyricau pyricau commented Jun 16, 2018

HeapAnalyzerService, AnalysisResultService and DisplayLeakActivity are all disabled by default. They're now enabled only as needed.

This means they won't be enabled when LeakCanary is used in CI, or when there are no leak.

HeapAnalyzerService, AnalysisResultService and DisplayLeakActivity are all disabled by default. They're now enabled only as needed.

This means they won't be enabled when LeakCanary is used in CI, or when there are no leak.
@@ -83,6 +84,7 @@ public static PendingIntent createPendingIntent(Context context) {
}

public static PendingIntent createPendingIntent(Context context, String referenceKey) {
setEnabledBlocking(context, DisplayLeakActivity.class, true);

Choose a reason for hiding this comment

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

Doesn't this now block for a non-zero amount of time on every leak?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, but from an IntentService handler thread so 🤷‍♂️

@@ -53,17 +53,12 @@
public static final String HUAWEI = "HUAWEI";
public static final String VIVO = "vivo";

private static final Executor fileIoExecutor = newSingleThreadExecutor("File-IO");

Choose a reason for hiding this comment

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

+1.

Choose a reason for hiding this comment

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

@AlexanderGH you'll be excited.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm excited when people are excited! I'd love to know why you're excited though :)

@pyricau pyricau merged commit 0894203 into master Jun 16, 2018
@pyricau pyricau added this to the 1.6 milestone Jun 18, 2018
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.

2 participants