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)
Even when permission QUERY_ALL_PACKAGES
is added, you still need to add <queries>
filter to your AndroidManifest
.
E.g. for the launcher app it might be:
<permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
</intent>
</queries>