Commit Graph

12171 Commits

Author SHA1 Message Date
Songchun Fan
9407d10cd0 [pm] fix getPackageArchiveInfo
BUG: 243479679
Test: atest android.content.pm.cts.PackageManagerTest#testGetPackageArchiveInfo
Change-Id: I3a353c9b0f05117b233888d74a42f1ed3cf26eb8
2022-08-23 18:36:04 +00:00
Austin Borger
57b6c21a33 Merge "Revert "Add pids to AttributionSource."" 2022-08-22 17:22:01 +00:00
Austin Borger
7a8d805c63 Revert "Add pids to AttributionSource."
This reverts commit 20bcb3c4b8.

Reason for revert: Broken test (bug 243187237)

Change-Id: I2eb033ed06e2c0c56155e4848de1b399b69ffc6d
2022-08-22 00:56:14 +00:00
Adam Bookatz
3a39c41c8a Merge "Introduce UserProperties class" 2022-08-20 00:32:02 +00:00
Austin Borger
caa20c20e6 Merge "Add pids to AttributionSource." 2022-08-19 20:32:17 +00:00
Adam Bookatz
51f3320ac8 Introduce UserProperties class
Introduces a UserProperties class, which holds (potentially dynamic)
information about each user, where the (default) values depend on the
user type.
This can usually be used instead of
isManagedProfile() calls, giving fine-grained information, rather than
course-grained queries about the user type.

The system copies this object before delivering it to any callers,
filtering the properties by the permissions held by the caller.

The object can be parsed from XML, which is used for both persisting a
user's properties to disk, as well as for reading in the default
properties for each user type.

Bug: 235065648
Bug: 237399048
Bug: 170249807
Bug: 234439331

Test: atest UserManagerServiceUserPropertiesTest
Test: atest android.multiuser.cts.UserManagerTest
Test: atest com.android.server.pm.UserManagerTest
Test: atest UserManagerServiceUserTypeTest

Change-Id: If37480abafa784ce197b482103b6537a60fe2653
2022-08-19 10:59:30 -07:00
Austin Borger
20bcb3c4b8 Add pids to AttributionSource.
The cameraserver has a need for attributing connect calls to particular
processes. This patch introduces pids as a property of an
AttributionSource.

Test: Smoke test on cuttlefish
Bug: 190657833
Bug: 199526514
Change-Id: I6cdffed62447bbb741290dd9c2e5937254d02e3c
2022-08-15 16:59:53 -07:00
Massimo Carli
33cfc1579d Merge "Per-app config for split screen aspect ratio" 2022-08-12 17:32:52 +00:00
Sarup Dalwani
7da331c78e Merge "Making add and clear CPIF apis as TestApis" 2022-08-09 12:51:41 +00:00
TreeHugger Robot
75c305bdc2 Merge "Revert "Update ContentProvider to use the AM trace tag."" 2022-08-09 00:19:46 +00:00
Varun Shah
6e6f3862ff Revert "Update ContentProvider to use the AM trace tag."
This reverts commit f3f9b7ca95.

Reason for revert: b/240776812 regression

Change-Id: Ieb78fcfd631412b994054b66f6d753d13edf5a8c
2022-08-08 17:22:12 +00:00
Louis Chang
02705976b9 Merge "Reverting the Intent package-equivalent component checks" 2022-08-08 08:42:54 +00:00
Jay Sullivan
cf0115463c Merge "Add REQUESTED_PERMISSION_IMPLICIT flag" 2022-08-06 01:27:44 +00:00
Massimo Carli
209d86a426 Per-app config for split screen aspect ratio
We're defining a new compat framework change id that indicates whether a
given app should use the split screen aspect ratio.

Test: As manual testing use 'adb shell am compat disable/enable 208648326 <package-name>'. For the unit tests run 'atest WmTests:SizeCompatTests'.

Fixes: 208648326

Change-Id: I0232d6d98b10e546b840c08ffbf6e7be9c465965
2022-08-05 11:29:13 +00:00
Louis Chang
40cc579cd3 Reverting the Intent package-equivalent component checks
The commit 9c5a330 skips package checks if the package-equivalent
components are set. However, it could also result in inconsistent
behavior on #filterHashCode.

Fixing the original issue from the intent itself instead.

