The constants will be used by phonesky and CTS
to replace hardcoded values.
Bug: 194981157
Test: m
Change-Id: I4567334be554055ef2a5c20ef7160d991674cb9e
Uses reflection to read all of the getters for each of the data classes
and finds their setters to input test data, serialize it, deserialize
it, and compare the before and after values.
Also records all of the methods available in the class, to ensure that
any new fields/methods are caught by the test.
Bug: 178852754
Test: atest com.android.server.pm.test.parsing.parcelling
Change-Id: I642fd43a3ff2e5675129f0f4ad3646c97e3f0e22
AttributionSource checks calling UID on unparcel (so the check is not
necessary), and some ContentProviders may clear calling identity.
Test: Manual
Fixes: 188755312
Change-Id: If629eea3ba8c1a57fd4b7aff0fec2c0acb5f69be
When deciding if an intent is "leaving" the package, consider both
Intent.setComponent() and Intent.setPackage().
Bug: 195405741
Test: manual
Change-Id: I3c9460579242dcd874f3bb85fad46e1273306baa
This reverts commit 8d6900e011.
Reason for revert: The UIDs in this CL are Linux UIDs, which are never
negative. The @UserIdInt annotation is incorrect and the bypass()
override is unnecessary. See the comments on ag/15339446 for another
instance of this issue.
Change-Id: I79ccbb40c3f0ab1a3bb48f55da5a72696d4fb2b1
The system is overwhelmed by an enormous label string returned by
the load label api. This cl truncates the label string if it exceeds
the maximum safe length.
Bug: 67013844
Test: atest PackageManagerTest
Change-Id: Ia4d768cc93a47cfb8b6f7c4b6dc73abd801809bd
Some constants or utils in the PackageParser are still used by the
other classes. This CL moves them into the individual class.
Bug: 174723245
Test: m docs
Test: atest -p core/java/android/content/pm \
services/core/java/com/android/server/pm
Change-Id: I9b733c8e70ace583055b959daa1cfb5a132ee4a4
Parcel implementation would crash the system server otherwise.
Any exception is OK as it'll cause the cache to be invalidated.
Crash is not OK.
Bug: 194632313
Fixes: 194632313
Test: atest PackageParserCacheHelperTest
Change-Id: I58a4496b4646e172e6c3aee9ea17854a7ef55eaa
In Intent.java:
* Clarifies userId vs. UserHandle vs. uid.
* Fixes javadoc links to EXTRA_USER_HANDLE and UserHandle
* Updates javadoc to mention that EXTRA_USER is available
for some SystemApis.
Bug: 189409989
Test: Compiles (just comments)
Change-Id: I63496ddb5ed4ddc7bc26540c6dad7cbe7911520d
Bug: 186778818
PropertyInvalidatedCache queries that contain wildcard user IDs are no
longer cached. Some simple multi-user tests show that no current
caches use wildcard user IDs, so the change has no effect on
performance. The bypass() mechanism is used to avoid the cache when
necessary.
Test: atest
* FrameworksServicesTests:UserManagerServiceCreateProfileTest
Change-Id: I092d1385cc254b3f595ae3d0322f77dbaf456b65
This feature will allow OEMs to opt-in specific devices/builds to per-app compat overrides.
Bug: 188500456
Test: N/A
Change-Id: I00108d163f752d23c380496ccac971cf0fcfe0f6
Replace PackageParser.PackageParserException by either using the
PraseResult or throwing a more generic Exception in order to move
away from PackageParser.
Bug: 174723245
Test: m docs
Test: atest -p core/java/android/content/pm \
core/java/android/util/apk \
services/core/java/com/android/server/pm \
services/core/java/com/android/server/integrity
Change-Id: I7ba3e693e636caa869641141ed83383326c67809
This hides all fields as private in preparation for exposing as
interfaces for mainline-ability and for automatic getter/setter testing
through kotlin-reflect.
Bug: 178852754
Test: atest com.android.server.pm.test.parsing.parcelling
Change-Id: I8f36898694368ce60b7efd4b099986c0ea29aba0
We trust any incoming value from the system UID, so we should also
trust values coming from the root UID, which includes many shell
commands such as "svc".
Bug: 193659633
Test: atest BluetoothInstrumentationTests:com.android.bluetooth.btservice.AdapterServiceTest --rerun-until-failure 100
Change-Id: Ied07731345f08fc3c4df465a3773e35c8df7c59a
The Bluetooth stack is just one example of an application that makes
self-calls through public APIs, which makes it very difficult to
unconditionally validate AttributionSource arguments.
(The AttributionSource is correctly defined the first time a remote
caller enters the Bluetooth stack, but we've found many cases where
Bluetooth stack calls back into itself without clearing the Binder
identity, causing validation chaos.)
This change is an attempt at gracefully solving this by performing
validation automatically as part of unparceling an AttributionSource
the first time it enters a process. This strategy isn't perfect,
since transporting an instance inside a Bundle would risk
unparceling much later, possibly long after the calling UID
information has been discarded. We're rationalizing that this risk
doesn't exist since AttributionSource was only added a few months
ago, and isn't being used in this way.
We still intend to circle back and provide a better strategy in a
future release for transporting AttributionSource across AIDL which
will handle the nuances of self-calls.
Bug: 188391719
Test: atest BluetoothInstrumentationTests
Change-Id: I10b198cfcd8f361e19d52f86deb7f10f05fec891
App can read installed sync content providers without requiring
any permission via the api ContentResolver#requestSync and
ContentResolver#addStatusChangeListener.
This cl enforces package visibility filter to the api
ContentResolver#addStatusChangeListener. Application without the
package visibility tag of the target applications in its manifest
cannot receive sync status callbacks of the target applications.
Bug: 190726121
Test: atest AppEnumerationTests
Test: atest CtsSyncManagerTestsCases
Test: atest ContentResolverSyncTestCaseatest
Test: atest SyncManagerTest
Test atest SyncOperationTest
Test: atest SyncStorageEngineTest
Test: atest DeferSyncTest
Change-Id: I58d0baf5baefd942b454f06e1fa9d3b34d532a77
For cases where the attribution soruce doesn't need to be
registered as trusted we are now using a shares static
token since the only purpose of the token in these cases
is for watching the source process dying as opposed to that
and security for registered cases.
bug: 192415943
Test: CtsPermissionTestCases
CtsPermission2TestCases
CtsPermission3TestCases
CtsPermission4TestCases
CtsPermission5TestCases
Change-Id: I93fde9ca1cacada7929761533dcae11b2736ce1e
We've seen evidence of a Binder leak, and our hunch is that it's
caused by one of these anonymous "new Binder()" sites. Adding
descriptors will help us identify the leak cause.
Bug: 192415943
Test: atest BluetoothInstrumentationTests
Change-Id: I30cd15f084cf50f67edd833b27b853c4b22e1db1