Loading
Disable WAL checkpoint from the finalizer
If SQLiteConnection.close() is called from the finalizer, disable WAL
checkpoints. WAL checkpoint can be IO intensive and can cause the
finalizer timeout to expire. Three things to note:
1. The finalizer is invoked only if the application has failed to
explicitly close the database, which is, itself, an error. This
change has no effect if the database is explicitly closed.
2. Even though there is no checkpoint, the WAL file remains intact
and no data is lost.
3. The effect of not checkpointing is the same as if the application
had crashed or had been killed. Which happens all the time.
Flag: android.database.sqlite.no_checkpoint_on_finalize
Bug: 397982577
Test: atest
* FrameworksCoreTests:android.database
* CtsDatabaseTestCases
Change-Id: I124b3ebbf2d3378108bee04a294200b198b64299