forked from upstream-mirrors/quik
Catch error thrown while trying to send message, improve debugging
This commit is contained in:
@@ -33,8 +33,7 @@ public class MmsFileProvider extends ContentProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
|
||||
String sortOrder) {
|
||||
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
|
||||
// Don't support queries.
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -304,13 +304,18 @@ class MessageRepositoryImpl @Inject constructor(
|
||||
if (prefs.delivery.get()) pendingIntent else null
|
||||
}
|
||||
|
||||
smsManager.sendMultipartTextMessage(
|
||||
message.address,
|
||||
null,
|
||||
parts,
|
||||
ArrayList(sentIntents),
|
||||
ArrayList(deliveredIntents)
|
||||
)
|
||||
try {
|
||||
smsManager.sendMultipartTextMessage(
|
||||
message.address,
|
||||
null,
|
||||
parts,
|
||||
ArrayList(sentIntents),
|
||||
ArrayList(deliveredIntents)
|
||||
)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
Timber.w(e, "Message body lengths: ${parts.map { it.length }}")
|
||||
markFailed(message.id, Telephony.MmsSms.ERR_TYPE_GENERIC)
|
||||
}
|
||||
}
|
||||
|
||||
override fun cancelDelayedSms(id: Long) {
|
||||
|
||||
Reference in New Issue
Block a user