0

I need to know when a package installed on the cell phone can send notifications here is the code where the applications that are on the cell phone are read and I need to know if it has notifications enabled through NotificationManagerCompat (areNotificationsEnabled ())

 List<String> paquetenombre = new ArrayList<>();
        Intent intent = new Intent(Intent.ACTION_MAIN,null);
        intent.addCategory(Intent.CATEGORY_APP_MESSAGING);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED );
     List<ResolveInfo> resolveInfoList = context1.getPackageManager().queryIntentActivities(intent,0);

, thanks in advance

David Wasser
  • 93,459
  • 16
  • 209
  • 274

1 Answers1

0

This is not possible. An application can only use NotificationManagerCompat.areNotificationsEnabled() to determine if its own notifications are blocked or not. There is no way to determine if notifications for another application are blocked.

See this answer: https://stackoverflow.com/a/39976045/769265

David Wasser
  • 93,459
  • 16
  • 209
  • 274