Android 11 changes how apps can query and interact with other
apps that the user has installed on a device. Using the
apps can define the set of other packages that they can access. This element
helps encourage the principle of least privilege by telling the system which
other packages to make visible to your app, and it helps app stores like Google
Play assess the privacy and security that your app provides for users.
If your app targets Android 11 or higher, you might need to add
<queries> element in your app's manifest file. Within the
element, you can specify packages by name, by intent signature, or by provider
Learn more in the guide about how to manage the package visibility of other installed apps when your app targets Android 11 or higher.
Test the change
To test whether this behavior change has taken effect in your app, complete the following steps:
- Install Android Studio 3.6.1 or higher.
- Install the latest version of Gradle that Android Studio supports.
- Set your app's
- Don't include the
<queries>element in your app's manifest file.
getInstalledPackages(). Both methods should return a filtered list.
- See which features of your app aren't working.
- Introduce appropriate
<queries>entries to fix these features.