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.
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.