0

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

Javier
  • 1,469
  • 2
  • 20
  • 38
  • "however in some devices like samsung or one plus one (OnePlus7Pro_EE) does not work" -- your [mcve] should be showing what you are doing that involves this `` element and what the symptoms are that you are getting on those devices. Also, you really need to get rid of that `` element. That permission is defined by the framework, not an app. – CommonsWare Apr 15 '21 at 11:42
  • I edited my question, Thanks a lot – Javier Apr 15 '21 at 16:02

1 Answers1

0

Only these lines in the manifest are enough to get app info such as name and icon

<queries>
    <intent>
        <action android:name="android.intent.action.MAIN" />
    </intent>
</queries>
XJIOP
  • 89
  • 1
  • 5
  • Unfortunately as I wrote on my post, some in some devices does not work, and I can't debug because is like 1% of the users and is hard to figure out why – Javier May 27 '21 at 07:47