Commit Graph

10021 Commits

Author SHA1 Message Date
Charles Chen
465c67dfd5 Merge "Introduce #createWindowContext with display" 2020-12-22 09:44:53 +00:00
Charles Chen
b63b92922b Introduce #createWindowContext with display
Test: atest ContextIsUiContextTest ContextGetDisplayTest
Test: atest WindowContextPolicyTests
Bug: 174640742
Change-Id: I13bd07fa3a4e79fe44bce34157ee93622cbb431d
2020-12-21 15:01:48 +08:00
TreeHugger Robot
69f35b55c2 Merge "Migrate ApkAssets to use NativeAllocationRegistry" 2020-12-21 05:15:37 +00:00
Ryan Mitchell
1e2456730d Migrate ApkAssets to use NativeAllocationRegistry
This change ensures that mNativePtr can be deleted only when its
ApkAssets is really inaccessible and prevents finalization race
conditions.

Bug: 159041693
Test: boot and add logs to ensure destructor runs
Change-Id: Iff0612fe6862a17b8c889d9e7ba230094e3cb14a
2020-12-17 20:47:38 +00:00
Nick Moukhine
47bb18859c Merge "Add shell commands MusicRecognitionService" 2020-12-17 08:40:51 +00:00
Paul Hu
c3238cc763 Merge "Update some in-procss APIs to system APIs" am: a7f149d86d am: f0b1601c66 am: fd71d25ea5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1502511

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I65e2d9353b34f762c24ccbd1d7879379833642b1
2020-12-17 05:16:02 +00:00
Paul Hu
fd71d25ea5 Merge "Update some in-procss APIs to system APIs" am: a7f149d86d am: f0b1601c66
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1502511

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7c2cb79d321d3e5ae686cb9ba682e600df392be0
2020-12-17 03:06:57 +00:00
Victor Chang
63c5fe5d33 Merge "Make a copy of libcore.util.ArraysUtils in framework" 2020-12-17 02:25:00 +00:00
TreeHugger Robot
5b90227078 Merge "Replace Locale#adjustLanguageCode with its own implementation" 2020-12-17 01:06:39 +00:00
Victor Chang
198ced861a Make a copy of libcore.util.ArraysUtils in framework
It helps remove it from the @CorePlatformApi

Bug: 154796679
Test: ArrayUtilsTest
Change-Id: I0c8f194a74a16b2cc46f9eea4571d5fb674fbc28
2020-12-16 23:50:30 +00:00
Kholoud Mohamed
41b4477a53 Merge "Correctly reset cross-profile app-op" 2020-12-16 21:22:46 +00:00
Victor Chang
8daac22971 Replace Locale#adjustLanguageCode with its own implementation
No known behavior change.

Bug: 154796679
Test: treehugger
Change-Id: I474ad621b84da9f7cc7961def6d6751925577d41
2020-12-16 19:53:23 +00:00
paulhu
32164bb807 Update some in-procss APIs to system APIs
In-process API only applies to code in frameworks/base/services
so that CS mainline can't use these APIs. Thus, update these
in-process APIs to system APIs to support CS mainline usage.

Bug: 170593746
Test: atest FrameworksNetTests
Change-Id: I4c7c1e71dcb6448aed0107768b4ba8eecd3e11f7
2020-12-16 19:21:14 +08:00
Hyunyoung Song
a2f98d16a6 Merge "Add Initial SearchUIManager" 2020-12-15 23:17:45 +00:00
Alexander Dorokhine
c51d98c112 Merge changes I3a17ec73,Ie460dbbb
* changes:
  Unhide AppSearchManager APIs.
  Unhide GlobalSearchSession API.
2020-12-15 20:47:01 +00:00
Hyunyoung Song
21e60a9d43 Add Initial SearchUIManager
Bug:162234997

Test: builds, locally ran cts tests

CTS tests: ag/13129468

[Meeting notes with Svet/Sunny/Winson] go/aaplus-search-api
[Design diagrams] go/aaplus-search-supl

