Parcel is discarded upon receipt of intent

In the analytics of our application, we noticed an increase in the number of failures for calls getIntent().getExtras(). It is intermittent, and we cannot reproduce it.

Failures occur in two ways:

12  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.os.Parcel.dataSize()' on a null object reference
13  at android.os.BaseBundle.<init>(BaseBundle.java:126)
14  at android.os.Bundle.<init>(Bundle.java:102)
15  at android.content.Intent.getExtras(Intent.java:5685)

and

12  Caused by: java.lang.IllegalArgumentException
13  at android.os.Parcel.nativeAppendFrom(Native Method)
14  at android.os.Parcel.appendFrom(Parcel.java:458)
15  at android.os.BaseBundle.<init>(BaseBundle.java:126)
16  at android.os.Bundle.<init>(Bundle.java:102)
17  at android.content.Intent.getExtras(Intent.java:5685)

Getting the code basically looks like this onResume() {... getIntent().getExtras() ...}. We check to see if the packet fell, but it will work before that.

We conduct special but extensive unit tests that are passed for sorting and disassembling.

An interesting statistic for these crashes is that it mostly happens for Android 6+ (72% of sessions recorded from 95% of crashes happen there). It also unexpectedly crashes on Samsung devices (73% of sessions recorded with only 10% failures for this manufacturer).

contibutes ~ 0.15% crashrate (, - API23 +).

- - ?

+4
1

, , . . , , : Parcelable Parcel?

, , , , , , .

0

Source: https://habr.com/ru/post/1664307/


All Articles