mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Catch exception strangely thrown by system query from Sony device.
Fixes #4309 // FREEBIE
This commit is contained in:
parent
ea4def7ea1
commit
40108d5276
@ -19,6 +19,7 @@ package org.thoughtcrime.securesms.database;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteException;
|
||||
import android.database.sqlite.SQLiteStatement;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
@ -33,6 +34,8 @@ import java.util.StringTokenizer;
|
||||
|
||||
public class SmsMigrator {
|
||||
|
||||
private static final String TAG = SmsMigrator.class.getSimpleName();
|
||||
|
||||
private static void addEncryptedStringToStatement(Context context, SQLiteStatement statement,
|
||||
Cursor cursor, MasterSecret masterSecret,
|
||||
int index, String key)
|
||||
@ -169,8 +172,16 @@ public class SmsMigrator {
|
||||
Cursor cursor = null;
|
||||
|
||||
try {
|
||||
Uri uri = Uri.parse("content://sms/conversations/" + theirThreadId);
|
||||
cursor = context.getContentResolver().query(uri, null, null, null, null);
|
||||
Uri uri = Uri.parse("content://sms/conversations/" + theirThreadId);
|
||||
|
||||
try {
|
||||
cursor = context.getContentResolver().query(uri, null, null, null, null);
|
||||
} catch (SQLiteException e) {
|
||||
/// Work around for weird sony-specific (?) bug: #4309
|
||||
Log.w(TAG, e);
|
||||
return;
|
||||
}
|
||||
|
||||
SQLiteDatabase transaction = ourSmsDatabase.beginTransaction();
|
||||
SQLiteStatement statement = ourSmsDatabase.createInsertStatement(transaction);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user