Package visibility filtering on Android (original) (raw)
When an app targets Android 11 (API level 30) or higher and queries for information about the other apps that are installed on a device, the system filters this information by default. This filtering behavior means that your app can’t detect all the apps installed on a device, which helps minimize the potentially sensitive information that your app can access but doesn't need to fulfill its use cases.
Also, filtered package visibility helps app stores like Google Play assess the privacy and security that your app provides for users. For example, Google Play considers the list of installed apps to bepersonal and sensitive user data.
Limited app visibility affects the results returned by methods that give information about other apps, such asqueryIntentActivities(),getPackageInfo(), andgetInstalledApplications(). The limited visibility also affects explicit interactions with other apps, such as starting another app's service.
Some packages are visible automatically. Your app can always detect these packages in its queries for other installed apps. To view other packages, declare your app's need for increased package visibility using the element. The use cases page provides examples of how you can selectively expand package visibility. The workflows described there allow you to fulfill common app interaction scenarios while protecting user privacy.
In the rare cases where the <queries> element doesn't provide adequate package visibility, you can use the QUERY_ALL_PACKAGES permission. If you publish your app on Google Play, your app's use of this permission issubject to approval.
The page abouttesting package visibility behavioroffers suggestions for how to test behavior changes based on package visibility when your app relies on interactions with other apps.
Additional resources
To learn more about package visibility on Android, view the following materials:
Blog posts
- Package visibility in Android 11, available on Medium.