Delete only corrupt databases

This commit is contained in:
M66B
2023-12-22 15:56:21 +01:00
parent 2c4eb99d6a
commit 33be622f3e
2 changed files with 4 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ package androidx.sqlite.db.framework
import android.content.Context
import android.database.DatabaseErrorHandler
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteDatabaseCorruptException
import android.database.sqlite.SQLiteException
import android.database.sqlite.SQLiteOpenHelper
import android.os.Build
@@ -204,7 +205,7 @@ internal class FrameworkSQLiteOpenHelper @JvmOverloads constructor(
}
// If callback exception is not an SQLiteException, then more certainly it is not
// recoverable.
if (cause !is SQLiteException) {
if (cause !is SQLiteDatabaseCorruptException) {
throw cause
}
} else if (openRetryError is SQLiteException) {