Change-Id: I4589cd411e124dc9d7ea132a71651f6b9f9656ae
2020-12-15 18:54:43 +00:00
Alex Kershaw
d004f41188 Correctly reset cross-profile app-op
Delegate the resetting of the INTERACT_ACROSS_PROFILES app-op to
DevicePolicyManager, which knows whether it should be pre-granted and
knows to apply it equally across all users in the profile group.

Further unit tests for DevicePolicyManagerInternal will be added in
b/175440570 when we have the better infra for that.

The CrossProfileAppsServiceImpl changes look more complex than they are.
They consist of the following:
- Inclusive language changes to 'allowlist'
- Static imports of permissions to improve readability
- Previously, the setInteractAcrossProfilesAppOp method would set the
app-op for every user within the profile group of the 'calling user'.
However, given that we are now exposing this as a server-side internal
API where we need to pass in a user ID (from AppOpsService), we don't
necessarily have the guarantee that the 'calling user' is in the same
profile group. So we split it up: the client-side API and AIDL API still
set the app-op for the calling profile group, whereas the internal API
sets the app-op for every user within the profile group of the provided
user. The changes simply abstract away references to the 'calling user
ID'.

Fixes: 166561076
Bug: 175440570
Test: atest services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java --verbose -c
Test: manual
Change-Id: I2181fe66022aaf6c3e6d784c0569d2f41ab66537
2020-12-15 14:05:39 +00:00
Felka Chang
b19810da77 Throw appropriate exception for session transferring
If the parameter "packageName" is invalid, such as null or
empty string for package name, an IllegalArgumentException is thrown.

In PackageInstallerSession.transfer(packageName), in order to let
the throwing exception more close to the real situation, we throw
IllegalStateException rather than IllegalArgumentException when
one file isn't closed or the state is wrong.

Test: atest InstallSessionTransferTest
Bug: 158804946
Change-Id: Ib0a3e8dc19b829c7382791e622e0b86ee8b387e8
2020-12-15 20:23:55 +08:00
Alexander Dorokhine
7749895904 Unhide AppSearchManager APIs.
Bug: 172180369
CTS-Coverage-Bug: 175661706
Test: AppSearchCtsTests
Change-Id: I3a17ec73708226ef7894ab894a8327ee2a6973d3
2020-12-14 23:43:41 -08:00
Mårten Kongstad
28b23286d5 idmap2: remove the 'scan' command am: 6532483950 am: 29e7a4394a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519907

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I04d797b558efe44e763b96b01dc4870e7cc4960b
2020-12-14 22:24:51 +00:00
Mårten Kongstad
29e7a4394a idmap2: remove the 'scan' command am: 6532483950
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519907

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If62d07750556e734686a0c1df2f2e533b83c1b1c
2020-12-14 21:20:53 +00:00
Ryan Mitchell
314863c132 Merge changes from topic "inc-hard-am"
* changes:
  Revert^2 "Cache resolved theme values"
  Set resource id correctly when resolve fails
  Revert^2 "libandroidfw hardening for IncFs"
  idmap2: remove call to obsolete 'idmap2 verify' from valgrind.sh
  idmap2: remove the 'scan' command
