Loading core/java/android/database/sqlite/SQLiteConnection.java +2 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,8 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen } finally { execute(success ? "COMMIT" : "ROLLBACK", null, null); } } catch (SQLiteException ex) { throw ex; } catch (RuntimeException ex) { throw new SQLiteException("Failed to change locale for db '" + mConfiguration.label + "' to '" + newLocale + "'.", ex); Loading core/java/android/database/sqlite/SQLiteDatabase.java +8 −3 Original line number Diff line number Diff line Loading @@ -890,9 +890,14 @@ public final class SQLiteDatabase extends SQLiteClosable { try { try { openInner(); } catch (SQLiteDatabaseCorruptException ex) { } catch (RuntimeException ex) { if (SQLiteDatabaseCorruptException.isCorruptException(ex)) { Log.e(TAG, "Database corruption detected in open()", ex); onCorruption(); openInner(); } else { throw ex; } } } catch (SQLiteException ex) { Log.e(TAG, "Failed to open database '" + getLabel() + "'.", ex); Loading core/java/android/database/sqlite/SQLiteDatabaseCorruptException.java +16 −0 Original line number Diff line number Diff line Loading @@ -25,4 +25,20 @@ public class SQLiteDatabaseCorruptException extends SQLiteException { public SQLiteDatabaseCorruptException(String error) { super(error); } /** * @return true if a given {@link Throwable} or any of its inner causes is of * {@link SQLiteDatabaseCorruptException}. * * @hide */ public static boolean isCorruptException(Throwable th) { while (th != null) { if (th instanceof SQLiteDatabaseCorruptException) { return true; } th = th.getCause(); } return false; } } Loading
core/java/android/database/sqlite/SQLiteConnection.java +2 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,8 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen } finally { execute(success ? "COMMIT" : "ROLLBACK", null, null); } } catch (SQLiteException ex) { throw ex; } catch (RuntimeException ex) { throw new SQLiteException("Failed to change locale for db '" + mConfiguration.label + "' to '" + newLocale + "'.", ex); Loading
core/java/android/database/sqlite/SQLiteDatabase.java +8 −3 Original line number Diff line number Diff line Loading @@ -890,9 +890,14 @@ public final class SQLiteDatabase extends SQLiteClosable { try { try { openInner(); } catch (SQLiteDatabaseCorruptException ex) { } catch (RuntimeException ex) { if (SQLiteDatabaseCorruptException.isCorruptException(ex)) { Log.e(TAG, "Database corruption detected in open()", ex); onCorruption(); openInner(); } else { throw ex; } } } catch (SQLiteException ex) { Log.e(TAG, "Failed to open database '" + getLabel() + "'.", ex); Loading
core/java/android/database/sqlite/SQLiteDatabaseCorruptException.java +16 −0 Original line number Diff line number Diff line Loading @@ -25,4 +25,20 @@ public class SQLiteDatabaseCorruptException extends SQLiteException { public SQLiteDatabaseCorruptException(String error) { super(error); } /** * @return true if a given {@link Throwable} or any of its inner causes is of * {@link SQLiteDatabaseCorruptException}. * * @hide */ public static boolean isCorruptException(Throwable th) { while (th != null) { if (th instanceof SQLiteDatabaseCorruptException) { return true; } th = th.getCause(); } return false; } }