Provisioning Service

MDEP platform is capable to support multiple service providers. Provisioning/de-provisioning of the device on the fly can be problematic in some cases, such as when the service provider needs to acquire the ownership of the device (i.e., needs to act as a Device Policy Controller) and therefore there are some aspects of the architecture that cannot be completely abstracted; the reset/release of the device ownership (which can only be conducted by the owner) or any custom logic which is specific to the service provider.

The provisioning process is first triggered by the Setup Wizard application, either when the user selects the service provider on the dedicated screen or implicitly in the background if the device supports only one service provider.

Provisioning of New Service Provi

Provisioning of New Service Provider

The actual implementation of the provisioning procedure must be decoupled from the SUW application so that in the future, other components can manage the current service provider selection function as well (i.e., using the Settings App or Partner web-based device management, etc.).

To meet the above requirements, MDEP introduces a Provisioning Service to enable installation of different service providers on a device in a scalable way.

Provisioning Service Architecture Diagram

Provisioning Service Architecture Diagram

Service Provisioning is an Android bound/background service which implements the actual logic for handling the actions needed when provisioning/de-provisioning a service provider. It handles:

  • The parsing and fetching of the service providers’ configuration from the manifest files.
  • Service provider’s binaries/apks installation/uninstallation. In order to do that, it depends on the standard Android framework (i.e., the AOSP Package Manager).
  • Pre-granting of all required runtime permissions for the installed apks.

Internally it implements a state machine to handle the standard provisioning flow. Running as a system privileged service, it can make use of the AOSP DevicePolicyManager to wipe data or manage the device admin/ownership during the provisioning/reprovisioning procedure.

Provisioning Service Component Diagram

Provisioning Service Component Diagram

It exposes Binder API encapsulated into a Provisioning Manager Java client library which is instantiated by the client application and runs within its process. It follows the design of a standard Manager in Android, providing a friendly API for the client to use and abstracts the connection handling between the client and the background/bound service, over Binder IPC (calls to ServiceManager, connect/disconnect callbacks, retries etc.).

In the future, for V2+ implementation, the Provisioning Service design can be enhanced with a new interface (IServiceProvisioning API) which shall allow the Partner to implement plugins/extensions which add extra features to this service, such as support for custom actions required by specific service providers during provisioning flow or the ability to execute on the fly provisioning/de-provisioning.

Access to ProvisioningManager API is restricted to privileged clients (that are signed with the same certificate as Provisioning Service) or have declared to use permission com.microsoft.provisioning.PROVISIONING_PERMISSION in the Manifest.