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:
They cover this more now that DP2 is out.
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
You can whitelist certain packages and certain
structures to try to get by this for certain use cases. And, this is where
QUERY_ALL_PACKAGESpermission 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.