Commit Graph

20003 Commits

Author SHA1 Message Date
Kholoud Mohamed
53fb73b912 Merge "Remove no longer needed broadcasts" into sc-dev 2021-02-05 17:53:19 +00:00
Kholoud Mohamed
28d66d71df Merge "Add user settings and intent filters to userTypeDetails" into sc-dev 2021-02-05 17:53:19 +00:00
TreeHugger Robot
1ac8aa5aa4 Merge "Changing IntentSender to become a listener." into sc-dev 2021-02-05 17:27:10 +00:00
Ruslan Tkhakokhov
9e8fef20a7 Merge "Refactor XML config parsing" into sc-dev 2021-02-05 13:29:11 +00:00
Issei Suzuki
c6fa4e9892 Merge "Fix flicker when starting an activity from Recents." into sc-dev 2021-02-05 11:10:57 +00:00
Charles Chen
582247eef0 Merge changes from topic "window_context_2.0" into sc-dev
* changes:
  Apply WindowContext 2.0 for InputMethodMenuController
  Migrate WindowContext to WindowContextListener mechanism
2021-02-05 04:53:09 +00:00
Alex Buynytskyy
6f80c512a4 Changing IntentSender to become a listener.
Listener is more secure as nobody can send a broadcast with invalid
digests.

Bug: 160605420
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I5f6ec3f0fa975d274d456d11d57be61d0b245e80
2021-02-05 00:16:51 +00:00
Ruslan Tkhakokhov
343f126917 Refactor XML config parsing
Do a small refactor of include / exclude rules parsing. In a follow-up
CL we will introduce the logic that parses the new include / exclude
config format. To ensure some of the code can be reused, this CL
extracts parts of parseBackupSchemeFromXmlLocked() function into
separate functions.

Test: atest FullBackupTest
Bug: 174216309
Change-Id: I01e6bcfe4b772f35ece4b8cb21b2e003c28ae55c
2021-02-04 23:16:30 +00:00
Chris Li
cab4131e77 Merge "Allow non-resizable apps in split-screen (9/n)" into sc-dev 2021-02-04 19:40:51 +00:00
Kholoud Mohamed
352849ccbe Remove no longer needed broadcasts
Removed broadcasts that were sent from the framework
to Managed Provisioning during DPM#createAndProvisionManagedProfile
and DPM#provisionFullyManagedDevice to handle system apps
snapshotting. This is no loger needed as Managed
Provisioning is directly applying that logic after calling the APIs.

Bug: 178478031
Test: N/A
Change-Id: Ic78828f3be05f154414f53c9c78915cf92341765
2021-02-04 19:35:39 +00:00
Kholoud Mohamed
b2d15371a1 Add user settings and intent filters to userTypeDetails
Added the capability to set default user settings and
default cross profile intent filters for different user
types in UserTypeDetails.
Also added default values for managed profiles.
The following is mostly copied from existing code in MP:
* DefaultCrossProfileIntentFilter class
* DefaultCrossProfileIntentFiltersUtils class
* setDefaultCrossProfileIntentFilters and
* resetDefaultCrossProfileIntentFilters in UserManagerService

NOTE REGARDING FILE HISTORY: Several classes moved from ManagedProvisioning
to the framework. There is a comment on this CL that points to an internal
link to the change history of these files in ManagedProvisioning.

Bug: 176973252
Test: atest UserManagerServiceUserTypeTest
Test: atest BundleUtilsTest
Test: atest UserRestrictionsUtilsTest
Test: atest com.android.server.pm.UserManagerTest
Test: atest UserManagerServiceTest
Test: atest com.android.server.devicepolice.DevicePolicyManagerTest

Change-Id: I3d4cbfcbcad6b6419c5306ae025d4cb9dca317ba
2021-02-04 19:15:39 +00:00
Winson
ee612e99fe Address domain verification API comments
Changes package to pm.verify.domain, removes throwing InvalidDomainSet,
cleans up permissions, and renames DomainVerificationSet ->
DomainVerificationInfo.

Bug: 163565712
CTS-Coverage-Bug: 179382047

Test: atest com.android.server.pm.test.verify.domain

Change-Id: I5d60c227f0e529fe27c1844ada97716933a533b0
2021-02-04 10:27:01 -08:00
Winson
dd04535e9b Wire up DomainVerificationService to PackageManagerService
Sets up the callback and the actual service initialization so that
future domain verification changes can access PackageManager APIs.

