|
|
@ -54,11 +54,10 @@ public class Fts4DbHelper extends SQLiteOpenHelper {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static SQLiteDatabase getInstance(Context context) {
|
|
|
|
static SQLiteDatabase getInstance(Context context) {
|
|
|
|
if (instance == null) {
|
|
|
|
boolean has = context.getDatabasePath(DATABASE_NAME).exists();
|
|
|
|
if (!context.getDatabasePath(DATABASE_NAME).exists()) {
|
|
|
|
if (instance == null || !has) {
|
|
|
|
Fts5DbHelper.delete(context);
|
|
|
|
if (!has)
|
|
|
|
DB.getInstance(context).message().resetFts();
|
|
|
|
DB.getInstance(context).message().resetFts();
|
|
|
|
}
|
|
|
|
|
|
|
|
instance = new Fts4DbHelper(context);
|
|
|
|
instance = new Fts4DbHelper(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return instance.getWritableDatabase();
|
|
|
|
return instance.getWritableDatabase();
|
|
|
|