Bug: 64108432
Bug: 64789334
Test: atest TaskTests
Change-Id: I18c717e29072df91fb19eddbddc78153a28f9563
2022-08-05 10:17:24 +00:00
Louis Chang
f9c6e7b7fb Merge "Avoid configuration not updated after reasonable configuration changes" 2022-08-04 09:45:56 +00:00
Sarup Dalwani
d06acf698e Making add and clear CPIF apis as TestApis
Making addCrossProfileIntentFilter and clearCrossProfileIntentFilters as
TestApis so that we can write CTS device side test cases to emulate
behaviour used by 3P apps or profile owners. This is to ensure that no
malicious user can add/remove filters by following access control rules.

Bug: 238019465
Test: atest CtsAppCloningDeviceTestCases
Change-Id: I4084826cbc63b1afc5569bd310be694b11202aee
2022-08-02 17:49:56 +00:00
Lee Shombert
48900f8201 Merge "Increase the size of selected binder caches" 2022-08-02 17:08:47 +00:00
Lee Shombert
28f3934a25 Increase the size of selected binder caches
Bug: 237309566

The maximum size of selected binder caches is increased to avoid
overflow.  The overflow was found in a partner bug report.

The maximum size does not affect memory consumption until the cache
hits the limit, so caches that were not overflowing before will not
see increased memory consumption.  Also, the caches that are affected
by this change are either static (one per process) or exist in just a
few intances per process, so the total memory impact is small.

Note that most of the overflows occurred in vendor processes.

Test: atest
 * android.app.ApplicationPackageManagerTest
 * com.android.server.pm.PackageManagerTests
 * com.android.server.pm.PackageManagerServiceTest
 * com.android.server.compat.PlatformCompatTest
 * com.android.server.compat.CompatConfigTest
 * android.app.compat.CompatChangesTest
 * PlatformCompatGating

Change-Id: I7f60ad9008bf894d6cb967ce1a54ab33af650efc
2022-07-29 17:09:49 -07:00
TreeHugger Robot
bd8b0fcd00 Merge "Update ContentProvider to use the AM trace tag." 2022-07-29 19:35:13 +00:00
Varun Shah
f3f9b7ca95 Update ContentProvider to use the AM trace tag.
Fixes: 240405950
Test: m & verify trace tag
Change-Id: If0cb0b6a4a590836149b53284f584779303a7000
2022-07-29 10:51:29 -07:00
Tiger Huang
ae9d2aa672 Merge "Send size-compat scale to the client" into tm-qpr-dev am: 93a238d15d am: 3995c4d303
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19149526

Change-Id: Ic48b954694b8d6cafce8b421dcbcd94f63793acc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 09:47:33 +00:00
Tiger Huang
3995c4d303 Merge "Send size-compat scale to the client" into tm-qpr-dev am: 93a238d15d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19149526

Change-Id: If3a51277578c31ba2c0e8c75341b33cd1f5cd9ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 09:23:15 +00:00
Tiger Huang
c77eaf873d Send size-compat scale to the client
The client computes the window frame on its own in ViewRootImpl#setView.
However, the bounds obtained from WindowConfiguration is not size-
compatible, which makes legacy apps produce wrong frames. The frame is
larger than expected, so when computing WindowInsets with size-
compatible InsetsState, the window cannot receive insets.

Although the client will receive the correct window frame from relayout,
but the first WindowInsets has been dispatched before that.

This CL sends the size-compat scale to the client, so the client can use
the correct WindowConfiguration to compute frames.

This is also a step to enable the client to perform local window layout.

Bug: 237749017
Bug: 161810301
Bug: 175861127
Test: atest StartingSurfaceDrawerTests WindowAddRemovePerfTest
      ActivityRecordTests WindowManagerServiceTests
Change-Id: I6b23901f4b1f009444c04da7e078ea971a386ad7
2022-07-27 14:10:10 +08:00
TreeHugger Robot
af58ad5dd7 Merge "[pm] fix VerifierDeviceIdentityTest" 2022-07-26 15:44:29 +00:00
Jay Thomas Sullivan
d049e2d73a Add REQUESTED_PERMISSION_IMPLICIT flag
This adds a new permission flag, REQUESTED_PERMISSION_IMPLICIT, which
denotes that a permission is an implicitly-requested permission.

