diff options
author | muzbit.kim <muzbit.kim@lge.com> | 2014-05-06 10:20:12 +0900 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-10-25 21:53:01 -0700 |
commit | a9051d327ea41f60ad38ec8a51cd27e5ca325062 (patch) | |
tree | 66b5590d50ab4bb24dd65b9c13d1ca1b69e18a05 /core/java/android/database | |
parent | c34a41e5628652756415083b5ab8f05a6a4394a0 (diff) | |
download | frameworks_base-a9051d327ea41f60ad38ec8a51cd27e5ca325062.zip frameworks_base-a9051d327ea41f60ad38ec8a51cd27e5ca325062.tar.gz frameworks_base-a9051d327ea41f60ad38ec8a51cd27e5ca325062.tar.bz2 |
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 <muzbit.kim@lge.com>
Diffstat (limited to 'core/java/android/database')
-rw-r--r-- | core/java/android/database/sqlite/SQLiteConnection.java | 2 |
1 files changed, 2 insertions, 0 deletions
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); |