android system notification limit per app

According to @Nirel's answer.

1) I tried to run the code in 3 different devices.

Surprisingly notifications beyond 50 are not showing in notification area.

It gives following error.

W/NotificationManager﹕ notify: id corrupted: sent 51, got back 0

The same error comes for subsequent calls.

I saw the source of NotificationManager , it gives this error if incoming and out id is not same. See below code.

https://github.com/android/platform_frameworks_base/blob/master/core/java/android/app/NotificationManager.java#L233

2) After I tried to notify on intervals of 100 milliseconds.

It also Gives the same error. What I tried is removed 1 notification when code is executed.

Surprisingly , notification number 153 came in status bar.

So the conclusion is that , at most 50 notifications can be there. This may be default behaviour and may can change by manufacturer as said by @Sharp Edge.

Thnx.


In API23

package com.android.server.notification; NotificationManagerService.java

static final int MAX_PACKAGE_NOTIFICATIONS = 50;

The limit for notifications and toasts is per app 50