What does QUERY_ALL_PACKAGES permission do?

Android R Preview 1 introduced a new permission called QUERY_ALL_PACKAGES. The documentation for the permission says the following:

Allows query of any normal app on the device, regardless of manifest declarations.

Has anyone worked out what this actually does?

I’ve tried running the following on the emulator image, and the permission had no effect on either of them:

  • packageManager.queryIntentActivities(intent, 0)
  • packageManager.getInstalledPackages(0)


They cover this more now that DP2 is out.

Quoting myself:

While I haven’t tested
this aspect of R DP2 yet, it appears that your app now can’t find out what other apps are installed,
on a general basis. The cited example is queryIntentActivities(), but to make
this really work you would need to seriously lobotomize PackageManager.
You can whitelist certain packages and certain <intent-filter>
structures to try to get by this for certain use cases. And, this is where
the mysterious QUERY_ALL_PACKAGES permission seen in DP1 comes into play —
this permission removes these new restrictions. Given the “look for Google Play
to provide guidelines for apps that need this permission” caveat, it is safest to assume
that if you try using it, eventually you will be banned from the Play Store by a

So, you might want to re-try your experiments on DP2. I plan to do the same in the coming weeks.

Leave a Reply

Your email address will not be published. Required fields are marked *