Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 80d8343a authored by Lee Shombert's avatar Lee Shombert
Browse files

Make SQLiteOpenHelper thread safe

Concurrent SQLiteOpenHelper instances is a common anti-pattern that
leads to SQLiteDatabase exceptions.  The specific problem occurs when
a database upgrade is triggered automatically inside the open helper.

This creates a lock for every database file managed by a
SQLiteOpenHelper.  The lock guards the code that opens a database and
optionally upgrades it.  This does not protect against code that might
access the database outside of a SQLiteOpenHelper.

Flag: android.database.sqlite.concurrent_open_helper
Bug: 335904370
Test: atest
 * CtsDatabaseTestCases
 * FrameworksCoreTests:android.database
Change-Id: I4d79375c44ca3170495fce6cd9d682cf21e62e2f
parent e302462c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment