Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f659d841 authored by Simon Wingrove's avatar Simon Wingrove Committed by Android (Google) Code Review
Browse files

Merge "Catch and log NetworkWatchlist database corruption" into main

parents 49391343 51cf245d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabaseCorruptException;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Environment;
@@ -204,6 +205,11 @@ class WatchlistReportDbHelper extends SQLiteOpenHelper {
            return false;
        }
        final String clause = WhiteListReportContract.TIMESTAMP + "< " + untilTimestamp;
        try {
            return db.delete(WhiteListReportContract.TABLE, clause, null) != 0;
        } catch (SQLiteDatabaseCorruptException e) {
            Slog.e(TAG, "Error deleting records", e);
            return false;
        }
    }
}