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

Commit 5359de27 authored by Lee Shombert's avatar Lee Shombert
Browse files

Report the actual db config in dbinfo

'dumpsys dbinfo' fetches and reports the actual database
configuration.  The config is fetched by a new native API that is
entirely self-contained: it prepares a statement, executes it, and
finalizes it.  Any errors result in exceptions.

The native API can race against SQLiteConnection.dispose() (which
closes the connection); this would cause a segfault in the native API.
A new lock guards against this race.  The sqlite engine protects
against all other multi-threaded uses of the connection.

Bonus change: the pseudo-enums in DatabaseUtils now use an IntDef, to
make it easier to distinguish between use cases for basic and extended
statement types.

Tested with dumpsys dbinfo and verified that the AppOpsHistory
database showed the correct static configuration (WAL/FULL) as well as
the correct actual configuration (WAL/NORMAL).

Flag: android.database.sqlite.report_active_db_configuration
Bug: 444244330
Test: atest
 * FrameworksCoreTests:android.database
 * CtsDatabaseTestCases
Change-Id: I41b2962fc49753171855ba1d7bf49f6a8a7dd1a7
parent f9967f7a
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