Commit Graph

9490 Commits

Author SHA1 Message Date
Winson Chiu
5a310af90b Merge "Remove PlatformCompat dependency from getPackageArchiveInfo" into rvc-dev am: 605ec6e272 am: 2c9397e828 am: 752261bb61 am: 7d3113a0e8
Change-Id: I6d65b87e6d890056dcb93960afdef2c7b7c94d2a
2020-05-16 02:32:51 +00:00
Winson
7029b75f67 Remove PlatformCompat dependency from getPackageArchiveInfo
It requires a permission which we can't force apps to take to
maintain backwards compatibility. We also arguably cannot because
it leaks visibility, although only for debuggable apps/non-release
builds.

Instead, there's a new static method for getting the raw targetSdk
to gate against and the check is done manually, ignoring
enabled/disabled state. This will cause a mismatch between certain
apps and some system services like AppIntegrityManager, but the
effects should be minimal if we assume that most people ship
valid APKs. At worse the integrity check will pass an APK that
PM will fail, which doesn't break the feature.

Bug: 156356591
Bug: 156778241

Test: manual device boots

Change-Id: I877a5061476b86b9d63c34e75f16b38be8c3e1c2
2020-05-15 15:52:05 -07:00
TreeHugger Robot
c567137c02 Merge "Treat mimegroup as wildcard for app enumeration" into rvc-dev am: cd1c478655 am: 17ccecea24 am: e16ac10996 am: cdbb51b1df
Change-Id: Ib734d5365efb9da3567975e067ac427b969f340f
2020-05-15 20:47:47 +00:00
TreeHugger Robot
24b477835c Merge "Ignore port when matching with wildcards" into rvc-dev am: d1b6afcc19 am: 7a1f6344fd am: f8dff3cc6c am: 5458a6a8f9
Change-Id: Idae3a72bd5ad8d8083088201e8fa65e8ad64a828
2020-05-15 20:46:44 +00:00
Patrick Baumann
84249ed31e Treat mimegroup as wildcard for app enumeration
This change treats any filter with a mimegroup as if it matches all or
no mime types when matching for the purpose of app enumeration.

Fixes: 155379839
Test: atest IntentFilterTest
Change-Id: I358872082524a4001179bb145053d006622898a7
2020-05-14 16:11:49 -07:00
Patrick Baumann
97980133d5 Ignore port when matching with wildcards
This change ensures that we don't take port into account when matching
queries tags against intent filters as port is not a supported value in
a queries intent tag. Adding support for this in a future release will
just limit the scope of the queries tag on thos releases; it will still
be ignored in this release.

Bug: 151638510
Test: atest IntentFilterTest
Change-Id: I69d77ae6bebf3984bfe8e8a0f6c2e9e91ee69298
2020-05-14 16:03:23 -07:00
TreeHugger Robot
350df5c815 Merge "Controls API - Flag controls support" into rvc-dev am: 897187dcfa am: 166c228af4 am: b8a63260a2 am: edba1d16af
Change-Id: Iabb982f2724ac351a02b08e9b0a9a0deec90a638
2020-05-13 21:51:16 +00:00
Matt Pietal
9788fd4afd Controls API - Flag controls support
Add a package manager flag so that apps can programmatically query
whether the device have system interface to support the Controls API

Bug: 156096063
Test: manual
Change-Id: I2dab2ecb762b59308c51615137f89733ff42caeb
2020-05-13 14:11:34 -04:00
Mocy Sheng
35501e5b25 Merge "Fix nullable annotation to match overriden method in super class" 2020-05-12 13:00:27 +00:00
Robert Horvath
f424274d8e Merge "Add PackageInstaller#uninstallExistingPackage" into rvc-dev 2020-05-12 11:40:10 +00:00
Riddle Hsu
5b198db82d Merge changes from topic "b147213487" into rvc-dev am: 8e726a2ef7 am: 2d42c72f14 am: bd9a3d97c6 am: 9f1ad6529f
Change-Id: Icaff9e75d20f5c9b5ae0b1afddb5985576bf9019
2020-05-12 10:13:03 +00:00
Robert Horvath
77880fa860 Add PackageInstaller#uninstallExistingPackage
This new API allows an app to be uninstalled silently by any app holding
the DELETE_PACKAGES permission, as long as the app is installed in
another user so won't be fully removed from the device.

