summaryrefslogtreecommitdiff
path: root/core/java/android/content/ContentValues.java
Commit message (Collapse)AuthorAgeFilesLines
* Add @Nullable annotation to the parameter of Object.equals() methods.Roman Kalukiewicz2020-10-151-1/+1
| | | | | | | | | | | | | | | | | | Those annotations could be inferred by some tools (like Kotlin), but the https://checkerframework.org/ doesn't check inherited annotations complaining about all equals() invocations that get nullable argument. The change was generated by running find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /' in the frameworks/base directory and by automatically adding and formatting required imports if needed. No manual edits. Bug: 170883422 Test: Annotation change only. Should have not impact. Exempt-From-Owner-Approval: Mechanical change not specific to any component. Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-2/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I6ab53570aca580fbee1fcc927871caa09780f58f
* Public APIs for ID-specific Uris, misc items.Jeff Sharkey2019-08-221-2/+0
| | | | | | | | | | | | | | We have getContentUri() for entire collections of items, but we only have ID-specific overloads for some of the MediaStore classes; let's get them all added for consistency. Remove primary/secondary directory logic, which was replaced by new RELATIVE_PATH column before Q launched. Bug: 137890034 Test: atest --test-mapping packages/providers/MediaProvider Exempt-From-Owner-Approval: trivial API refactoring Change-Id: Iae4e7fe57adff071c35af459e31223a1fd05fef2
* Expand ContentProviderOperation to support call().Jeff Sharkey2019-08-081-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | ContentProviderOperation has long supported basic operations like insert(), update(), and delete(), but it was never extended to support the general-purpose call() method. This change adds support for call(), including configuration of the extras Bundle using back-references to other operations. In addition, the output Bundle from call() can be used for back-references from other operations. Clean up how back-references are handled internally; we now store either a literal value in each slot, or an explicit BackReference instance which we can "instanceof" check to resolve when needed. Also add withExceptionAllowed() capability, which can be used to catch and report the failure of a single operation while allowing any subsequent operations to proceed. Adds various nullability annotations to reflect the behavior of all existing logic. Bug: 131598520 Test: atest android.content.cts.ContentProviderOperationTest Test: atest android.content.cts.ContentProviderResultTest Change-Id: I1744bf8fc1ad048aa96460d487c2867c4c81d7b3
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | For packages: android.content.res android.content.pm.split android.content.pm.permission android.content.pm.dex android.content.pm android.content.om android.content 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: Ia79256a3d04e16dd78331a61af0dcddc5fc1599b
* Throw exceptions expected by CTS.Jeff Sharkey2018-08-081-0/+5
| | | | | | Bug: 111855029 Test: atest android.content.cts.ContentValuesTest Change-Id: If05d9d0f0960bf890af742fc9c13926bbc5eb4b6
* Extend SQLiteQueryBuilder for update and delete.Jeff Sharkey2018-07-131-52/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | Developers often accept selection clauses from untrusted code, and SQLiteQueryBuilder already supports a "strict" mode to help catch SQL injection attacks. This change extends the builder to support update() and delete() calls, so that we can help secure those selection clauses too. Extend it to support selection arguments being provided when appending appendWhere() clauses, meaning developers no longer need to manually track their local selection arguments along with remote arguments. Extend it to support newer ContentProvider.query() variant that accepts "Bundle queryArgs", and have all query() callers flow through that common code path. (This paves the way for a future CL that will offer to gracefully extract non-WHERE clauses that callers have tried smashing into their selections.) Updates ContentValues to internally use more efficient ArrayMap. Bug: 111268862 Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java Change-Id: I60b6f69045766bb28d2f21a32c120ec8c383b917
* Replace possibly-expensive size() == 0 with isEmpty()Mike Tsao2017-03-241-0/+11
| | | | | | Bug: 36596458 Change-Id: Ieb0ea65be056bb8ce0613280e6213c330fbf783c Test: added ContentValuesTest
* Also parse "1" as true for ContentValues#getAsBooleanMichael Wright2017-01-191-1/+5
| | | | | | | | | | 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
* ContentValues: improve documentationSteve Pomeroy2016-05-121-11/+13
| | | | | | | Correct and clarify the documentation for ContentValues. Change-Id: Iddf54da093e97c32da2568eab8802b1b2715303b Signed-off-by: Steve Pomeroy <steve@staticfree.info>
* Convert Numbers to Booleans when calling getAsBoolean().Jeff Hamilton2010-09-171-0/+2
| | | | Change-Id: I31ad0bccd422f8e76cf37d500a93744cc23d4859
* Fix the documentation of ContentValues.Jeff Hamilton2010-08-251-0/+4
| | | | | Bug: 2172562 Change-Id: If7752b937dabc7238723787bb0aa5c348406e28b
* add public method in ContentValues to return set of all keysVasu Nori2010-08-021-0/+9
| | | | | | why not this method? it is useful and cheap. Change-Id: I5db96d149b13d26b5359b52515a8eabf033eb000
* Small speedup in getAsString and comment fixDaniel Lehmann2010-03-231-2/+2
| | | | Change-Id: I19744983bbc0f4b9060de326bd539137e373415b
* improve logging of errors when trying to resolve backrefs http://b/2371475Fred Quintana2010-02-191-26/+26
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+501
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-501/+0
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+501