1

Android 11 (API 30) adds restrictions about installed packaged visibility, which is excellent for user privacy. However, this means a NotificationListenerService is no longer able to load a notification's app name or icon with context.packageManager.getApplicationInfo(packageName, 0). Are there any good workarounds for this?

The solutions that I've discovered are:

  • <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
  • <queries><intent><action android:name="android.intent.action.MAIN" /></intent></queries> like so

However, these seem like excellent ways to be banned from the store. Are there any other solutions for a NotificationListenerService to get the application info objects related to active notifications?

hufman
  • 163
  • 1
  • 2
  • 6

0 Answers0