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
We should always keep pool size of 1 for in-memory databases since every
:memory: db is separate from another.
Test: com.android.providers.contacts.util.UserUtilsTest
Bug: 64039907
Change-Id: If85af3eacfb5625036e29d44f88c1bebb338f46b
Idle connections are now closed 30 seconds after being returned to the
pool. In-memory databases and databased with attached databases
are exempt from closing idle connections.
The new behavior is enabled on all devices (temporarily).
Use "setprop persist.debug.sqlite.close_idle_connections 0" to disable
Test: manual - devices boots, no app crashes, auth(accounts.db) works
Test: database CTS tests + SQLiteConnectionPoolTest + run_newdb_perf_test.sh
Bug: 63398887
Change-Id: Idc11e49149292d219a15502c1707c40ef27e3ddb
This reverts commit 2df4e144a9.
It was causing failures in packages/apps/DocumentsUI tests
Bug: 63638102
Bug: 63154326
Change-Id: I51fb54f705f58f159f4fcc30bfed41ababcba950
Also dump lookaside config if it's different from the default.
Test: adb shell setprop debug.force_low_ram 1
adb shell stop/start
adb shell dumpsys meminfo system // no lookaside allocations
Bug: 62877322
Change-Id: I152dae9714e7e55f93af3311b7387a6ac816e8f6
[Cause of Defect]
In the ContentObserver callback procedure, the binder thread
has no sync mechanism with handler thread.
The ContentObserver#onChange method can get called after
ContentResolver#unregisterContentObserver called in the
very low probability.
Bug: https://issuetracker.google.com/issues/63154326
Test: manual - check https://github.com/nanjingdaqi/ContentObserverDemo
Change-Id: I0e3831eba7a9cc1a5bf0d30abe5dd0ec8259b0d4
Signed-off-by: daqi <daqi@xiaomi.com>
Modified SQLiteDatabase to allow passing lookaside configuration to its
static initializer. Encapsulated config in OpenParams and added an
overloaded version of openDatabase with the new parameter.
Configuration is changed in SQLiteConnection::nativeOpen, immediately
after opening the database since lookaside memory configuration can only
be changed when no connection is using it.
Added SQLiteOpenHelper.setLookasideConfig method that is called from
the constructor of the subclass.
Test: bit FrameworksCoreTests:android.database.DatabaseGeneralTest
Test: bit FrameworksCoreTests:android.database.SQLiteOpenHelperTest
Bug: 38499845
Change-Id: Ifb761229b43c89c090939030fc25b8c480b9b9e2
Auto-paging of cursors is being removed in favor of a support lib component.
Rationale:
1) Auto-paging as implemented has potential to negatively impact system health.
2) Similar functionality w/o system health concerns can be provided
specific to RecyclerView.
Test: Removed. CTS coverage updated.
Bug: 30927484
Change-Id: I43e62181d8ceeeba6265d44536967a2102751320
(cherry picked from commit 4677c2b7f0)
Auto-paging of cursors is being removed in favor of a support lib component.
Rationale:
1) Auto-paging as implemented has potential to negatively impact system health.
2) Similar functionality w/o system health concerns can be provided
specific to RecyclerView.
Test: Removed. CTS coverage updated.
Bug: 30927484
Change-Id: I43e62181d8ceeeba6265d44536967a2102751320
StatFs.restat() and the StatFs constructor can throw
IllegalArgumentException. This was not previously documented;
not all callers took this into account, for example:
http://r.android.com/251290
This CL adds documentation to those methods. It also adds
comments to two of the callers.
Separately from this CL, we may in addition consider adding
new API StatFs.checkedRestat() and StatFs.checkedCreate()
or similar that throw IOException; we cannot change the
existing constructor and method since they are public.
Test: Checked that "make" still completed successfully.
Change-Id: I6a0b3cb7718939408937c61de7c3b000b948fa59
Allow all client targeting Android O to assume paging
support for any provider.
Adds a new PageViewCursor that adapts an unpaged cursor
to a paged request.
Updates ContentProviderNative to perform wrapping on
unpaged results.
Bug: 30927484
Change-Id: I4e225dc16761793c85ef8a195bf049113c79cd20
Test: Added for new class. Run info @ frameworks/base/core/tests/coretests/README
SQLite's internal representation for booleans is an integer with a value
of 0 or 1, so without this check, boolean values obtained via
DatabaseUtils#cursorRowToContentValues will always return false.
Bug: 34365384
Test: demo app, cts
Change-Id: I6c0829c992252ca5ee16bd5eac48668507fd4089
Added a convenience mechanism to delete the whole database if it is of
a version that is so old that the application does not want to support
upgrading it. SQLiteOpenHelper now automatically deletes such a database
and creates a fresh one with the newest version provided. A callback
onBeforeDelete is added if the application wants to collect some data
from the db before it is deleted.
Test: Tested by upgrading contacts database using ContactsDatabaseHelper
Bug: 31559016
Change-Id: I3f924d247cdca2015c4244cc987de2538a086651
- Update the sqlite version info
- Describe how to get sqlite version info
- Remove reference to out-of-date Notepad sample
- Update sqlite3 folder location and add link to relevant documentation
Bug: 30833403
Bug: 17393931
Change-Id: Ic58e88a119919f43ed90a70c559da8eacef4ebe0
The documentation incorrectly states that, "[insertWithOnConflict
returns] the primary key of the existing row if the input param
'conflictAlgorithm' = CONFLICT_IGNORE". Unfortunately, SQLite does
not provide such functionality.
Close: https://code.google.com/p/android/issues/detail?id=13045
Signed-off-by: Steve Pomeroy <steve@staticfree.info>
(cherry picked from commit 8fc3144fa5)
Change-Id: I89e56428e612d667259744e2bc3df124e5a2aa0e