Exempt-From-Owner-Approval: Already approved by owners on main branch

Bug: 163565712

Test: none, device boots, tested implicitly as part of other changes

Change-Id: Ie75ad0ee002ae92c21387777ff41c2504c69b836
2021-02-04 10:26:58 -08:00
Felipe Leme
4af8d82444 Merge "New device policy API: UnsafeStateException.getReason()." into sc-dev 2021-02-04 16:36:43 +00:00
Makoto Onuki
2cfefc694b Merge "Move the "whitelist type" constants to PowerWhitelistManager." into sc-dev 2021-02-04 16:26:41 +00:00
TreeHugger Robot
d61ce319d4 Merge "Add metrics for the PO and DO provisioning APIs" into sc-dev 2021-02-04 15:37:26 +00:00
Charles Chen
9854a1e315 Migrate WindowContext to WindowContextListener mechanism
1. Use registerWindowContextListener instead of
   addWindowTokenWithOptions
2. Clean up the logic of sending the config to the client in WindowToken
3. Add a mechanism in WMS#addWindow, when a WindowContext adds a view,
   the server side will switch to register the WindowToken for the
   WindowContext.

In this way, we won't add a WindowToken until adding the fist view.
Also, we could apply an existing window token by overriding
WindowManager.LayoutParams.token.

Bug: 159767464
Bug: 153369119
Test: atest WindowContextTests WindowContextPolicyTests
Test: atest WindowContextTest
Test: atest WindowContextListenerControllerTests

Change-Id: I2396187c445306d18101706c4521edd9cf92facf
2021-02-04 23:27:03 +08:00
kholoud mohamed
2aade76a45 Add metrics for the PO and DO provisioning APIs
Added metrics for DPM#provisionFullyManagedDevice and
DPM#createAndProvisionManagedProfile, these metrics map
to the previously logged metrics in MP.

Test: Verified manually that the metrics are being reported.
Bug: 178458861
Change-Id: Ib950b511f8ca1200c56181ac51c906370279d212
2021-02-04 10:58:48 +00:00
TreeHugger Robot
f1aaec7b4b Merge "API: Suppress existing NullableCollections lints (S edition, die zweite)" into sc-dev 2021-02-04 09:04:23 +00:00
Remi NGUYEN VAN
5ab2994cf5 Merge "Use formal API for ActivityThread to set proxy" into sc-dev 2021-02-04 02:44:38 +00:00
Makoto Onuki
01f023a499 Move the "whitelist type" constants to PowerWhitelistManager.
And also rename them.

Fix: 179276056
Test: Build / treehugger
Change-Id: I7b794eb0c638d3fc00ad5b40d3b24c7f2ff5241b
2021-02-03 14:25:33 -08:00
Issei Suzuki
8bc3db2b30 Fix flicker when starting an activity from Recents.
In the task switcher, a user can choose a task by tapping or pulling
down the task image.

In the later case, the task image already occupies the full screen, so
the launcher suppresses an app transition animation by calling
ActivityOptions#makeCustomAnimation. However, due to task animation
lockdown, this API has no effect when the task opens or closes (the API
still works as expected when an activity starts within a same task).

The new API ActivityOptions#makeCustomTaskAnimation lets us to customize
an animation to run when the task opens or closes.

Test: atest ActivityTransitionTests
Bug: 170251468
Change-Id: I445e64fdbf6be2d4fdf1936844bcd27dbdf8d69a
2021-02-03 22:22:32 +01:00
Adrian Roos
17e3e829bf API: Suppress existing NullableCollections lints (S edition, die zweite)
Bug: 152525509
Test: make checkapi
Change-Id: Ia8cc585c6815c7b641ed3603862042eef70c369f
2021-02-03 19:34:54 +01:00
Mariia Sandrikova
546983419c Merge "Configurable letterbox background." into sc-dev 2021-02-03 11:50:38 +00:00
Junyu Lai
91d89b4880 Merge "[FUI21] Move scrubSubscriberId to utils class" am: f6c7f61d27 am: f0b03b1763 am: 582c042052
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1565195

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If957a1c5017ab9600bbdece527543885a17ed2aa
2021-02-03 10:25:20 +00:00
Junyu Lai
582c042052 Merge "[FUI21] Move scrubSubscriberId to utils class" am: f6c7f61d27 am: f0b03b1763
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1565195

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I59c31da9c2ba69ee74cbf64e3af42331e9b7bfca
2021-02-03 10:10:22 +00:00
Junyu Lai
f6c7f61d27 Merge "[FUI21] Move scrubSubscriberId to utils class" 2021-02-03 08:52:17 +00:00
TreeHugger Robot
e51a931cd2 Merge "Cache permission policy" into sc-dev 2021-02-03 06:41:02 +00:00
Riddle Hsu
6ab44a81d6 Merge "Restore overridePendingTransition to a sync binder call" into sc-dev 2021-02-03 03:05:20 +00:00
Chris Li
7dfa7106a9 Allow non-resizable apps in split-screen (9/n)
Cleanup SizeCompatModeActivityController