Bug: 149601842
Test: atest UninstallExistingPackageTest
Merged-In: I69fe4d1dd4e9da83574b431257f7be6d1ac8b2bb
Change-Id: I69fe4d1dd4e9da83574b431257f7be6d1ac8b2bb
2020-05-12 09:18:56 +00:00
Mocy Sheng
ba61f71ff3 Fix nullable annotation to match overriden method in super class
Bug: 156238511
Test: Treehugger
Change-Id: I349e8628ea77d3051f40f903c3438c3fc0a489ea
2020-05-11 14:44:12 -05:00
Robert Horvath
b22683e830 Merge "Add PackageInstaller#uninstallExistingPackage" 2020-05-11 08:23:44 +00:00
Riddle Hsu
e03b9669e3 Add support to override display adjustments by token
This is the bridge to link customized adjustments to an activity
or window token.

The DisplayAdjustments in ResourcesImpl is associated with
ResourcesKey. The new usage requires to associate with token.
That is why the new field is added in Resources.

Bug: 147213487
Test: atest ResourcesManagerTest#testOverrideDisplayAdjustments
Change-Id: Ie79c331654d564aee7af8c6ce98a4c72dd3132b1
2020-05-11 13:30:14 +08:00
Nikita Ioffe
3711e7c7ad Merge "PackageParser2: collect certificates if requested" into rvc-dev am: a23a9dc83b am: a3cc299609 am: 1e7a5256eb am: 0f62e3ca9c
Change-Id: I549172d8e27e954c71ead760280c32cca9c35365
2020-05-08 18:02:32 +00:00
Nikita Ioffe
a2962fa93f PackageParser2: collect certificates if requested
This is a relatively easy and safe change that should significantly
reduce boot time.

Test: atest google/perf/boottime/boottime-test
Test: atest PackageManagerTest
Bug: 155535721
Bug: 155513789
Bug: 155525390
Change-Id: Ib5152892184d407361ce3698575075ec0138edbf
2020-05-07 21:09:21 +01:00
TreeHugger Robot
a83fad74b4 Merge "Migrate remaining parsePackage V1 to V2" into rvc-dev 2020-05-06 03:57:38 +00:00
Varun Shah
6394bcd367 Merge "Update some ContentResolver docs." into rvc-dev am: 2806da306b am: 7affd8ffe6 am: e3afc5a2a7 am: c4e23cebc5
Change-Id: I3aba91500075b89e598fa5ff21225b8972f7a442
2020-05-06 00:28:24 +00:00
Winson Chiu
6ec3a6fc5b Merge "Migrate remaining parsePackage V1 to V2" 2020-05-05 23:37:00 +00:00
Winson
3cb5610a99 Migrate remaining parsePackage V1 to V2
Uses ParsingPackageImpl to generate the PackageInfo for
PackageManager's getPackageArchiveInfo API.

This keeps the migration to v2 hidden and thus the API can
be shipped for this release and then deprecated entirely
if necessary.

Exempt-From-Owner-Approval: Has approval on previous patchsets,
    will need non-logic updates to resolve merge conflict and CP
    into rvc-dev properly

Bug: 135203078
Bug: 146575910
Bug: 153880854

Test: atest com.android.server.pm.parsing
Test: atest android.content.pm.PackageManagerTests

Merged-In: Ib21dbbdc556502144df8e3d7a26b7a9d33885cd9
Change-Id: Ib21dbbdc556502144df8e3d7a26b7a9d33885cd9
2020-05-05 16:35:34 -07:00
Varun Shah
2806da306b Merge "Update some ContentResolver docs." into rvc-dev 2020-05-05 23:18:55 +00:00
Andrew Solovay
c2aaa2bb79 Merge "docs: Fixing broken Javadoc comments" into rvc-dev am: 9e2fa5042b am: 3839f1f669 am: 8ef5792ef0 am: ee5c2d45d6
Change-Id: Ib481085d1cda38b9d63bdc0a849ad904b68efc40
2020-05-05 21:48:45 +00:00
Varun Shah
5de2589627 Update some ContentResolver docs.
Clarify when some of the ContentResolver APIs could return null.