2020-12-14 20:42:03 +00:00
TreeHugger Robot
e527e4cc65 Merge "Add GLES dEQP level feature flag" 2020-12-14 16:37:39 +00:00
TreeHugger Robot
1923524096 Merge "Move permission methods in PackageManager to PermissionManager." 2020-12-11 23:24:05 +00:00
TreeHugger Robot
f4bb783cbe Merge "Move a subset of PermissionManager APIs into LegacyPermissionManager." 2020-12-11 20:40:57 +00:00
Wale Ogunwale
c27f0525b7 Merge "Add more OWNERS coverages" am: 32ff0144bf am: 60f676c7d6 am: 926aa8da2c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519794

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib3dd38c02eb596d1223ecfae9b383931e985fe6d
2020-12-11 17:15:02 +00:00
Wale Ogunwale
926aa8da2c Merge "Add more OWNERS coverages" am: 32ff0144bf am: 60f676c7d6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519794

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I32e5f8566ba916c892898f3f521a5a4309646142
2020-12-11 16:58:45 +00:00
Charles Chen
09f4e85ac2 Add more OWNERS coverages
Test: manual
Bug: 174932174
Change-Id: Ia798bdbce8516a3d675c55028ab637ad7f0695cf
2020-12-11 19:16:38 +08:00
Jeff Sharkey
d25af5c84a Merge "configure owners for ShortcutInfo" am: 694df14654 am: 2948fb99c5 am: e6d38e61cc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1520446

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If5877f9fc510c553e3299d1e33fc3ec4f2d74137
2020-12-11 10:57:13 +00:00
Hai Zhang
65404d6c66 Move permission methods in PackageManager to PermissionManager.
A number of permission-related methods were implemented in
ApplicationPackageManager by calling the IPermissionManager AIDL
interface. However since we are moving permission into module, the
AIDL inteface can't be an API and the implementions must be moved.

This change moves these methods into PermissionManager, with the
javadoc and interface from PackageManager and the implementation from
AppliationManager. The javadoc remains mostly the same except for
style and typo fixes. The API interface also remains the same except
for inclusive language changes since we are defining new one and have
a chance to fix them now.

We have to lazily get the PermissionManager instance because the
context passed in may be null for an instrumentation use case.

Bug: 158736025
Test: presubmit
Change-Id: I1c28433ca6200679a41e3518354fe03b866621b5
2020-12-10 16:19:05 -08:00
Hai Zhang
e7d707ceb0 Move a subset of PermissionManager APIs into LegacyPermissionManager.
And move their implementation from PermissionManagerService to
LegacyPermissionService.

The DefaultPermissionGrantPolicy related methods are not APIs, and
are thus moved to LegacyPermissionManager and their usages are updated
to use LegacyPermissionManager.

The checkDeviceIdentifierAccess() method is also moved into
LegacyPermissionManager, because it's merely an application of
permission checking, not the permission management infra itself, and
there isn't great benefit in updating it. However since it is an API,
we still have to keep a delegate for it on PermissionManager, and make
the delegated method @SystemApi.

Bug: 158736025
Test: presubmit
Test: LegacyPermissionManagerServiceTest
Change-Id: Ic838f3685427217c8e0477551c3373258408983f
2020-12-10 16:19:01 -08:00
Jeff Sharkey
e6d38e61cc Merge "configure owners for ShortcutInfo" am: 694df14654 am: 2948fb99c5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1520446

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I27c7ab6c7a1325b43857e1456e631c044ac0d3b5
2020-12-10 22:39:20 +00:00
Jeff Sharkey
694df14654 Merge "configure owners for ShortcutInfo" 2020-12-10 21:36:20 +00:00
Pinyao Ting
5df24bca42 configure owners for ShortcutInfo
Bug: 151359749
Test: manual
Change-Id: Ic3f338083402f2c189f36b8ec9db502e11e50a55
2020-12-10 13:13:26 -08:00
Hai Zhang
aa7d64b8eb Merge changes from topics "role-permission", "role-permission-internal"
* changes:
  Add internal as a new permission protection level.
  Add role as a new permission protection flag.
2020-12-10 07:47:21 +00:00
Nick Moukhine
e61ddcfc0a Add shell commands MusicRecognitionService
The shell command allows a temporary override of the recognition service so I can substitute a stub in cts tests. Also add permission for the shell to be able to invoke the recognition api for the sake of cts tests.

