mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-20 05:08:26 +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.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.database.sqlite.SQLiteException;
|
||||||
import android.database.sqlite.SQLiteStatement;
|
import android.database.sqlite.SQLiteStatement;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -33,6 +34,8 @@ import java.util.StringTokenizer;
|
|||||||
|
|
||||||
public class SmsMigrator {
|
public class SmsMigrator {
|
||||||
|
|
||||||
|
private static final String TAG = SmsMigrator.class.getSimpleName();
|
||||||
|
|
||||||
private static void addEncryptedStringToStatement(Context context, SQLiteStatement statement,
|
private static void addEncryptedStringToStatement(Context context, SQLiteStatement statement,
|
||||||
Cursor cursor, MasterSecret masterSecret,
|
Cursor cursor, MasterSecret masterSecret,
|
||||||
int index, String key)
|
int index, String key)
|
||||||
@ -169,8 +172,16 @@ public class SmsMigrator {
|
|||||||
Cursor cursor = null;
|
Cursor cursor = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Uri uri = Uri.parse("content://sms/conversations/" + theirThreadId);
|
Uri uri = Uri.parse("content://sms/conversations/" + theirThreadId);
|
||||||
cursor = context.getContentResolver().query(uri, null, null, null, null);
|
|
||||||
|
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();
|
SQLiteDatabase transaction = ourSmsDatabase.beginTransaction();
|
||||||
SQLiteStatement statement = ourSmsDatabase.createInsertStatement(transaction);
|
SQLiteStatement statement = ourSmsDatabase.createInsertStatement(transaction);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user