The concept of an implicit permission already existed (we just didn't
have a flag for it) and means that the permission acts as a "requested
permission" despite not being explicitly requested in the
AndroidManifest.xml as a <uses-permission>. For example, split
permissions result in implicit permissions, as well as a few unique
permissions.

Bug: 195016052
Test: atest ImplicitFlagTest
Change-Id: I5aaff487d653767b50fda7860d6fd0434a088dee
2022-07-25 15:43:29 -07:00
TreeHugger Robot
3215e0b57e Merge "[ApplicationInfo] update doc on splitSourceDirs" 2022-07-25 20:32:55 +00:00
Songchun Fan
5aaf950bbd [pm] fix VerifierDeviceIdentityTest
Bug: 208373220
Fixes: 208373220
Test: atest android.content.pm.VerifierDeviceIdentityTest
Change-Id: Id69918ab72d22530a5d4b32ea48d21af69802f2f
2022-07-25 12:14:29 -07:00
Louis Chang
baec1d5cb4 Avoid configuration not updated after reasonable configuration changes
Considering the sequence has wrapped around if the sequence number has
a significant large jump. Obviously the original value (0x10000) is not
big enough nowadays.

Also taking the negative jump into account, where the wrap around may
happen on the `other` configuration.

Bug: 239371596
Test: ConfigurationTest
Change-Id: I8ac5ee8c1589b68e63e8e29f961c7fcba719949e
2022-07-25 10:06:40 +00:00
Songchun Fan
e3005501a4 [ApplicationInfo] update doc on splitSourceDirs
BUG: 196018927
Test: n/a
Change-Id: I9e3c2e4387618bfcddd48d050f0ebd588382815d
2022-07-23 12:26:37 -07:00
Alex Buynytskyy
13f061e530 Merge "Use the same application info instance." into tm-qpr-dev am: dd7853a610
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19348154

Change-Id: Iea1b37ce6b217bbd1f621598eab67ba2462b5195
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 20:15:19 +00:00
Alex Buynytskyy
da1a68e6f6 Use the same application info instance.
Bug: 238461609
Fixes: 238461609
Test: Follow the repro steps in the bug.
Change-Id: I0432ad981d8bd15d10874bc07bb89dfa0574eba5
2022-07-20 18:16:57 +00:00
Alex Buynytskyy
f14298b70c Use the same application info instance.
Bug: 238461609
Fixes: 238461609
Test: Follow the repro steps in the bug.
Change-Id: I0432ad981d8bd15d10874bc07bb89dfa0574eba5
2022-07-20 11:15:26 -07:00
Ömer Yaveroğlu
c6ba7aea03 Fix the bug where the added field into the toString implementation does
not have a corresponding %s formatting.