Bug: 112833761
Test: builds (documentation update)
Change-Id: I3af1a23bc484d05b167a86bbff0c93ff1bd364e7
2020-05-05 12:25:30 -07:00
Winson
6b6adc1163 Migrate remaining parsePackage V1 to V2
Uses ParsingPackageImpl to generate the PackageInfo for
PackageManager's getPackageArchiveInfo API.

This keeps the migration to v2 hidden and thus the API can
be shipped for this release and then deprecated entirely
if necessary.

Exempt-From-Owner-Approval: Has approval on rvc-dev CL, moving to master
    to resolve merge conflict

Bug: 135203078
Bug: 146575910
Bug: 153880854
Bug: 155512461

Test: atest com.android.server.pm.parsing
Test: atest android.content.pm.PackageManagerTests

Change-Id: Ib21dbbdc556502144df8e3d7a26b7a9d33885cd9
2020-05-05 10:25:16 -07:00
Andrew Solovay
369f2eeaf9 docs: Fixing broken Javadoc comments
Two recent checkins broke the Javadoc (in both cases, an <h3> wasn't
properly closed). Made the fix by hand to the HTML output in
cl/309818465 but we need to make the corresponding change to
the Java source or it'll get reverted next time we update the reference
docs.

Staged to:

go/dac-stage/reference/android/content/pm/LauncherApps.PinItemRequest
go/dac-stage/reference/android/service/autofill/AutofillService

go/dac-stage/reference/kotlin/android/content/pm/LauncherApps.PinItemRequest
go/dac-stage/reference/kotlin/android/service/autofill/AutofillService

BUG: 155669442
Exempt-from-owner-approval: Docs-only change
Test: make ds-docs
Change-Id: I97be9550689544304dff276cf3c9406f9cd98408
2020-05-04 16:03:17 -07:00
Svetoslav Ganov
13308eb260 Merge changes from topic "RVC-SDK-Finalization-master"
* changes:
  Revert an API breaking changes
  Updating platform SDK version for R
2020-05-02 15:13:07 +00:00
Andrew Sapperstein
975ca816ec Merge changes from topic "cherrypick-ctor-refs-03y8i58ine" into rvc-dev
* changes:
  Update inner class constructor refs to use proper syntax.
  Fix broken @see tags in public documentation.
2020-05-02 00:21:33 +00:00
Svet Ganov
ea8a2145c9 Revert an API breaking changes
bug:150281259

Test: N/A

Change-Id: Ie30286456af15dd7b81bceb0547ffe8bfac422d2
2020-05-01 15:25:51 -07:00
Winson Chiu
d0f6c62ecd Merge "Add skip functionality to package parsing" into rvc-dev am: 2728af853a am: 80fb4ca67e am: a1f5d4e853 am: 4c79158f04
Change-Id: Ie285dcba4df40eeaad52a3b6452d0c11e53892d3
2020-05-01 20:56:39 +00:00
Patrick Baumann
20e7412097 Merge "Adds new activity flags to the @Flags annotation." into rvc-dev am: 24070a6c95 am: 21cdc80c81 am: 6676873edf am: 5d71ac0050
Change-Id: I0a5c4a32f5f9d26d1c064e62285fa9f5b38125bf
2020-05-01 20:33:32 +00:00
Winson Chiu
2728af853a Merge "Add skip functionality to package parsing" into rvc-dev 2020-05-01 20:20:49 +00:00
Andrew Sapperstein
8fe35e5f21 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
2020-05-01 18:25:32 +00:00
Winson
b58595b767 Add skip functionality to package parsing
There are specific cases where a package should be ignored by
whoever is parsing it, either because the device was configured to
ignore it, or the device doesn't support it.

While mostly used for testing, this adds a skip method to
ParseInput and a matching install error code to explicitly express
this case during parsing.

Bug: 155420149

Test: atest com.android.server.pm.parsing

