mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-22 07:57:30 +00:00
Sometimes querying the APN DB throws this exception as well.
This commit is contained in:
parent
2397176d9e
commit
6bd0f35787
@ -29,6 +29,7 @@ import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientFormattingException;
|
||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||
import org.thoughtcrime.securesms.util.Trimmer;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
import ws.com.google.android.mms.InvalidHeaderValueException;
|
||||
import ws.com.google.android.mms.MmsException;
|
||||
@ -469,8 +470,8 @@ public class MmsDatabase extends Database {
|
||||
|
||||
public Cursor getCarrierMmsInformation(String apn) {
|
||||
Uri uri = Uri.withAppendedPath(Uri.parse("content://telephony/carriers"), "current");
|
||||
String selection = (apn == null || apn.trim().length() == 0) ? null : "apn = ?";
|
||||
String[] selectionArgs = (apn == null || apn.trim().length() == 0) ? null : new String[] {apn.trim()};
|
||||
String selection = Util.isEmpty(apn) ? null : "apn = ?";
|
||||
String[] selectionArgs = Util.isEmpty(apn) ? null : new String[] {apn.trim()};
|
||||
|
||||
return context.getContentResolver().query(uri, null, selection, selectionArgs, null);
|
||||
}
|
||||
|
@ -97,6 +97,9 @@ public class MmsCommunication {
|
||||
} catch (SecurityException se) {
|
||||
Log.w("MmsCommunication", se);
|
||||
return getLocallyConfiguredMmsConnectionParameters(context);
|
||||
} catch (IllegalArgumentException iae) {
|
||||
Log.w("MmsCommunication", iae);
|
||||
return getLocallyConfiguredMmsConnectionParameters(context);
|
||||
} finally {
|
||||
if (cursor != null)
|
||||
cursor.close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user