Bug: 239134974
Test: atest frameworks/base/core/tests/coretests/src/android/content/integrity
Test: atest services/tests/servicestests/src/com/android/server/integrity
Change-Id: Ib9c3ecadfc5a823cd4fcd44237b25900f86b4e5c
2022-07-15 12:21:14 +00:00
Nikita Dubrovsky
22f3baa869 Deprecate and no-op test API getContentCaptureServicePackageName
After the fix for b/222231605, permission pre-grants are no longer tied
to the package that provides ContentCaptureService, so this test API is
no longer needed. However the API is still referenced from GTS tests
(though it won't be invoked on T and above), so we need to keep the
method in the SDK to compile the test code.

Bug: 229662628
Test: Presubmit
Change-Id: Iddc201ba8afde816446377e509a3f2de35215f61
2022-07-12 22:43:36 -07:00
Achim Thesmann
e67d8a101d Merge "Add attribution tag to clipboard." into tm-qpr-dev am: c761b5c52b am: 1072878a16
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19064995

Change-Id: I7b0fe7637c229b322a485201cabbb0448a9bafe6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 17:48:21 +00:00
Achim Thesmann
1072878a16 Merge "Add attribution tag to clipboard." into tm-qpr-dev am: c761b5c52b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19064995

Change-Id: I2889d27fbc1e0c88ee191300214cdf752e2b06a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 17:31:29 +00:00
Achim Thesmann
c761b5c52b Merge "Add attribution tag to clipboard." into tm-qpr-dev 2022-07-07 17:16:35 +00:00
Treehugger Robot
ce404eb866 Merge "Fix javadoc typo in ApplicationInfo" am: 2df3ef5db3 am: a447ff12be am: 1c1b1fd00c am: f2be111206 am: 08e0f8fc5e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2142995

Change-Id: I30e98f086dc39a1bc1a67a96e6fc207d2ccf0f4f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 19:19:50 +00:00
Treehugger Robot
08e0f8fc5e Merge "Fix javadoc typo in ApplicationInfo" am: 2df3ef5db3 am: a447ff12be am: 1c1b1fd00c am: f2be111206
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2142995

Change-Id: I2af2642130e146ff3bedec42a32b44308ca22cfc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 18:57:21 +00:00
Treehugger Robot
1c1b1fd00c Merge "Fix javadoc typo in ApplicationInfo" am: 2df3ef5db3 am: a447ff12be
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2142995

Change-Id: I7ab4d98c0df25194c0646d62217239786997bafc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 18:40:35 +00:00
Treehugger Robot
a447ff12be Merge "Fix javadoc typo in ApplicationInfo" am: 2df3ef5db3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2142995

Change-Id: I5a96141c8fa3c4fef781639fb9171645371c088b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 18:21:56 +00:00
Hani Kazmi
4f221e5c51 Migrate Bundle/Intent APIs to new, type checked, variants
Part of go/safer-parcel. Follow up to ag/16639043. Migrates the following unsafe APIs:

* Parcel.readArray()
* Parcel.readParcelableArray()
* Bundle.getSerializable()
* Bundle.getParcelable()
* Bundle.getParcelableArrayList()
* Bundle.getParcelableArray()
* Bundle.getSparseParcelableArray()
* Intent.getSerializableExtra()
* Intent.getParcelableExtra()
* Intent.getParcelableArrayExtra()
* Intent.getParcelableArrayListExtra

Bug: 227458983
Test: m and presubmit pass
Change-Id: I72f206cb18eb5c669a7fff07a6845bed1c433fdb
2022-07-01 10:53:53 +00:00
Matthew Zavislak
63d4f7eb82 Fix javadoc typo in ApplicationInfo
- FLAG_SYSTEM had a small typo

Test: Documentation only, not needed
Change-Id: Iaa27b7ccac6090658e5f893778997a6ce850b8b0
2022-06-30 22:19:35 -07:00
Etan Cohen
10546ff698 Replace "NYC" with "Android 7" in javadoc
Bug: b/237377634
Change-Id: Iaf86b8b382c9ddd4e8107c5b1cae610f64ef8c79
Test: N/A
2022-06-29 02:07:49 +00:00
TreeHugger Robot
3cb72a002c Merge "Correctly parse minSdk even when targetSdk is a codename" into tm-dev am: 2fb8b2d84c am: 657e9583c3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19087061

Change-Id: Ib4e80eb6214222a66e4a513df6376a64ec541d56
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-28 18:30:06 +00:00
TreeHugger Robot
e97c7c78be Merge "Correctly parse minSdk even when targetSdk is a codename" into tm-dev am: 2fb8b2d84c am: f65074527b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19087061

Change-Id: Ie8cac29bc1912176f231fc50764db4ba96d7e88f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-28 18:29:22 +00:00
Roopa Sattiraju
e2abe03206 API changes requires for Bluetooth apk inside the apex to build.
Bug: 216731966
Test: Compile and Test
Cherry-picked from tm-dev
Merged-In: Ic8e9c2db0743738b2b6649451c79a559c3b8edc5

Change-Id: Ic8e9c2db0743738b2b6649451c79a559c3b8edc5
2022-06-27 16:35:47 -07:00
Winson Chiu
bcf5b69c41 Correctly parse minSdk even when targetSdk is a codename
The code that assigned target to min if min was not specified was
only checking for min codenames, but if the manifest specified a
numerical minSdkVersion, that is valid and would incorrectly prevent
the package from installing.

Bug: 237059024

Test: mts-tradefed > mts-eng-only -m ApkInApexTest

Change-Id: I3a2b9baa82ebb8ca9031c9fa128ce12bff17226e
2022-06-27 18:29:39 +00:00
Jeremy Meyer
469b166334 Merge "Allow string type when fabricating FRROs" 2022-06-27 15:08:50 +00:00