Our application has been receiving this new kind of crash since the beginning of the year.
Firebase shows it repeats only on Xiaomi with Android 11. It repeats in different parts of the application. And it seems unrelated to the application code. So I assume it is related to Xiaomi Android 11 update with broken code or new restrictions without clear explanation.
The obvious idea is pending intent creation spam, but I can't find any evidence that this method is frequently called, only several times.
Did anyone come out with a hack for that? Suppressing throwable is not a good option since the functionality won't work.
Code snippet:
val intent = Intent(context, SomeClass::class.java).apply {
this.action = action
this.putExtra(EXTRA_IDENTITY, identity)
}
PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
Stacktrace:
Fatal Exception: java.lang.SecurityException: Too many PendingIntent created for uid 10273, aborting Key{broadcastIntent pkg=<package> intent=act=<action name> cmp=<class> flags=0x0 u=0} requestCode=0
at android.os.Parcel.createExceptionOrNull(Parcel.java:2376)
at android.os.Parcel.createException(Parcel.java:2360)
at android.os.Parcel.readException(Parcel.java:2343)
at android.os.Parcel.readException(Parcel.java:2285)
at android.app.IActivityManager$Stub$Proxy.getIntentSenderWithFeature(IActivityManager.java:6898)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:578)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:561)
...
PendingIntent
, but the amount ofBroadcast
received. – Oatcake