mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-28 09:50:46 +00:00
Prevent crash from strange SQLite error
Full fix may require packaging and using our own SQLite via JNI. Needs further investigation. Fixes #2506 Closes #2843 // FREEBIE
This commit is contained in:
parent
0ff99258ac
commit
6c59eb052e
@ -20,6 +20,7 @@ import android.content.Context;
|
|||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
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.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@ -89,9 +90,13 @@ public class ApnDatabase {
|
|||||||
Util.copy(context.getAssets().open(ASSET_PATH, AssetManager.ACCESS_STREAMING),
|
Util.copy(context.getAssets().open(ASSET_PATH, AssetManager.ACCESS_STREAMING),
|
||||||
new FileOutputStream(dbFile));
|
new FileOutputStream(dbFile));
|
||||||
|
|
||||||
|
try {
|
||||||
this.db = SQLiteDatabase.openDatabase(context.getDatabasePath(DATABASE_NAME).getPath(),
|
this.db = SQLiteDatabase.openDatabase(context.getDatabasePath(DATABASE_NAME).getPath(),
|
||||||
null,
|
null,
|
||||||
SQLiteDatabase.OPEN_READONLY | SQLiteDatabase.NO_LOCALIZED_COLLATORS);
|
SQLiteDatabase.OPEN_READONLY | SQLiteDatabase.NO_LOCALIZED_COLLATORS);
|
||||||
|
} catch (SQLiteException e) {
|
||||||
|
throw new IOException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Apn getCustomApnParameters() {
|
private Apn getCustomApnParameters() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user