Bug: 176061101
Bug: 178327644
Test: pass existing
Change-Id: If4bb5e082976725b80bda5a95880a24201b6c595
2021-02-02 18:00:35 -08:00
Remi NGUYEN VAN
a26ffd97ee Use formal API for ActivityThread to set proxy
Add getProxyForNetwork to the public API, and use ConnectivityManager
APIs from ActivityThread (instead of hidden APIs) to get/set the proxy
for an app process.

getProxyForNetwork allows clients to find which proxy applies, which can
be a global proxy setting or a per-network proxy.

The default proxy is now initialized with getDefaultProxy instead of
getProxyForNetwork(null); this should not make a difference, as nothing
should have called bindProcessToNetwork at that point yet.

Bug: 174436414
Test: m; device boots
Change-Id: Ifb516194ecde1567cea4b6806946091cdcf2f015
2021-02-03 10:19:25 +09:00
TreeHugger Robot
5e1f9a630b Merge "Pass in split permissions to ParsingPackageUtils." into sc-dev 2021-02-03 00:34:44 +00:00
Chris Li
ee21983ae0 Merge "Allow non-resizable apps in split-screen (7/n)" into sc-dev 2021-02-03 00:24:54 +00:00
Mariia Sandrikova
c0f663fd35 Configurable letterbox background.
Allow three types of the letterbox wallpaper:
- Solid background using color specified in R.color.config_letterboxBackgroundColorSolid color
- Color specified in R.attr.colorBackground for the letterboxed application
- Color specified in R.attr.colorBackgroundFloating for the letterboxed application

Also, adding ADB commands for each config value:
- adb shell cmd window set-letterbox-background-color [reset|color]
- adb shell cmd window get-letterbox-background-color
- adb shell cmd window set-letterbox-background-type [reset|solid_color|app_color_background|app_color_background_floating]
- adb shell cmd window get-letterbox-background-type

Test: manual with ADB commands, atest LetterboxTest
Fix: 179088234
Change-Id: I23cf0b52c9f95d1f92255731bc7be165a575c7cd
2021-02-02 23:54:25 +00:00
TreeHugger Robot
e7a937b035 Merge "Clean up split system user code for device policy management" into sc-dev 2021-02-02 21:56:08 +00:00
Shashwat Razdan
ae26632fa2 Merge "Adding owners in smartspace packages" am: 10603d5102 am: 6bef558283 am: 5a53f7c676
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1570760

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ideffda52245794487ac6289f4046b88aab941e93
2021-02-02 21:52:24 +00:00
Shashwat Razdan
5a53f7c676 Merge "Adding owners in smartspace packages" am: 10603d5102 am: 6bef558283
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1570760

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9670927375fa2cbb52a8d7114b41d9475dcc7b7e
2021-02-02 21:02:27 +00:00
Chris Li
98d2d06106 Allow non-resizable apps in split-screen (7/n)
Add interface for SizeCompatUIController in WM shell to use
when refactoring SizeCompatModeActivityController from system UI.

Bug: 176061101
Bug: 178327644
Test: atest WMShellUnitTests:ShellTaskOrganizerTests
Change-Id: I37f72396e1769b7773722be6575506fc430b2739
2021-02-02 12:50:28 -08:00
Hai Zhang
f61f4fb849 Pass in split permissions to ParsingPackageUtils.
Similar to passing in display metrics. We can use
ActivityThread.currentApplication() as the context for getting
PermissionManager in system server process because it will be created
early in ActivityThread.attach() before any custom logic can run, but
it becomes a problem for apps because they can run their own logic by
overriding Application.attachBaseContext() and do things there before
ActivityThread.currentApplication() becomes non-null.

