* Introduced new logic that allows the profile owner of an
organization-owned device (COPE PO) to set the default
SMS application in the personal profile.
* Modified the API to be callable on the parent profile
instance if called by the COPE PO.
* When called by the COPE PO, the package provided
must be a system package, otherwise an IllegalArgument
Exception is thrown.
Bug: 148060194
Test: atest android.admin.cts.DevicePolicyManagerTest#testSetDefaultSmsApplication_failIfNotDeviceOwner
Change-Id: I5b86b10a13064f4ec852631e19f89a80a104dc2b
If this policy is set:
* Whenever work profile gets turned off or system boots, timer is
started, so theat unless the profile is unlocked in time, apps
will be suspended.
* when the user is unlocked, alarm is discharged.
Currently there is no upfront warning notification, will be addressed
in a follow-up.
Bug: 143517719
Test: manual, using TestDPC
Change-Id: Ib0f936b6d1414f65ae8c86367b7059c14862827d
DPM can currently control the master location toggle, but cannot
influence the behavior of individual providers. This adds an API for
DPM (or other privileged entities) to request a provider to turn itself
on.
Practically, this is necessary to allow DPM to control network location,
which may be gated by additional consents. This change also renames some
internal location code to make clearer the distinction between provider
enabled and provider allowed: enabled = location on && allowed
Bug: 136219903
Test: CTS tests to be added
Change-Id: I05f03c976428f0f5a8a2cf627a84dc9e2baf3e67
Allows profile owner of corporate-owned managed profile to call
the following APIs:
* setSystemUpdatePolicy
* installSystemUpdate
The following APIs can already be called by regular profile owners
so no changes are needed:
* getSystemUpdatePolicy
* getPendingSystemUpdate
Test: atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testSystemUpdatePolicy
Test: atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testInstallUpdate
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSystemUpdatePolicy
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testInstallUpdate
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testInstallUpdateLogged
Bug: 147414327
Change-Id: I7224eb208f665ca7cb301daa7d17cce5126f7858
* Introduced new logic that allows the profile owner of an
organization-owned device (COPE PO) to hide/unhide system
apps in the personal profile.
* Modified both APIs to be callable on the parent profile
instance if called by the COPE PO.
* When called by the COPE PO, the package provided
must be a system package, otherwise an IllegalArgument
Exception is thrown.
Bug: 147413198
Test: manual testing
atest com.android.server.devicepolicy.DevicePolicyManagerTest
atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testApplicationHidden
atest com.android.cts.devicepolicy.ManagedProfileTest#testParentProfileApiDisabled
Change-Id: I4fae8acee9f00e3b9c805f29cf826f917cda6abd
* When personal apps are suspended, only dialer, IMEs, a11y, launcher
are some other critical apps are exempted.
* User is presented with notification, clicking on which invokes an
activity in the DPC.
Bug: 147414651
Test: manual via TestDPC
Change-Id: I09f8dad08e54b0ce8201cd5c76b3f34342e0da8f
When the admin unsets cross-profile packages, reset the
INTERACT_ACROSS_PROFILES app-op back to the default if it is no longer
configurable by the user.
Other minor changes:
- Remove the explicit app-op permission check from
setInteractAcrossProfilesAppOp, since AppOpManager performs that check
when required.
- Fix the broadcasting logic in CrossProfileAppsServiceImpl to correctly
set the component and flags.
Bug: 136249261
Bug: 148010178
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.ManagedProfileCrossProfileTest
Change-Id: Ib8b5f331fb92fc475bc95ad039adf93fac04da37
The new DPM API allows DP/POs to set whether the keyguard needs to show a secondary lockscreen after the primary locking mechanism is dismissed. If enabled, the keyguard will check for a service handling ACTION_BIND_SECONDARY_LOCKSCREEN_SERVICE and request the secondary lockscreen content from it.
Bug: 136085151
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest KeyguardUpdateMonitorTest
Test: atest AdminSecondaryLockScreenControllerTest
Change-Id: If82921b4fc2d78c0522a20ef91b48f9a93dd8b61
* Historically, only the device owner could prevent the user from modifying
networks that have been configured by the device owner.
* In New COPE mode, the COPE profile owner should now be able to prevent the
user from modifying networks as well as the device owner.
* This CL adds new APIs which are callable by the device owner or profile
owner of an organization-owned managed profile. These new API can be used
to toggle the global setting WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN, instead of
setting the global setting directly.
* This CL only affects networks configured by the admin, is does not prevent
the user from creating more network configurations.
Bug: 147476790
Test: manual testing with TestDPC
atest com.android.server.devicepolicy.DevicePolicyManagerTest
atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testAdminConfiguredNetworks
atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testAdminConfiguredNetworks
Change-Id: Ia16e639922bb08cdacd9a3766d978ac150b693c5
Use hasPermissionOrAppOpForPreflight to check for
INTERACT_ACROSS_PROFILES permission or appop rather than only
checking for the permission.
BUG: 140728653
BUG: 136249261
Test: atest CrossProfileAppsPermissionHostSideTest
Test: atest CrossProfileAppsHostSideTest
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Test: atest ContextCrossProfileHostTest
Change-Id: I81d428d47afd54f294ef9bb44133004762840d09
Prevent the device policy client from granting the location permission
via explicit grant (setPermissionGrantState).
Unless on a managed, unattended kiosk device, the user has to explicitly
grant location-related permissions.
Location-related permissions can still be denied automatically.
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testLocationPermissions
Bug: 147650798
Change-Id: I5a1099a15b94a287414e42e174735dc87f930c6f
Added @SystemApi to all APIs currently used by TvProfileService that were @hide only.
Bug: 139914710
Test: Apps built with stable_system or experimental_system can use the APIs
Change-Id: I3499244b4d545a7a9401c7941663045bcd89c6fe
User restrictions are null for PO parent admin, so we need to ensure
they are initialized before adding.
Bug: 147884539
Test: atest com.android.server.devicepolicy.DevicePolicyManagerServiceMigrationTest#testCompMigrationAffiliated
Change-Id: I5024ac585e30081f944717cfe8d4b920b644213e
We now have javadoc based docs generated from these comments now. Ensure
the links can be resolved.
Bug: 144927670
Test: Test: m -j offline-sdk-docs
Change-Id: Ie9827ad02ad91ab7f01226a3a741c94fa46de730
Common Criteria mode puts device into a state where certain
funtionalities are tuned or turned on to meet the higher security
requirement from Common Criteria certification. Device Owner
can use the new device policy API to toggle Common Criteria mode.
Bug: 137937540
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest SettingsProviderTest
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testCommonCriteriaMode
Test: atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testCommonCriteriaMode
Change-Id: If07c053437e980ed3317d3838cc74e5bfd44efce
When the syste boots, check if the device is in COMP mode and if it is:
* Mark PO as PO on corp owned device.
* Migrate policies from from DO admin to PO parent instance:
* password, timeout, keyguard related policies
* camera, screenshot
* accounts types with management disabled
* support messages
* applicable user restrictions
* Clears DO and disables it as device admin.
Two new unit tests verify that the decision whether to migrate or not is made
correctly and that after the migrateion DO ceases to be device admin.
Test: atest com.android.server.devicepolicy.DevicePolicyManagerServiceMigrationTest
Bug: 143516163
Change-Id: I9131fb35da0f78066a662eed9c00207a5a923352
Make isOrganizationOwnedDeviceWithManagedProfile a public method, as
there is no reason to keep this information hidden from apps.
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedDeviceOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
Bug: 143518237
Bug: 144978467
Bug: 147340575
Bug: 146123237
Change-Id: Iab45f20c9150a6b8bd48eea610484f36f199d3d7
Restrict adding a managed profile when the device has a device owner.
This mode is no longer supported, in favour of Corporate Owned,
Personally Enabled mode (Organization-Owned device with Managed Profile).
The restriction on adding managed profiles is now added by default when
a device owner is set, and is removed when the device owner is removed,
to avoid other system copoments from creating a managed profile when
there's a device owner.
Additionally, the method for checking whether pre-provisioning
conditions are met has been modified to return an error if the
restriction is set.
Bug: 145271440
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: Ife25f4e2faffe84d85ab7786407c14997b4cf069
Historically, FRP behaviour was built on top of the application restrictions
infrastructure. This CL introduces new behaviour, as the profile owner of an
organization-owned device needs to be able to control FRP behaviour and
cannot set application restrictions on user 0.
- Introduced a new FactoryResetProtectionPolicy object
- Added it as a field to ActiveAdmin
- Created a default value
- Added setFactoryResetProtectionPolicy to DPM which is used to set a
factory reset protection policy. If the policy is null, the current
policy is cleared and set back to the default value.
- Added getFactoryResetProtectionPolicy to DPM to retrieve the current
factory reset protection policy. If this is the default value, then
no policy is set.
- Both these APIs are callable by the device owner or profile owner of
an organization-owned device.
Bug: 143517230
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
atest com.android.server.devicepolicy.FactoryResetProtectionPolicyTest
atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testFactoryResetProtectionPolicy
atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testFactoryResetProtectionPolicy
Change-Id: I72c4d06ec8a27741a1956d082969573077937726
Add CrossProfileApps#canRequestInteractAcrossProfiles,
and CrossProfileApps#canInteractAcrossProfiles public APIs.
This provides apps the ability to check if they can interact across profiles,
or can they request that from the user if not.
BUG: 136249261
Test: in progress
Change-Id: Ifd561d5d5efcd167e24a5f05c22496d1fe9c81fc
Add a method to the DevicePolicyManager for finding out if the device is
an organization-owned device with a work profile (i.e. it has a work
profile but the work profile was created during the provisioning flow).
This method is currently available for privileged callers (system API),
since other methods (e.g. isDeviceManaged) are also restricted.
NOTE: Addition of GTS tests is pending final decision on whether this
will be public API or not.
Bug: 143518237
Bug: 144978467
Bug: 147340575
Test: atest FrameworksServicesTests:DevicePolicyManagerTest#testIsOrganizationOwnedDevice
Test: CTS tests that are on hold for now.
Change-Id: I26ce1de10844dc297924427a6d46df9208931ab0
Fixing a bug in ag/9885696.
Changed to get the active admin for the current user rather
than the calling user.
BUG: 136249261
Test: atest CrossProfileAppsPermissionHostSideTest
Change-Id: I847056b4dbca215438a9856c456d6042ea4fa891