Change-Id: I7eff53544341e21108d9d027f3afe75a1e845f40
2020-05-01 10:49:15 -07:00
Patrick Baumann
40bdf5c5e6 Adds new activity flags to the @Flags annotation.
Bug: 148452357
Change-Id: I01c1a6f5a678f92402c489679b47310f132a445c
Test: Builds
2020-05-01 17:22:30 +00:00
Andrew Sapperstein
6b1e3188a3 Merge "Fix broken @see tags in public documentation." 2020-05-01 00:27:47 +00:00
Nikita Ioffe
7da20e5319 Merge "Teach PackageManager.getApplicationInfo about MATCH_APEX" into rvc-dev am: 0b7f9b9b99 am: e3462ee2bb am: a04d184c7a am: 449e20c588
Change-Id: Iaf6de710af7c6f1049294da952ff0dd7056ed756
2020-04-30 11:44:12 +00:00
Nikita Ioffe
0b7f9b9b99 Merge "Teach PackageManager.getApplicationInfo about MATCH_APEX" into rvc-dev 2020-04-30 10:49:37 +00:00
Ryan Mitchell
16ef866bd2 Merge "Allow pre-R apps to test compressed ARSC error" into rvc-dev am: e3c40062e6 am: f40f3edd2f am: 9cc6606dd6 am: 3716684697
Change-Id: I325d25f78ce687916b09c9d25f288fccdff970dc
2020-04-30 00:46:32 +00:00
Jeff Sharkey
4cd89d7d40 Merge "Update more Parcelables to send Strings UTF-8." into rvc-dev am: 1eb3fcfb33 am: e9214abdf3 am: 16844ca4e0 am: 4581e4d59d
Change-Id: I09c9c0251c909665eab4a676c85d28fad9d9b047
2020-04-30 00:41:34 +00:00
Ryan Mitchell
e3c40062e6 Merge "Allow pre-R apps to test compressed ARSC error" into rvc-dev 2020-04-30 00:13:16 +00:00
Jeff Sharkey
1eb3fcfb33 Merge "Update more Parcelables to send Strings UTF-8." into rvc-dev 2020-04-29 23:55:03 +00:00
Nikita Ioffe
69a3f399fe Teach PackageManager.getApplicationInfo about MATCH_APEX
Test: atest android.content.pm.cts.PackageManagerTest#testGetApplicationInfo_ApexSupported_MatchesApex
Bug: 155092136
Change-Id: I489e186242d4db4de4753a11e90ce23e35f2aa80
2020-04-30 00:10:50 +01:00
TreeHugger Robot
3730507cc2 Merge "Update public documentation." into rvc-dev am: 265622e3c7 am: 6cf285a549 am: c4d47e0518 am: 02202c721b
Change-Id: Id4696c97d22fe0d567ffdc1868f207a8871dc4d6
2020-04-29 23:00:59 +00:00
TreeHugger Robot
265622e3c7 Merge "Update public documentation." into rvc-dev 2020-04-29 22:07:45 +00:00
Robert Horvath
d336f843bd Add PackageInstaller#uninstallExistingPackage
This new API allows an app to be uninstalled silently by any app holding
the DELETE_PACKAGES permission, as long as the app is installed in
another user so won't be fully removed from the device.

Bug: 149601842
Test: atest UninstallExistingPackageTest
Change-Id: I69fe4d1dd4e9da83574b431257f7be6d1ac8b2bb
2020-04-29 23:59:11 +02:00
Jeff Sharkey
1639e6b8ee Update more Parcelables to send Strings UTF-8.
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.

Bug: 154436100
Test: manual
Change-Id: I9a675473e0ce3a4a5c5e305dd851b40bb1560e1c
2020-04-29 14:54:44 -06:00
Alex Buynytskyy
8dc2b1d921 Merge "Unavailable DataLoader status." into rvc-dev am: 78c3d0b57f am: aed2339712 am: d7621cfa2e am: 2a724f926e
Change-Id: I896bbe26168ef9a5ca45b467ef2ace8db22ed5d1
2020-04-29 20:23:36 +00:00
Todd Kennedy
ae3af93daa Update public documentation.
Looks like we haven't returned `null` in years.

Fixes: 149837263
Test: None. Documentation only.
Change-Id: I6900458d0b69152a54034e572a6b994e8e6585bd
2020-04-29 12:33:31 -07:00
Alex Buynytskyy
7e0a1a8ec7 Unavailable DataLoader status.
This is a temporary failure, does not fail the session, but requires
caller to re-commit. E.g. there are connectivity issues which can be
fixed later.

Bug: b/153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I02791a2963130dbecb510c4a7cafcf04f6245761
2020-04-29 04:23:49 +00:00