I am receiving a crash log from Samsung devices when trying to send a multipart SMS message, this is the line which causes the crash:
SmsManager.getDefault().sendMultipartTextMessage(phone, null, SmsManager.getDefault().divideMessage(message), null, null)
Where phone is a fully specified non-nullable phone number and message is a long String (up to 300 characters) with ASCI symbols only. The only thing probably worth noting about it is maybe that it contains \n\n for text separation.
Here is the crash log:
Fatal Exception: java.lang.NullPointerException
Attempt to invoke interface method 'java.util.Iterator java.lang.Iterable.iterator()' on a null object reference
android.os.Parcel.readException (Parcel.java:1699)
android.os.Parcel.readException (Parcel.java:1646)
com.android.internal.telephony.ISms$Stub$Proxy.sendMultipartTextForSubscriber (ISms.java:1719)
android.telephony.SmsManager.sendMultipartTextMessageInternal (SmsManager.java:576)
android.telephony.SmsManager.sendMultipartTextMessage (SmsManager.java:544)
I tried to look at the SmsManager source for the lines specified in the crash log, but to no avail - it seems that it has been modified by OEM.
This shouldn't be a permission issue either, since I check for SMS permission right before executing the sendMultipartTextMessage line.
The crash happened on Samsung Galaxy S6 and J530F phones. It has never been reported on anything other than those. And unfortunately I don't have a Samsung device to test this.
Has enyone encountered this issue? Thanks in advance!
from SmsManager crash on Samsung devices
No comments:
Post a Comment