Skip to content

Incorrect constant lint check #19

Description

@BenoitDuffez

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions