Add a flag indicating whether an admin may or may not control permission
grants for sensors-related permissions.
By default, on a fully-managed device, the admin may control sensor
permission grants. The admin may opt-out by providing the newly-added
provisioning extra, EXTRA_PROVISIONING_PERMISSION_GRANT_OPT_OUT.
On a managed profile, will no longer be able to control sensor
permission grants.
This change adds the provisioning extra and state flag in the
ActiveAdmin, a follow-up change will make the permission controller
utilize the flag.
Bug: 158735247
Test: atest android.devicepolicy.cts.DevicePolicyManagerTest
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testAdminControlOverSensorPermissionGrantsDefault com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testAdminControlOverSensorPermissionGrantsDefault com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testAdminControlOverSensorPermissionGrantsDefault com.android.cts.devicepolicy.MixedProfileOwnerTest#testAdminControlOverSensorPermissionGrantsDefault
Change-Id: Iffd02450ee624416eccda8301ff84676f226c0d0
Since WindowContext won't add WindowToken from the client side,
addWindowTokenWithOption is no more needed. Also remove the logic
to invoke removeWindowToken from the client side.
Bug: 159767464
Bug: 153369119
Test: atest WindowManagerServiceTests WindowManagerPermissionTests
Change-Id: Ib0c948dca223cf8d056865ce3a0d4adaef07d247
This will be used in subsequent cls to allow the StorageManagerService
delay the ANR dialog for an app undergoing transcoding at the time of
ANR
Test: Manual
Bug: 170486601
Change-Id: I5431d22bd8faa75e3deab1960a2f721784f98d42
This reverts commit 10f79644fc.
Reason for revert: Explained in b/153995973#comment40
Bug: 153995973
Change-Id: I437400528cb98e9ce665ebc308bfe05f4f24ca13
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
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
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
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
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
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
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
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
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
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
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
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)