I recently targeted Android sdk 30 and I added the following snippet in my code
<permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
</intent>
</queries>
Seems is working in many devices,and i can get package info like Installed apps , however in some devices like samsung or one plus one (OnePlus7Pro_EE) does not work, I'm not sure how to solve this issue. if I use the full permissions will work
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
however doing this will means I need to apply for exhausting review and Permissions Declaration, which might be rejected. seems is working in most of the devices, but in few devices it does not work. what I want to achieve is get information about the installed apps and icon an example:
packageManager.getApplicationIcon(packageName)
doing this throw PackageManager$NameNotFoundException