# Enterprise Device Management Overview (Available Only for System Applications)
## Overview
OpenHarmony provides Enterprise Device Management APIs to support enterprise APIs. You can use the APIs to implement system-level management and configuration of employee devices. For example, the IT personnel need to install enterprise applications, set security policies, set enterprise email addresses, access enterprise networks, and remotely restore factory settings (to clear lost or stolen device data).
## Developing Enterprise Management Applications
### Basic Concepts
- Device administrator application: a system application that has the [EnterpriseAdminExtensionAbility](../../application-models/enterprise-extensionAbility.md).
### Constraints
- Only the stage model is supported.
### Environment Setup
-[Download DevEco Studio](https://developer.harmonyos.com/en/develop/deveco-studio#download) and set it up as instructed on the official website.
4. Declare the permissions required. Before requesting permissions, ensure that the [basic principles for permission management](../../security/accesstoken-overview.md#basic-principles-for-permission-management) are met. Then, [declare the permissions](../../security/accesstoken-guidelines.md#acl).
### API Reference
To implement network management and Wi-Fi management, see:
The **EnterpriseAdminExtensionAbility** module provides Extension abilities for enterprise administrators.
The **EnterpriseAdminExtensionAbility** module provides extended enterprise device management capabilities.
To have the capabilities provided by the module, for example, receiving the application activation or deactivation notification sent by the system, an enterprise administrator application must have an **EnterpriseAdminExtensionAbility** instance and override the APIs in it.
To have the capabilities provided by this module, for example, to receive a notification when a device administrator application is enabled or disabled, you need to create an **EnterpriseAdminExtensionAbility** instance for the enterprise administrator application and overload related APIs.
> **NOTE**
>
...
...
@@ -20,7 +20,7 @@ import EnterpriseAdminExtensionAbility from '@ohos.enterprise.EnterpriseAdminExt
onAdminEnabled(): void
Called when an enterprise administrator is enabled.
Called when a device administrator application is enabled.
The **accountManager** module provides APIs for account management of enterprise devices. Only the device administrator applications can call the APIs provided by this module.
The **accountManager** module provides APIs for account management of enterprise devices.
> **NOTE**
>
> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module can be called only after a [device administrator application](js-apis-enterprise-adminManager.md#adminmanagerenableadmin) is enabled.
>
> - The APIs provided by this module can be called only by a [device administrator application](enterpriseDeviceManagement-overview.md#basic-concepts) that is [enabled](js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
## Modules to Import
...
...
@@ -46,13 +47,16 @@ For details about the error codes, see [Enterprise Device Management Error Codes
@@ -4,7 +4,9 @@ The **adminManager** module provides enterprise device management capabilities s
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> - The APIs provided by this module can be called only by a [device administrator application](enterpriseDeviceManagement-overview.md#basic-concepts).
## Modules to Import
...
...
@@ -47,19 +49,20 @@ For details about the error codes, see [Enterprise Device Management Error Codes
The **applicationManager** module provides application management capabilities, including adding, removing, and obtaining the applications that are forbidden to run. Only the enterprise device administrator applications can call the APIs provided by this module.
The **applicationManager** module provides application management capabilities, including adding, removing, and obtaining the applications that are forbidden to run.
> **NOTE**
>
> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module can be called only after a [device administrator application](js-apis-enterprise-adminManager.md#adminmanagerenableadmin) is enabled.
>
> - The APIs provided by this module can be called only by a [device administrator application](enterpriseDeviceManagement-overview.md#basic-concepts) that is [enabled](js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
## Modules to Import
...
...
@@ -37,7 +38,7 @@ Adds a list of applications that are forbidden to run by the current user throug
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
# @ohos.enterprise.dateTimeManager (System Time Management)
The **dateTimeManager** module provides APIs for system time management. Only the enterprise device administrator applications can call the APIs provided by this module.
The **dateTimeManager** module provides APIs for system time management.
> **NOTE**
>
> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module can be called only after a [device administrator application](js-apis-enterprise-adminManager.md#adminmanagerenableadmin) is enabled.
>
> - The APIs provided by this module can be called only by a [device administrator application](enterpriseDeviceManagement-overview.md#basic-concepts) that is [enabled](js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
## Modules to Import
...
...
@@ -46,13 +47,16 @@ For details about the error codes, see [Enterprise Device Management Error Codes
The **deviceControl** module provides APIs for device control, which can be called only by device administrator applications.
> **NOTE**
>
>
> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module can be called only after a [device administrator application](js-apis-enterprise-adminManager.md#adminmanagerenableadmin) is enabled.
>
>
> - The APIs provided by this module can be called only by a [device administrator application](enterpriseDeviceManagement-overview.md#basic-concepts) that is [enabled](js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
## Modules to Import
...
...
@@ -17,8 +19,7 @@ import deviceControl from '@ohos.enterprise.deviceControl'
# @ohos.enterprise.deviceInfo (Device Information Management)
The **deviceInfo** module provides APIs for enterprise device information management, including the API for obtaining device serial numbers. Only the enterprise device administrator applications can call the APIs provided by this module.
The **deviceInfo** module provides APIs for enterprise device information management, including the API for obtaining device serial numbers.
> **NOTE**
>
> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module can be called only after a [device administrator application](js-apis-enterprise-adminManager.md#adminmanagerenableadmin) is enabled.
>
> - The APIs provided by this module can be called only by a [device administrator application](enterpriseDeviceManagement-overview.md#basic-concepts) that is [enabled](js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
## Modules to Import
...
...
@@ -45,15 +46,16 @@ For details about the error codes, see [Enterprise Device Management Error Codes
The **deviceSettings** module provides APIs for setting enterprise devices, including obtaining the screen-off time of a device.
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module apply only to the [device administrator applications](enterpriseDeviceManagement-overview.md#basic-concepts). Before calling the APIs, you must enable the device administrator application(js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
Obtains the screen-off time of a device through the specified device administrator application. This API uses an asynchronous callback to return the result.
| callback | AsyncCallback<number> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null** and **data** is the device screen-off time obtained. Otherwise, **err** is an error object. |
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
This **restrictions** module provides APIs for setting general restriction policies, including disabling or enabling device printing and HDC.
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module can be called only by a [device administrator application](enterpriseDeviceManagement-overview.md#basic-concepts) that is [enabled](js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
Enables or disables device printing through the specified device administrator application. This API uses an asynchronous callback to return the result.
| disabled | boolean | Yes| Whether to disable device printing. The value **true** means to disable device printing; the value **false** means the opposite.|
| callback | AsyncCallback\<void> | Yes| Callback invoked to return the result.<br> If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.|
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
| disabled | boolean | Yes| Whether to disable device printing. The value **true** means to disable device printing; the value **false** means the opposite.|
**Return value**
| Type | Description |
| ----- | ----------------------------------- |
| Promise\<void> | Promise that returns no value. An error object will be thrown if the specified device administrator application fails to disable or enable the device printing function.|
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
Checks whether printing is disabled for devices through the specified device administrator application. This API uses an asynchronous callback to return the result.
| callback | AsyncCallback\<boolean> | Yes| Callback invoked to return the result. The value **true** means that device printing is disabled; the value **false** means the opposite.|
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
| Promise\<boolean> | Promise used to return the result. The value **true** means that device printing is disabled; the value **false** means the opposite.|
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
| disabled | boolean | Yes| Whether to disable HDC. The value **true** means to disable HDC; the value **false** means the opposite.|
| callback | AsyncCallback\<void> | Yes| Callback invoked to return the result.<br> If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.|
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
| disabled | boolean | Yes| Whether to disable HDC. The value **true** means to disable HDC; the value **false** means the opposite.|
**Return value**
| Type | Description |
| ----- | ----------------------------------- |
| Promise\<void> | Promise that returns no value. An error object will be thrown if the specified device administrator application fails to disable or enable HDC.|
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
| callback | AsyncCallback\<boolean> | Yes| Callback invoked to return the result. The value **true** means HDC is disabled; the value **false** means the opposite.|
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
The **wifiManager** module provides APIs for Wi-Fi management of enterprise devices. Only the device administrator applications can call the APIs provided by this module.
The **wifiManager** module provides APIs for Wi-Fi management of enterprise devices.
> **NOTE**
>
> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module can be called only after a [device administrator application](js-apis-enterprise-adminManager.md#adminmanagerenableadmin) is enabled.
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module can be called only by a [device administrator application](enterpriseDeviceManagement-overview.md#basic-concepts) that is [enabled](js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
## Modules to Import
...
...
@@ -29,31 +30,32 @@ Checks whether Wi-Fi is active through the specified device administrator applic
| callback | AsyncCallback<boolean> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null** and **data** is a Boolean value (**true** indicates that Wi-Fi is active; and **false** indicates that Wi-Fi is inactive). If the operation fails, **err** is an error object. |
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. |
...
...
@@ -128,29 +131,30 @@ Sets Wi-Fi to connect to the specified network. This API uses an asynchronous ca
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).