Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit f7f440e227720267e583e18f2a83133c55f449d9
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Feb 03 11:02:49 2022
Add SQLite open retry and recovery mechanism
Bug: 215592732
Test: OpenHelperRecoveryTest
Relnote: Add an API in SupportSQLite's configuration to allow data loss during the recovery mechanism.
Change-Id: I1b83020d4b49cf05b3a64617dceb6c62d04ff663
A sqlite/sqlite-framework/src/main/java/androidx/sqlite/util/SneakyThrow.java
A sqlite/sqlite-framework/src/androidTest/java/androidx/sqlite/db/framework/OpenHelperRecoveryTest.kt
M sqlite/sqlite/src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java
M sqlite/sqlite-framework/build.gradle
M sqlite/sqlite/api/public_plus_experimental_current.txt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java
M sqlite/sqlite-framework/src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteOpenHelper.java
M sqlite/sqlite/api/api_lint.ignore
M sqlite/sqlite-framework/src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory.java
M sqlite/sqlite/api/restricted_current.txt
M sqlite/sqlite/api/current.txt
https://android-review.googlesource.com/1971361
Branch: androidx-main
commit f7f440e227720267e583e18f2a83133c55f449d9
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Feb 03 11:02:49 2022
Add SQLite open retry and recovery mechanism
Bug: 215592732
Test: OpenHelperRecoveryTest
Relnote: Add an API in SupportSQLite's configuration to allow data loss during the recovery mechanism.
Change-Id: I1b83020d4b49cf05b3a64617dceb6c62d04ff663
A sqlite/sqlite-framework/src/main/java/androidx/sqlite/util/SneakyThrow.java
A sqlite/sqlite-framework/src/androidTest/java/androidx/sqlite/db/framework/OpenHelperRecoveryTest.kt
M sqlite/sqlite/src/main/java/androidx/sqlite/db/SupportSQLiteOpenHelper.java
M sqlite/sqlite-framework/build.gradle
M sqlite/sqlite/api/public_plus_experimental_current.txt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java
M sqlite/sqlite-framework/src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteOpenHelper.java
M sqlite/sqlite/api/api_lint.ignore
M sqlite/sqlite-framework/src/main/java/androidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory.java
M sqlite/sqlite/api/restricted_current.txt
M sqlite/sqlite/api/current.txt
Description
Currently, androidx.sqlite has a small delete-db-and-retry logic that relies on the framework's
onCorruption
signal, but this has not been enough to detect the various cases in which the database fails to open. This bug itends to improve such detection and furthermore apply some extra workarounds to common issue during DB creation / opening. Such as missing DB folder, file permissions, corrupted files, etc. The idea is to make it such that androidx.sqlite tries as much as possible to return a good opened and ready to use database instead of attempting once and letting the user (app) try again.