title: On Android 11, Notification.DeleteIntent received callback when Notification been cancelled or clicked. It should not be called when clicked
body: <p>Recently we found an extra callback from our <code>Notification.DeleteIntent</code> when clicking on the Notification. Then we found out that it only happened on Android 11, not Android 9 or before (not sure about Android 10, do not have devices of it).</p>
  <p>I.e.,</p>
  <ul>
  <li>For Android 9 and before, <code>Notification.ContentIntent</code> been called when clicking on the Notification, and <code>Notification.DeleteIntent</code> been called when swiping out the Notification.</li>
  <li>For Android 11, <code>Notification.ContentIntent</code> been called when clicking on the Notification, and <code>Notification.DeleteIntent</code> been called when <strong>clicking on</strong> or swiping out the Notification.</li>
  </ul>
  <p>Is it intended behavior of Android 11 platform? Or something is not correct in our codes? Thanks!</p>
  <pre><code>    public class NotificationClickedReceiver extends BroadcastReceiver {
          @Override
          public void onReceive(Context context, Intent intent) {
              // Note: Received callback when Notification been clicked.
          }
      }
  
      public class NotificationCancelledReceiver extends BroadcastReceiver {
          @Override
          public void onReceive(Context context, Intent intent) {
              // Note: On Android 9 and before, received callback only when Notification been cancelled (swipe out).
              // Note: On Android 11, received callback when Notification been cancelled or clicked.
          }
      }
  
      {
      ...
          Intent intent = new Intent(context, NotificationClickedReceiver.class);
          PendingIntent contentIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
          intent = new Intent(context, NotificationCancelledReceiver.class);
          PendingIntent deletedIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
  
          Notification.Builder mBuilder = new Notification.Builder(context);
          mBuilder.setContentTitle(&quot;title&quot;)
                  .setContentText(&quot;text&quot;)
                  .setAutoCancel(true)
                  .setContentIntent(contentIntent)
                  .setDeleteIntent(deletedIntent)
                  .setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE);
  
          NotificationManager notificationManager =
                  (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);
          notificationManager.notify(0, mBuilder.build());
      ...
      }
  </code></pre>