Delete FTS journal file

pull/209/head
M66B 2 years ago
parent 08185fdd46
commit 28832bcbf2

@ -31,6 +31,7 @@ import android.text.TextUtils;
import androidx.preference.PreferenceManager;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -272,6 +273,11 @@ public class Fts4DbHelper extends SQLiteOpenHelper {
}
static void delete(Context context) {
context.getDatabasePath(DATABASE_NAME).delete();
File db = context.getDatabasePath(DATABASE_NAME);
for (File file : db.getParentFile().listFiles())
if (file.getName().startsWith(DATABASE_NAME)) {
Log.i("FTS delete=" + file);
file.delete();
}
}
}

@ -27,6 +27,7 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.text.TextUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -252,6 +253,11 @@ public class Fts5DbHelper extends SQLiteOpenHelper {
}
static void delete(Context context) {
context.getDatabasePath(DATABASE_NAME).delete();
File db = context.getDatabasePath(DATABASE_NAME);
for (File file : db.getParentFile().listFiles())
if (file.getName().startsWith(DATABASE_NAME)) {
Log.i("FTS delete=" + file);
file.delete();
}
}
}

Loading…
Cancel
Save