From a9051d327ea41f60ad38ec8a51cd27e5ca325062 Mon Sep 17 00:00:00 2001 From: "muzbit.kim" Date: Tue, 6 May 2014 10:20:12 +0900 Subject: Add handling SQLiteDatabaseCorruptException. When SQLiteDatabaseCorruptException occurred on execute() or executeForString(), DefaultDatabaseErrorHandler.onCorrupt() is not to be called. So, Malformed DB file can't be deleted. Because, Instead SQLiteDatabaseCorruptException, code is throwing SQLiteException. On boot time, system can't open DB file and it throws RuntimeException. This causes infinite reset. So, I modified to throw SQLiteDatabaseCorruptException. Change-Id: I125b69d62acc4c0690b8dd17d4e14b49be141095 Signed-off-by: muzbit.kim --- core/java/android/database/sqlite/SQLiteConnection.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/java') diff --git a/core/java/android/database/sqlite/SQLiteConnection.java b/core/java/android/database/sqlite/SQLiteConnection.java index 3cda39a..6ab9637 100644 --- a/core/java/android/database/sqlite/SQLiteConnection.java +++ b/core/java/android/database/sqlite/SQLiteConnection.java @@ -387,6 +387,8 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen } finally { execute(success ? "COMMIT" : "ROLLBACK", null, null); } + } catch (SQLiteDatabaseCorruptException ex) { + throw ex; } catch (RuntimeException ex) { throw new SQLiteException("Failed to change locale for db '" + mConfiguration.label + "' to '" + newLocale + "'.", ex); -- cgit v1.1