This line is described on the developer site but I did not understand it perfectly
Call getInstalledApplications() or getInstalledPackages(). Both methods should return a filtered list.
Actually, I need to test Testing package visibility behavior
https://developer.android.com/training/package-visibility/testing
There are 3 different ways of querying installed apps of the user in Android 11.
<queries>element in theAndroidManifest.<queries>element according to your requirements like it has been done in the code snippet below.The
<intent>element looks like<intent-filter>but there are few differences. element has the following restrictions:<intent>element can have only one<action>element.mimeType,schemeandhost.QUERY_ALL_PACKAGESpermission in theAndroidManifest. It is anormalpermission and it is granted as soon as the app is installed.