Skip to content

Most visited

Recently visited

navigation

Android in the Enterprise

Android enterprise includes many new features and APIs, as well as some behavior changes, that apply to devices running Android O.

New APIs and features

We've made the profile owner and device owner management modes more powerful, productive, and easier to provision than ever before. We've also enabled a whole new deployment scenario. These and other features are described in the following sections.

Work profiles on fully managed devices

In Android O, fully managed devices can also have work profiles. This gives enterprises the ability to separate apps and policies while maintaining control and visibility across both profiles. The existing device owner, or a different device policy controller (DPC), can create the managed profile.

During provisioning, a device owner's DPC can use EXTRA_PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION to copy an account from a personal profile to a work profile without removing the account from the personal profile. Device owners can create a managed profile without user interaction by calling EXTRA_PROVISIONING_SKIP_USER_CONSENT.

Device owners can receive notifications when secondary users or managed profiles are created or removed. The callbacks are onUserAdded() and onUserRemoved().

Device owners can prevent other DPCs from creating managed profiles using DISALLOW_ADD_MANAGED_PROFILE. This setting is the default in Android O for device owners on newly provisioned devices or devices upgraded to Android O. Device owners can also prevent users from removing existing managed profiles using DISALLOW_REMOVE_MANAGED_PROFILE.

Device owners and profile owners can communicate with each other if they're from the same APK and the owners are affiliated (see User affiliation below). Before a device owner or a profile owner can communicate with each other, they first need to bind to the target service as a target user. To call services across profile boundaries, bind using bindDeviceAdminServiceAsUser().

Note: Device owners and profile owners can use getBindDeviceAdminTargetUsers() to retrieve a list of users that they can bind to.

User affiliation

When a device owner and a profile owner represent the same organization:

Affiliation IDs, attached to a profile or user, identify organizations. When affiliation IDs match, the users become affiliated. Device owners and profile owners use setAffiliationIds() to set their affiliation IDs. Organizations should choose long, difficult to guess, strings as IDs.

New access for affiliated users

If all the secondary users and profiles on a device are affiliated with the device owner then the following features are now available:

Security logging and bug reporting were previously only available to single-user devices, or devices with only one profile and one user.

Lock task mode is available to secondary users and managed profiles when affiliated with the device owner. For more information on using this mode, see the reference documentation for setLockTaskPackages().

Customized provisioning disclaimers

DPCs can now show their own disclaimers to users during provisioning. Use EXTRA_PROVISIONING_DISCLAIMERS, EXTRA_PROVISIONING_DISCLAIMER_HEADER, and EXTRA_PROVISIONING_DISCLAIMER_CONTENT to supply styled text disclaimers. A DPC's custom disclaimers appear in the collapsible Terms list.

Security

Profile owners and device owners can use setRequiredStrongAuthTimeout() to configure a timeout period for unlocking a device or a profile with a secondary authentication method, such as fingerprints or trust agents. After the timeout period expires, the user must unlock the device or profile using a strong authentication method, such as a password, PIN, or pattern.

Device owners and profile owners can securely reset device and work profile passwords using resetPasswordWithToken(). For devices that support file-based encryption, this API is available before a user unlocks their device or profile, provided the DPC is encryption-aware.

When locking a work profile on a device that supports file-based encryption, lockNow(int) can optionally evict the work profile's master encryption keys using the FLAG_EVICT_CE_KEY flag. The encryption keys are also evicted if the user turns their work profile off.

Also, device owners can use setNetworkLoggingEnabled() to turn on network logging of DNS queries and TCP connections initiated from corporate-owned devices. When network logging is enabled, the DPC receives batched network events from onNetworkLogsAvailable(). To retrieve the logs, the DPC should call retrieveNetworkLogs().

Finally, profile owners and device owners can retrieve information about the pending system updates that are available on a device using getPendingSystemUpdate().

App management API delegation

API delegation enables device owners and profile owners to fully offload app management to other applications. The DevicePolicyManager class provides methods to manage the delegation scopes that device and profile owners can grant to a package:

The following table shows how various methods in DevicePolicyManager are organized into the different scopes:

Table 1. Correspondence between scopes and device policy methods

Group Methods
DELEGATION_CERT_INSTALL
DELEGATION_APP_RESTRICTIONS
DELEGATION_BLOCK_UNINSTALL setUninstallBlocked()
DELEGATION_PERMISSION_GRANT
DELEGATION_PACKAGE_ACCESS
DELEGATION_ENABLE_SYSTEM_APP enableSystemApp()

Long-running background services

Device and profile owners can subclass DeviceAdminService to create background services. The Android system attempts to keep the service running while the user is running. If you want to run periodic tasks, consider using JobScheduler before creating a background service.

Controlling the backup service

Device owners can toggle the Android Backup Service using new methods in DevicePolicyManager. Enable and disable the backup service using setBackupServiceEnabled(). Check the backup service status using isBackupServiceEnabled().

Wi-Fi proxy configuration

Device owners and profile owners can configure HTTP proxy servers for Wi-Fi networks. Use a PAC file or manual settings to configure a proxy server for each Wi-Fi network. To set or remove the proxy for a WifiConfiguration, call its setHttpProxy() method. To get the proxy settings call getHttpProxy().

Explanation dialogs for admin-disabled features

Your app should show a useful explanation to users trying to use an admin-disabled feature. All apps can now use createAdminSupportIntent() to create an intent that displays an explanation dialog when passed to startActivity(Intent). Intents include customized, localized explanations for disabled cameras, disabled screen captures, and all the UserManager restrictions.

Restricting Bluetooth

Device owners can disable Bluetooth—affecting all users and profiles on the device. To turn off Bluetooth, add the user restriction DISALLOW_BLUETOOTH.

Behavior changes

If you're building apps for businesses, including DPCs, you should review the following behavior changes in Android O and modify your app accordingly.

Removing users

Device owners can remove secondary users and managed profiles using removeUser(), even if DISALLOW_REMOVE_USER is enabled.

Security

Authentication

The following changes have taken effect in the DevicePolicyManager class:

Data from locked work profiles

Android O includes user interface changes to separate data from a locked work profile.

Device integrity

Always-on VPN

Android O includes user interface changes to help users understand the status of always-on VPN connections:

The VpnService of VPN apps must now call its startForeground() method after launch. Because the Android system starts a VPN app's service directly, transitioning to the foreground is the app's responsibility. Android O shuts down VPN apps that don't transition the VPN service to the foreground.

Password callbacks

The password change callbacks of DeviceAdminReceiver now include a user parameter to identify the user or profile the password belongs to. The new method signatures are:

The default implementation of each new method calls the previous version—dropping the user argument. Android O deprecates the previous methods.

App management API delegation

The following methods in the DevicePolicyManager class are now deprecated:

Also, it's now possible to delegate a single scope to multiple packages. In other words, device owners and profile owners can grant two different packages access to the same set of APIs simultaneously.

This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.