kopia lustrzana https://github.com/ryukoposting/Signal-Android
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 // FREEBIEfork-5.53.8
rodzic
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() {
|
||||||
|
|
Ładowanie…
Reference in New Issue