So pass in the split permissions explicitly as an external dependency
for ParsingPackageUtils, and move the getPackageArchiveInfo()
implementation from PackageManager to ApplicationPackageManager to
utilize the context there. PackageParser2 can get the split
permissions internally because it's only used in system server.

Fixes: 178155985
Test: manual
Change-Id: I8213cf752e16b08328ad1150b2639da18c5d0e83
(cherry picked from commit 7b8974d375)
2021-02-02 11:42:40 -08:00
TreeHugger Robot
b23f6d71ee Merge "Move GameManager to android.app package." into sc-dev 2021-02-02 19:36:13 +00:00
Shashwat Razdan
057896ae34 Adding owners in smartspace packages
Test: not needed as this is a meta file change

Change-Id: I32f5205c4c1b771aae963a20e9a52fa7691ce271
2021-02-02 17:50:18 +00:00
Yan Zhu
3ea0eb2bf8 Clean up split system user code for device policy management
Bug: 137101239
Test: build, sync and reboot
m update-api -j64 && m
atest FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest

Merged-In: Ibc642c04d3dcba84cd9837efb09cde04b46ff620
Change-Id: Ibc642c04d3dcba84cd9837efb09cde04b46ff620
(cherry picked from commit 8f9193aed0)
2021-02-02 09:00:08 -08:00
Eran Messeri
e02d4e358b Cache permission policy
Since the Permission Controller calls into DPM, to avoid a potential
circular dependency (where the DPMS holds a lock while the Permission
Controller calls it), cache the permission policy.

Bug: 158735247
Test: atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegation com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegation com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDelegation
Test: atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testPermissionAppUpdate com.android.cts.devicepolicy.MixedProfileOwnerTest#testPermissionPolicy com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPermissionAppUpdate com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPermissionPolicy com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testPermissionAppUpdate com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testPermissionPolicy
Change-Id: I6cfc027b063f43053d1ff4cc42d37935491064ff
2021-02-02 16:13:29 +00:00
junyulai
c59f67a79c [FUI21] Move scrubSubscriberId to utils class
This patch also removes the functionality of returning
original subscriberId in eng build since it is not really useful.

Test: atest NetworkIdentityUtilsTest
Bug: 174123988
Change-Id: I721457e571aa9403a2200b3e4261b4895e4f7a3e
2021-02-02 23:45:54 +08:00
Shashwat Razdan
fc890f1fba Merge "SmartspaceManager initial implementation" into sc-dev 2021-02-02 12:31:26 +00:00
Riddle Hsu
3a1d026bd4 Restore overridePendingTransition to a sync binder call
Otherwise the calling activity is not blocked and can proceed
to change activity state, that may cause the override request
to be dropped. In addition, it is usually called after
startActivity and finish which are non-one-way binder calls.
The order also needs to be guaranteed to make the override
take effect.

Bug: 161781274
Bug: 179008865
Test: WindowUntrustedTouchTest# \
      testWhenExitAnimationAboveThresholdFromSameUid_allowsTouch
Change-Id: I7ca018a934972c195040f2a9f63a18a59dce9c48
2021-02-02 10:15:16 +00:00
Adrian Roos
84199909eb Merge changes from topic "nullablecollection" into sc-dev
* changes:
  API: Suppress existing NullableCollections lints (TaskOrganizer)
  API: Suppress existing NullableCollections lints (S edition)
2021-02-02 09:24:38 +00:00
Donald Chai
9154c8febe Merge "Fix typo in comment." am: 182e90d1ea am: 2a0adcf0c6 am: 2b6eebf16d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1569600

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7b0cbedae16e9efbc88521901cb225c1b5e64f58
2021-02-02 07:12:02 +00:00
Donald Chai
2b6eebf16d Merge "Fix typo in comment." am: 182e90d1ea am: 2a0adcf0c6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1569600

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I314a3e97c4683dddb0ced5f5368e01586eea9919
2021-02-02 06:47:26 +00:00
Treehugger Robot
f602685a70 Merge "Have connectivity self-register manager classes" am: 4ad0fdc5c9 am: 98c48f7101 am: f99ed40471
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552657

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7a664bb9e9f2f835f148d0102f8b53c010bb7791
2021-02-02 06:40:07 +00:00