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

Add LENOVO and INFINIX to list of exclusions for Resources.mContext leaks. #2573

Conversation

ericmaxwell2003
Copy link
Contributor

ResourcesImpl.mAppContext manufacturer leak exclusions for LENOVO and INFINIX observed on Android 12 and 13.

I didn't know how best to test this. @pyricau, how have you unit tested these exclusions in the past?

@CLAassistant
Copy link

CLAassistant commented Oct 6, 2023

CLA assistant check
All committers have signed the CLA.

@ericmaxwell2003 ericmaxwell2003 force-pushed the emaxwell/add-manufacturer-resourcesImpl_mAppContext-exclusions branch from c45385a to f5e61f9 Compare October 6, 2023 17:28
@@ -1074,7 +1074,8 @@ enum class AndroidReferenceMatchers {
+ " instance that has a context that is the activity."
+ " Observed here: https://github.com/square/leakcanary/issues/1#issue-74450184"
) {
manufacturer == SAMSUNG && sdkInt == 19
(manufacturer == SAMSUNG && sdkInt == 19) ||
((manufacturer == LENOVO || manufacturer == INFINIX) && sdkInt in 31..33)
Copy link
Member

@pyricau pyricau Oct 6, 2023

Choose a reason for hiding this comment

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

I don't think this is the right place, the leaktrace looks like this:

├─ android.content.res.ResourcesImpl class
│    Leaking: NO (a class is never leaking)
│    ↓ static ResourcesImpl.mAppContext
│                           ~~~~~~~~~~~
├─ android.app.ContextImpl instance

So you want staticFieldLeak("android.content.res.ResourcesImpl", "mAppContext") which I think is defined elsewhere in this file.

@ericmaxwell2003 ericmaxwell2003 force-pushed the emaxwell/add-manufacturer-resourcesImpl_mAppContext-exclusions branch from f5e61f9 to 9f8f4f9 Compare October 6, 2023 19:33
@ericmaxwell2003 ericmaxwell2003 force-pushed the emaxwell/add-manufacturer-resourcesImpl_mAppContext-exclusions branch from d7110f1 to f38e86a Compare October 8, 2023 20:10
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