Bug: 164439465
Test: new test in topic
Change-Id: I4a8de616a70f0d6504b2eaf486d5641cb7872607
2020-12-09 15:33:16 +01:00
Chris Wailes
2a6f9b05a3 Adds an "install scenario" field to the appropriate datastructures am: d42204a865 am: e2c2f7ec15
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1465553

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ieb120d7fd34ab55c2d01978f01a6ab474d6a5664
2020-12-09 02:23:45 +00:00
Chris Wailes
e2c2f7ec15 Adds an "install scenario" field to the appropriate datastructures am: d42204a865
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1465553

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifeb0c921ec079202dba5b0b50eb147b09ea3042e
2020-12-09 01:22:52 +00:00
Christian Wailes
21b065b610 Merge changes from topic "install-hints"
* changes:
  Modify dexopt invocation based on install scenario
  Adds an "install scenario" field to the appropriate datastructures
2020-12-09 00:00:26 +00:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Mårten Kongstad
6532483950 idmap2: remove the 'scan' command
The 'scan' command has been replaced by 'create-multiple'. Remove the
unused code.

Also remove unused functions and #includes from FileUtils, and the
obsolete JNI plumbing.

Test: atest idmap2_tests OverlayDeviceTests OverlayHostTests
Change-Id: Iae073c13ce64b5db48f22f7e723bc8c0c5fcd2c9
Merged-In: Iae073c13ce64b5db48f22f7e723bc8c0c5fcd2c9
2020-12-08 16:54:51 +00:00
Jeff Sharkey
24d251403b Improve OWNERS coverage across frameworks/base/. am: fab0ab3c9c am: c7c4a74a78
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519383

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5120a3701af3564f363900b20bca75f3ad2a854c
2020-12-08 16:43:17 +00:00
Jeff Sharkey
c7c4a74a78 Improve OWNERS coverage across frameworks/base/. am: fab0ab3c9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519383

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0211462ecbcd9ad66f66af87e31cf12e1582fc65
2020-12-08 16:01:16 +00:00
Jeff Sharkey
fab0ab3c9c Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
2020-12-08 08:36:27 -07:00
Chris Wailes
d42204a865 Adds an "install scenario" field to the appropriate datastructures
This CL adds an "install scenario" field to several data structures used
by the Package Manager.  This value will be used by a following CL to
adjust the invocation of dexopt based on the indicated use case.

Bug: 173137187
Test: build
Merged-In: I1d0df8edf85a598905a5e7509f6c811df5c20e2e
Change-Id: I1d0df8edf85a598905a5e7509f6c811df5c20e2e
2020-12-07 15:05:54 -08:00
Hai Zhang
b9893a600e Add internal as a new permission protection level.
Permissions with the new internal protection level are similar to
signature permissions in that they can be controlled internally by the
system via the specified protection flags, but they are no longer
granted according to signatures. This enables us to create role-only
permissions.

Bug: 158736025
Test: presubmit
Change-Id: Ie5f76f14d6e32b05b9113090e10b8a1a41a2d9da
2020-12-07 14:44:10 -08:00
Hai Zhang
a396875109 Add role as a new permission protection flag.
Permissions with the role protection flag will be able to be managed
by role via grant/revokeRuntimePermission(), similar to development
permissions but only manageable by role.

Also fixed a bug that PermissionController can get any signature
permission.

Bug: 158736025
Test: presubmit
Change-Id: I49603cee91466a791be66055a922ba1a8bd08d4e
2020-12-07 14:05:23 -08:00
Christian Wailes
bf0bed337e Merge changes from topic "install-hints"
* changes:
  Modify dexopt invocation based on install scenario
  Adds an "install scenario" field to the appropriate datastructures
2020-12-07 20:08:07 +00:00
Ruslan Tkhakokhov
39ede62cbf Merge "Update eligibility rules for adb backup" 2020-12-07 14:10:38 +00:00
Jeff Sharkey
db4ae71beb Merge changes from topic "nov30"
* changes:
  Hand-migration to TypedXml interface.
  Mechanically apply TypedXml refaster template.
  Mechanical refactoring to new typed XML classes.
  Additional hand-migration to TypedXml interface.
  "Resolve" both human-readable and binary XML.
2020-12-04 21:32:44 +00:00