Test: change pin and immediately crash the kernel with
adb shell 'su root sh -c "echo c >/proc/sysrq-trigger"' and boot
Bug: 112175067
Change-Id: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
(cherry picked from commit 50e00c8dc4)
Merged-in: Ia5f43f3118e2297fbea43c805ef2f4577bf8a9bf
Otherwise, Metalava based android_test_current.jar doesn't contain
SQLiteDebug.class which caused build failure on:
out/target/common/obj/APPS/CtsDatabaseTestCases_intermediates/classes-full-debug.jar
Test: CtsDatabaseTestCases
Bug: 77543575
Change-Id: Ied9948e962fb7a81e56be0360cb94b0c318ad14d
Merged-In: Ied9948e962fb7a81e56be0360cb94b0c318ad14d
(cherry-picked from 6fe565e441)
Exempt-From-Owner-Approval: Cherry-picked a CL from git_master, and owner just agreed to use Exempt-From tag.
For packages:
android.database.sqlite
android.database
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: I0da613d00611e89e49bf73c9ffe35700818efc6b
Merged-In: I2bcc7f0eee31a1775dd7a5dd0f291d0d37bc1292
setSynchronousMode is now applicable to any journal mode.
This can be useful for apps that want to use stricter durability
settings for their database.
Test: android.database.sqlite.cts.SQLiteDatabaseTest
Bug: 86953240
Change-Id: I7dbaa6d0bc0975da8067e87b402f63f51b4add10
If set, Compatibility WAL will not be used.
Currently this flag is set if SQLiteOpenHelper.setWriteAheadLogging(false)
is called before opening the database. Previously this call was ignored
since ENABLE_WRITE_AHEAD_LOGGING flag is only set when setWriteAheadLogging(true)
Test: CtsDatabaseTestCases
Bug: 74116447
Change-Id: Ic486e178b9da5d747840be739303a2685b91f35b
Using the new constructor can be difficult as it requires an app to
make a decision which version of constructor to use before instantiating
the object. By adding setOpenParams method, apps can keep the old
structure of the code and only add API level check after instantiating
a helper object.
Test: SQLiteOpenHelperTest
Bug: 70863722
Change-Id: I1705dd790e3549d0d8e75eb33b1d9b5bdadcb3c9
Add @GuardedBy for simple functions that require a single lock
and are named XYZLocked.
Bug: 73000847
Test: m
Test: m javac-check-framework RUN_ERROR_PRONE=true
Change-Id: Icb5114fea2ff2385e1cc7511121026099e05c0ee
The majority of Manager-style classes already use Context.getUserId()
when making calls into the OS, so clean up the remaining callers to
unify behind this strategy.
This gives @SystemApi developers a nice clean interface to interact
across user boundaries, instead of manually adding "AsUser" or
"ForUser" method variants, which would quickly become unsustainable.
Test: builds, boots
Bug: 72863821
Exempt-From-Owner-Approval: trivial changes
Change-Id: Ib772ec4438e57a2ad4950821b9432f9842998451
In system_server, it should be deactivated until InstallSystemProviders
is finished.
Test: SQLiteCompatibilityWalFlagsTest
Test: setting put global ... + verify that dumpsys dbinfo has the new flag
Bug: 70226732
Bug: 70517616
Change-Id: Iec6a5e61a5d7e4cc0ac602f2b630357c54bb4456
Added Settings.Global.SQLITE_COMPATIBILITY_WAL_FLAGS -
configuration flags for SQLite Compatibility WAL. Encoded as a key-value
list, separated by commas. E.g.:
compatibility_wal_supported=true, wal_syncmode=OFF
SQLiteCompatibilityWalFlags caches the value of
SQLITE_COMPATIBILITY_WAL_FLAGS on first access and keeps it through
the lifetime of the process for consistent behavior across all
connections.
Test: SQLiteCompatibilityWalFlagsTest
Test: setting put global ... + verify that dumpsys dbinfo has the new flag
Bug: 70226732
Bug: 70517616
Change-Id: Ifacbf5908c83351ebe5dea676eeb716af039fb14
If DDL statement is executed on one connection, the schema change is
not always visible to other connections due to sqlite3_column_count()
API limitation. We have to close secondary connections to prevent the
issue.
Test: cts/SQLiteOpenHelperTest
Bug: 33695159
Change-Id: I862da71ecec5b1edc880dbfadf22efb2274ca10a
The android.database.sqlite package summary page now mentions the
versions of SQLite that are available on Android devices running Oreo
(API level 26) and API level 27.
Test: make ds-docs -j16
Bug: 69106585
Change-Id: I77a323c58343fa978ade5397d613566ba25f00c2
Added setJournalMode/setSynchronousMode. These methods control
journal/syncrhonous mode when ENABLE_WRITE_AHEAD_LOGGING flag is not set
Bug: 33044236
Test: manual + CtsDatabaseTestCases
Change-Id: Iffef75f6941030aae5ab3e239cd65550515f5fe0
In this mode, only database journal mode will be changed, connection pool
size will still be limited to a single connection.
If enabled, compatibility WAL mode will be used if an app hasn't explicitly
requested journal mode, by calling disable/enableWriteAheadLogging.
Compatibility WAL mode is controlled by debug.sqlite.use_compatibility_wal
property and db_use_compatibility_wal config resource.
Impact on write performance:
On ext4, with WAL, there is approx 300% increase in speed of update operations
On f2fs, with WAL, there is approx 5% increase in speed of update operations
Impact on number of writes:
On ext4, switching to WAL reduces the number of writes by approx 50%.
On f2fs, switching to WAL increases the number of writes by approx 15%.
Test: CtsDatabaseTestCases
Test: manual, running device
Bug: 33044236
Change-Id: Iaffb5651df39d8c9f710d7dbbe174f9c0d8a3186
Otherwise it can cause issues in apps depending on transient state.
Test: manual
Bug: 63398887
Bug: 65220630
Change-Id: I0806693e05e2e61035aee0b108e31f8bcc8b1a0b
The former aborts the current transaction, the latter restores the
state to a specified savepoint.
Test: CtsDatabaseTestCases
Test: DatabaseGeneralTest
Bug: 36957161
Change-Id: Ia0b189e8aac4687f10d8fbc07143a452f5f719c9
Internal compatibility testing didn't reveal any issues related to it.
Rationale to not make it specific to low-ram:
1) Consistent behavior from app perspective. close_idle_connections
is a behavioural change and may affect apps relying on undocumented
behavior of connection pooling. Developers can detect problems
without testing on low-ram device
2) Closing idle connections is especially important in WAL mode.
Disabling this feature would become an issue if more apps are
switching to WAL and we would need to re-enable this optimization.
Test: n/a
Bug: 63398887
Change-Id: I1b431f44daa2d337aad7f12f8e1409ae3143ded0
SQLiteDatabase openDatabase -- should take File for first parameter
instead of a String path
SQLiteDatabase.OpenParams.Builder -- make sure the javadocs says what
the default openFlags is and default idle connection timeout
SQLiteDatabase createInMemory -- throw if it has trouble instead of
returning null.
Test: cts/SQLiteDatabaseTest
Bug: 64331777
Bug: 64331778
Bug: 64330914
Change-Id: Ibecf4f4a6498795f9a5d12b94b77481e5745b523
It allows apps to set time SQLite connection is allowed to be idle
before it is closed and removed from the pool.
Test: manual + DatabaseGeneralTest
Bug: 63398887
Change-Id: Ie09eeb4dc2b9e52ba67d9355b1f9bd869b148613
Otherwise it's not clear what is causing the issue (e.g. no columns,
case sensitivity issue or a table prefix etc.)
Bug: 62431773
Test: manual
Change-Id: I81d1f420b70a2248a9b132147cda72c2417dc46b