| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 331be9a6431d6489f8d1e1b80cb510d0ee073c50.
Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).
Original commit message:
Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()
This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).
A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.
Bug: 195622897
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
|
| |
|
|
|
|
|
|
| |
This reverts commit 90bb3709dc75f7e44914222114752de5bce133d4.
Reason for revert: b/214053959
Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()
This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).
A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.
Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
|
| |
|
|
|
|
|
|
|
|
| |
Refactoring to avoid paying the cost of extra StringBuilder that are
quickly disposed.
Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Icd914a63cdadf8123c1e5a5073f85245f0791f0b
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An earlier CL with benchmarks has shown that sending strings as UTF-8
is 50% faster for US-ASCII strings, and still 68% faster for complex
strings referencing higher Unicode planes. (So an improvement in
both cases!)
Since code across the OS still makes heavy assumptions about Parcel
strings typically being UTF-16, we need to carefully migrate
Parcelables by hand, which is what this CLs begins doing.
This is a purely mechanical refactoring with no functional changes.
Bug: 154436100
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ia9e581efd7c40269342b7528ca07363deb843c0f
|
| |
|
|
|
|
|
|
|
|
| |
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 \
git diff HEAD^ HEAD | grep '^[+-][^+-]' | grep -v '.import'
Change-Id: I853372f3c6fef905553bb31be4f1bb48df735f7a
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Now that we allow extras in more ContentProvider calls, we should
also allow CPO to define and pass those extras into a provider. We
recently added flexible utility methods like withExtraBackReference(),
so this change starts passing those values to insert, update, delete,
and query.
Bug: 131643582
Test: atest CtsContentTestCases
Change-Id: I4a445c061bbd84f45bdb80d336a2d0928b7fbe9c
|
| |
|
|
|
|
|
|
| |
We still need to populate mValues when the ContentValues was empty.
Bug: 139356941
Test: atest --test-mapping packages/providers/ContactsProvider
Change-Id: Ice90afbb7994e1a1d10076a2aa48b4d1187abe9f
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
No behavior changes. This paves the way for a future CL that is
will be adding a handful of new APIs.
Bug: 131598520
Test: atest android.content.cts.ContentProviderOperationTest
Test: atest android.content.cts.ContentProviderResultTest
Change-Id: I1a6f53e79009ba88b13844a6c8ca8c09e33ee5b2
|
| |
|
|
|
|
| |
Bug: 113518608
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I2f67b8016e6057cfd022899bbfba32c3db3a12aa
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some cases, the supplier of ContentProviderOperation is okay
if certain operations fail, and they'd like ContentProviderResult
to tell them about the failures instead of aborting the remainder
of the transaction.
Start using this for ModernMediaScanner, where we probably raced
with someone when building an UPSERT-style operation. We'll
pick up any changes to those files during the next scan.
Bug: 128494336
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: Ida8230ff2bbb3bab56eb83928e49e7097bfbc9fd
|
| |
|
|
|
|
|
|
|
| |
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
|
| |\
| |
| |
| |
| |
| | |
am: 003587b9a4
Change-Id: I056261f069ed679ed8a03bfc0791bfe59a405361
|
| | |\
| | |
| | |
| | |
| | |
| | | |
am: 219f7dcb66
Change-Id: Id38a4b2e21285d5d5e2a2124d76885febd3441c6
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
through /bluetooth directory
amending through /content directory
Test: make ds-docs
Bug: 117494359
Change-Id: I751e15d60f0b9cc441998b27560050bf62994fef
Exempt-From-Owner-Approval: Docs-only change
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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: Ie932bb108f8e21aad8576e444d43e7a553a4d128
Merged-In: Ia79256a3d04e16dd78331a61af0dcddc5fc1599b
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The path-permission element offers prefix or regex style matching of
paths, but most providers internally use UriMatcher to decide what
to do with an incoming Uri.
This causes trouble because UriMatcher uses Uri.getPathSegments(),
which quietly ignores "empty" paths. Consider this example:
<path-permission android:pathPrefix="/private" ... />
uriMatcher.addURI("com.example", "/private", CODE_PRIVATE);
content://com.example//private
The Uri above will pass the security check, since it's not
technically a prefix match. But the UriMatcher will then match it
as CODE_PRIVATE, since it ignores the "//" zero-length path.
Since we can't safely change the behavior of either path-permission
or UriMatcher, we're left with recovering these shady paths by
trimming away zero-length paths.
Bug: 112555574
Test: atest android.appsecurity.cts.AppSecurityTests
Test: atest FrameworksCoreTests:android.content.ContentProviderTest
Change-Id: Ibadbfa4fc904ec54780c8102958735b03293fb9a
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Bug: 36596458
Change-Id: Ieb0ea65be056bb8ce0613280e6213c330fbf783c
Test: added ContentValuesTest
|
| |
|
|
|
| |
Bug: 21343769
Change-Id: Ia122b58785cf98f16664f82eb00a1f6bd9366885
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CHANGE
isInsert, isDelete, isUpdate, isAssertQuery
JUSTIFICATION
The use of getType() in lots of unit tests means that
ContentProviderOperation#getType() can't practically be
removed.
Why not make it public? This allows 3p to use getType() in
unit tests. Plus it allows the unbundled contacts app
to continue using getType() in order to handle TYPE_INSERT
specially, without needing to awkwardly pass isInsert values
around.
Bug: 18777272
Change-Id: I6be5f325bbf6fbeb7817e9b1f7fa1a1ae2002e0b
|
| |
|
|
|
|
| |
This reverts commit 9986f8e85a095320afbdebb2d0dfee9a2e19e510.
Change-Id: Icdcedf485a67fff4ab5e6bab9cc3e82aa7cc8760
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CHANGE
isInsert, isDelete, isUpdate, isAssertQuery
JUSTIFICATION
The use of getType() in lots of unit tests means that
ContentProviderOperation#getType() can't practically be
removed.
Why not make it public? This allows 3p to use getType() in
unit tests. Plus it allows the unbundled contacts app
to continue using getType() in order to handle TYPE_INSERT
specially, without needing to awkwardly pass isInsert values
around.
Bug: 18777272
Change-Id: I3265193cda0c9405f6df896cd96a10df7225445a
|
| |
|
|
|
|
|
|
|
|
| |
When an intent is sent to another profile:
For content uris contained in this intent:
The userId of the source user is added to the userInfo part.
The ActivityManagerService has been modified to resolve resources in the user specified by the uri.
The user id to which the uri belongs to is stored in the UriPermission.
Change-Id: I43dc76895aba692bf148d276253aeaf9c75fce34
|
| |
|
|
| |
Change-Id: Ifbf422a2eb177858813d118f03ceddcd807e73b4
|
| |
|
|
|
| |
This will dump out the contents of the operation in some error cases
to make debugging easier.
|
| |
|
|
| |
Fixes http://b/2226007
|
| |
|
|
|
|
|
| |
passed in array.
Bug: 2221947
Change-Id: I3b7d5cbef61777d76ca7fc0d7c91c44553e609a9
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When performing a set of batch operations, some callers need
to enforce that a query has specific values. For example,
when persisting edited Contact values, we need to assert
that the RawContacts.VERSION matches the version we read out
through queryEntities().
This change adds a new TYPE_ASSERT that uses withValues()
and withSelection(), and checks all values when applying the
batch operation, bailing if any values don't match.
|
| |
|
|
| |
- change the ContentProviderOperation selection backref store the backref as a long instead of as a string
|
| |
|
|
|
|
|
|
|
|
| |
Internally, ContentProviderOperation maintains a "type",
which correspond to builder methods, such as "newInsert()".
Unit tests often need to assert which operations are
being built, so this change adds a getType() accessor and
esposes the internal constants used. They are marked with
@hide so they are not exposed in the public API.
|
| | |
|
| |
|
|
| |
- add the group membership common kind as well as some IM utilities to the ContactsContract
|
| |
|
|
|
|
| |
- change the applyBatch to take an ArrayList rather than an []
- change Entity to be a final flass that contains ContentValues
- remove the ability to update/insert Entities by a ContentProviderOperation
|
| | |
|
| |
|