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

Incorrect constant lint check #19

Open
BenoitDuffez opened this issue May 18, 2017 · 1 comment
Open

Incorrect constant lint check #19

BenoitDuffez opened this issue May 18, 2017 · 1 comment

Comments

@BenoitDuffez
Copy link

Running lint checks on an app that uses the SDK yields the following error:

Must be one or more of: PackageManager.GET_META_DATA, PackageManager.GET_RESOLVED_FILTER, PackageManager.GET_SHARED_LIBRARY_FILES, PackageManager.MATCH_ALL, PackageManager.MATCH_DISABLED_COMPONENTS, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS, PackageManager.MATCH_DEFAULT_ONLY, PackageManager.MATCH_DIRECT_BOOT_AWARE, PackageManager.MATCH_DIRECT_BOOT_UNAWARE, PackageManager.MATCH_SYSTEM_ONLY, PackageManager.MATCH_UNINSTALLED_PACKAGES, PackageManager.GET_DISABLED_COMPONENTS, PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS, PackageManager.GET_UNINSTALLED_PACKAGES

This happens in ApplicationUtils.java#L52:

49       return cn;
50   }
51 
52   List<ResolveInfo> infos = context.getPackageManager().queryIntentServices(i, Context.BIND_AUTO_CREATE);
53 
54   if (infos.isEmpty()) return null;

The Context.BIND_AUTO_CREATE is the constant lint is complaining about.

I'm guessing the desired constant is PackageManager.COMPONENT_ENABLED_STATE_DEFAULT since it has the same constant value as Context.BIND_AUTO_CREATE (0).

@BenoitDuffez
Copy link
Author

Actually PackageManager.COMPONENT_ENABLED_STATE_DEFAULT is not on the list either so it should probably be 0.

What was the expected behavior? None of the accepted flags match the constant value held by Context.BIND_AUTO_CREATE.

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

No branches or pull requests

1 participant