Android 11 changes how apps can query and interact with other
installed apps on the same device. If your app targets
Android 11, most common interactions don't require
changes to your app. In some cases, you might need to add
<queries> element in your app's manifest file so that the system knows which
other apps to show to your app.
PackageManager methods that return results about other apps—such as
queryIntentActivities()—are filtered based on the calling app's
declaration. Explicit interactions with other apps, such as
also require the target app to match one of the declarations in
Most common interactions aren't affected
In many cases, including the following, your app doesn't need to include a
- The target app is your own app.
Your activity uses an implicit intent to start an activity.
Your app interacts with certain system packages, such as the media provider, that implement core Android functionality.
Another app expects a result from your app. For example, if another app makes a request to a content provider in your app, the system allows your app to see that other app.
Query and interact with specific packages
If you know the specific set of apps that you want to query or interact
with—such as apps that integrate with your app, or apps whose services you
use—include their package names in a set of
<package> elements inside the
<manifest package="com.example.game"> <queries> <package android:name="com.example.store" /> <package android:name="com.example.services" /> </queries> ... </manifest>
Query and interact with apps given an intent filter
Your app might need to query or interact with a set of apps that serve a
particular purpose, but you might not know the specific package names to
include. In this situation, you can list intent filter signatures in your
<queries> tag. Your app can then discover apps that have matching
The following example allows your app to see installed apps that support JPEG image sharing:
<manifest package="com.example.game"> <queries> <intent> <action android:name="android.intent.action.SEND" /> <data android:mimeType="image/jpeg" /> </intent> </queries> ... </manifest>
Note: If you indicate a need to discover a specific app by declaring
<package> element, then you don't need to also declare
<intent> elements that represent the intent actions
used in that app.
The reverse case is also true. If your
<intent> element, then you don't need to also
<package> element if you know that the package
supports the intent that you've defined.
Query and interact with all apps
In rare cases, your app might need to query or interact with all installed
apps on a device, independent of the components they contain. An example is an
app store like Google Play. To allow your app to see all other installed apps,
Android 11 introduces the
Note: In the vast majority of cases, it's possible to fulfill your
app's use case by declaring the
In upcoming versions of the Developer Preview, look for Google Play to provide guidelines for apps that need this permission.
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.
- 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.