From 36072f7cb8b7935f05673e73db6f00da5d348a59 Mon Sep 17 00:00:00 2001 From: Annie_wang Date: Wed, 16 Aug 2023 15:44:43 +0800 Subject: [PATCH] update docs Signed-off-by: Annie_wang --- .../apis/js-apis-enterprise-adminManager.md | 124 +++++++++--------- 1 file changed, 63 insertions(+), 61 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-enterprise-adminManager.md b/en/application-dev/reference/apis/js-apis-enterprise-adminManager.md index b3ae186cc4..5732b77f4e 100644 --- a/en/application-dev/reference/apis/js-apis-enterprise-adminManager.md +++ b/en/application-dev/reference/apis/js-apis-enterprise-adminManager.md @@ -4,9 +4,11 @@ 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). +> The APIs of this module can be used only in the stage model. +> +> The APIs provided by this module can be called only by a [device administrator application](enterpriseDeviceManagement-overview.md#basic-concepts). ## Modules to Import @@ -18,7 +20,7 @@ import adminManager from '@ohos.enterprise.adminManager'; enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback\): void -Enables a device administrator application of the current user. This API uses an asynchronous callback to return the result. The super administrator application can be enabled only by the administrator. +Enables a device administrator application for the current user. The super device administrator application can be activated only by the administrator. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN @@ -30,9 +32,9 @@ Enables a device administrator application of the current user. This API uses an | Name | Type | Mandatory | Description | | -------------- | ----------------------------------- | ---- | ------------------ | -| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application to enable. | | enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information of the device administrator application. | -| type | [AdminType](#admintype) | Yes | Type of the device administrator to enable. | +| type | [AdminType](#admintype) | Yes | Type of the device administrator application to enable. | | callback | AsyncCallback\ | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| **Error codes** @@ -70,7 +72,7 @@ adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_ enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback\): void -Enables a device administrator application of the user specified by **userId**. This API uses an asynchronous callback to return the result. The super administrator application can be enabled only by the administrator. +Enables a device administrator application for the specified user. The super device administrator application can be activated only by the administrator. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN @@ -82,10 +84,10 @@ Enables a device administrator application of the user specified by **userId**. | Name | Type | Mandatory | Description | | -------------- | ----------------------------------- | ---- | ---------------------------- | -| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application to enable. | | enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information of the device administrator application. | -| type | [AdminType](#admintype) | Yes | Type of the device administrator to enable. | -| userId | number | Yes | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| +| type | [AdminType](#admintype) | Yes | Type of the device administrator application to enable. | +| userId | number | Yes | User ID, which must be greater than or equal to 0.
The default value is the user ID of the caller. | | callback | AsyncCallback\ | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. | **Error codes** @@ -123,7 +125,7 @@ adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_ enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise\ -Enables a device administrator application of the specified user (if **userId** is passed in) or the current user (if **userId** is not passed in). This API uses a promise to return the result. The super administrator application can be enabled only by the administrator. +Enables a device administrator application for the current or specified user. The super device administrator application can be activated only by the administrator. This API uses a promise to return the result. **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN @@ -135,16 +137,16 @@ Enables a device administrator application of the specified user (if **userId** | Name | Type | Mandatory | Description | | -------------- | ----------------------------------- | ---- | ---------------------------- | -| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application to enable. | | enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information of the device administrator application. | -| type | [AdminType](#admintype) | Yes | Type of the device administrator to enable. | -| userId | number | No | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| +| type | [AdminType](#admintype) | Yes | Type of the device administrator application to enable. | +| userId | number | No | User ID, which must be greater than or equal to 0.
- If **userId** is passed in, the application of the specified user is enabled.
- If **userId** is not passed in, the application of the current user is enabled.| **Return value** | Type | Description | | ----------------- | ----------------- | -| Promise\ | Promise that returns no value. If the operation fails, an error object is thrown.| +| Promise\ | Promise that returns no value. If the operation fails, an error object will be thrown.| **Error codes** @@ -177,7 +179,7 @@ adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_ disableAdmin(admin: Want, callback: AsyncCallback\): void -Disables a device administrator application of the current user. This API uses an asynchronous callback to return the result. +Disables a common administrator application for the current user. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN @@ -189,7 +191,7 @@ Disables a device administrator application of the current user. This API uses a | Name | Type | Mandatory | Description | | -------- | ----------------------------------- | ---- | ------------------- | -| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Common administrator application to disable. | | callback | AsyncCallback\ | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| **Error codes** @@ -221,7 +223,7 @@ adminManager.disableAdmin(wantTemp, (err) => { disableAdmin(admin: Want, userId: number, callback: AsyncCallback\): void -Disables a device administrator application of the user specified by **userId**. This API uses an asynchronous callback to return the result. +Disables a common administrator application for the specified user. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN @@ -233,8 +235,8 @@ Disables a device administrator application of the user specified by **userId**. | Name | Type | Mandatory | Description | | -------- | ----------------------------------- | ---- | ---------------------------- | -| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | -| userId | number | Yes | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| +| admin | [Want](js-apis-app-ability-want.md) | Yes | Common administrator application to disable. | +| userId | number | Yes | User ID, which must be greater than or equal to 0.
The default value is the user ID of the caller. | | callback | AsyncCallback\ | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. | **Error codes** @@ -266,7 +268,7 @@ adminManager.disableAdmin(wantTemp, 100, (err) => { disableAdmin(admin: Want, userId?: number): Promise\ -Disables a device administrator application of the specified user (if **userId** is passed in) or the current user (if **userId** is not passed in). This API uses a promise to return the result. +Disables a common administrator application for the current or specified user. This API uses a promise to return the result. **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN @@ -278,14 +280,14 @@ Disables a device administrator application of the specified user (if **userId** | Name | Type | Mandatory | Description | | ------ | ----------------------------------- | ---- | ---------------------------- | -| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | -| userId | number | No | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| +| admin | [Want](js-apis-app-ability-want.md) | Yes | Common administrator application to disable. | +| userId | number | No | User ID, which must be greater than or equal to 0.
- If **userId** is passed in, the application of the specified user is disabled.
- If **userId** is not passed in, the application of the current user is disabled.| **Return value** | Type | Description | | ----------------- | ----------------- | -| Promise\ | Promise that returns no value. If the operation fails, an error object is thrown.| +| Promise\ | Promise that returns no value. If the operation fails, an error object will be thrown.| **Error codes** @@ -312,7 +314,7 @@ adminManager.disableAdmin(wantTemp, 100).catch((err) => { disableSuperAdmin(bundleName: String, callback: AsyncCallback\): void -Disables a super device administrator application based on the specified bundle name. This API uses an asynchronous callback to return the result. +Disables a super administrator application for the administrator based on **bundleName**. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN @@ -324,14 +326,14 @@ Disables a super device administrator application based on the specified bundle | Name | Type | Mandatory | Description | | ---------- | ----------------------- | ---- | ------------------- | -| bundleName | String | Yes | Bundle name of the super device administrator application. | +| bundleName | String | Yes | Bundle name of the super administrator application to disable. | | callback | AsyncCallback\ | Yes | Callback invoked to return the result. 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). -| ID| Error Message | +| ID| Error Message | | ------- | ----------------------------------------------------------------- | | 9200005 | failed to disable the administrator application of the device. | @@ -353,7 +355,7 @@ adminManager.disableSuperAdmin(bundleName, (err) => { disableSuperAdmin(bundleName: String): Promise\ -Disables a super device administrator application based on the specified bundle name. This API uses a promise to return the result. +Disables a super administrator application for the administrator based on **bundleName**. This API uses a promise to return the result. **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN @@ -365,13 +367,13 @@ Disables a super device administrator application based on the specified bundle | Name | Type | Mandatory | Description | | ---------- | ------ | ---- | ------------ | -| bundleName | String | Yes | Bundle name of the super device administrator application.| +| bundleName | String | Yes | Bundle name of the super administrator application to disable.| **Return value** | Type | Description | | ----------------- | ----------------- | -| Promise\ | Promise that returns no value. If the operation fails, an error object is thrown.| +| Promise\ | Promise that returns no value. If the operation fails, an error object will be thrown.| **Error codes** @@ -405,7 +407,7 @@ Checks whether a device administrator application of the current user is enabled | Name | Type | Mandatory | Description | | -------- | ----------------------------------- | ---- | -------------------- | -| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application to check. | | callback | AsyncCallback\ | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null** and **data** is a Boolean value (**true** means that the device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object.| **Example** @@ -429,7 +431,7 @@ adminManager.isAdminEnabled(wantTemp, (err, result) => { isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback\): void -Checks whether a device administrator application of the user specified by **userId** is enabled. This API uses an asynchronous callback to return the result. +Checks whether a device administrator application of the specified user is enabled. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager @@ -439,8 +441,8 @@ Checks whether a device administrator application of the user specified by **use | Name | Type | Mandatory | Description | | -------- | ----------------------------------- | ---- | ---------------------------- | -| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | -| userId | number | Yes | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application to check. | +| userId | number | Yes | User ID, which must be greater than or equal to 0.
The default value is the user ID of the caller. | | callback | AsyncCallback\ | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null** and **data** is a Boolean value (**true** means that the device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object. | **Example** @@ -464,7 +466,7 @@ adminManager.isAdminEnabled(wantTemp, 100, (err, result) => { isAdminEnabled(admin: Want, userId?: number): Promise\ -Checks whether a device administrator application of the specified user (if **userId** is passed in) or the current user (if **userId** is not passed in) is enabled. This API uses a promise to return the result. +Checks whether a device administrator application of the current or specified user is enabled. This API uses a promise to return the result. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager @@ -474,14 +476,14 @@ Checks whether a device administrator application of the specified user (if **us | Name | Type | Mandatory | Description | | ------ | ----------------------------------- | ---- | ---------------------------- | -| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | -| userId | number | No | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application to check. | +| userId | number | No | User ID, which must be greater than or equal to 0.
- If **userId** is passed in, the application of the specified user is checked.
- If **userId** is not passed in, the application of the current user is checked.| **Return value** | Type | Description | | ----------------- | ------------------- | -| Promise\ | Promise used to return the result. If **true** is returned, the device administrator application is enabled. If **false** is returned, the device administrator application is not enabled.| +| Promise\ | Promise used to return the result. The value **true** means the device administrator application is enabled; the value **false** means the opposite.| **Example** @@ -502,7 +504,7 @@ adminManager.isAdminEnabled(wantTemp, 100).then((result) => { isSuperAdmin(bundleName: String, callback: AsyncCallback\): void -Checks whether a super device administrator application is enabled based on the specified bundle name. This API uses an asynchronous callback to return the result. +Checks whether a super administrator application of the administrator is enabled based on **bundleName**. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager @@ -512,8 +514,8 @@ Checks whether a super device administrator application is enabled based on the | Name | Type | Mandatory | Description | | ---------- | ----------------------- | ---- | -------------------- | -| bundleName | String | Yes | Device administrator application. | -| callback | AsyncCallback\ | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null** and **data** is a Boolean value (**true** means that the super device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object.| +| bundleName | String | Yes | Super administrator application to check. | +| callback | AsyncCallback\ | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null** and **data** is a Boolean value (**true** means that the device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object.| **Example** @@ -533,7 +535,7 @@ adminManager.isSuperAdmin(bundleName, (err, result) => { isSuperAdmin(bundleName: String): Promise\ -Checks whether a super device administrator application is enabled based on the specified bundle name. This API uses a promise to return the result. +Checks whether a super administrator application of the administrator is enabled based on **bundleName**. This API uses a promise to return the result. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager @@ -543,13 +545,13 @@ Checks whether a super device administrator application is enabled based on the | Name | Type | Mandatory | Description | | ---------- | ------ | ---- | --------- | -| bundleName | String | Yes | Super device administrator application.| +| bundleName | String | Yes | Super administrator application to check.| **Return value** | ID | Error Message | | ----------------- | ------------------- | -| Promise\ | Promise used to return the result. If **true** is returned, the super device administrator application is enabled. If **false** is returned, the super device administrator application is not enabled.| +| Promise\ | Promise used to return the result. The value **true** means the super administrator application is enabled; the value **false** means the opposite. | **Example** @@ -567,7 +569,7 @@ adminManager.isSuperAdmin(bundleName).then((result) => { setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback\;): void -Sets the enterprise information of a device administrator application. This API uses an asynchronous callback to return the result. +Sets enterprise information for a device administrator application. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.SET_ENTERPRISE_INFO @@ -580,7 +582,7 @@ Sets the enterprise information of a device administrator application. This API | Name | Type | Mandatory | Description | | -------------- | ----------------------------------- | ---- | ---------------------- | | admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | -| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information of the device administrator application. | +| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information to set. | | callback | AsyncCallback\; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| **Error codes** @@ -616,7 +618,7 @@ adminManager.setEnterpriseInfo(wantTemp, enterpriseInfo, (err) => { setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise\; -Sets the enterprise information of a device administrator application. This API uses a promise to return the result. +Sets enterprise information for a device administrator application. This API uses a promise to return the result. **Required permissions**: ohos.permission.SET_ENTERPRISE_INFO @@ -629,13 +631,13 @@ Sets the enterprise information of a device administrator application. This API | Name | Type | Mandatory | Description | | -------------- | ----------------------------------- | ---- | ------------ | | admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | -| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information of the device administrator application.| +| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information to set.| **Return value** | Type | Description | | ----------------- | --------------------- | -| Promise\ | Promise that returns no value. If the operation fails, an error object is thrown.| +| Promise\ | Promise that returns no value. If the operation fails, an error object will be thrown.| **Error codes** @@ -724,7 +726,7 @@ Obtains the enterprise information of a device administrator application. This A | Type | Description | | ---------------------------------------- | ------------------------- | -| Promise<[EnterpriseInfo](#enterpriseinfo)> | Promise used to return the enterprise information of the specified device administrator application obtained.| +| Promise<[EnterpriseInfo](#enterpriseinfo)> | Promise used to return the enterprise information obtained.| **Error codes** @@ -753,7 +755,7 @@ adminManager.getEnterpriseInfo(wantTemp).then((result) => { subscribeManagedEvent(admin: Want, managedEvents: Array\, callback: AsyncCallback\): void -Subscribes to system management events through the specified device administrator application. This API uses an asynchronous callback to return the result. +Subscribes to system management events of a device administrator application. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT @@ -800,7 +802,7 @@ adminManager.subscribeManagedEvent(wantTemp, events, (err) => { subscribeManagedEvent(admin: Want, managedEvents: Array\): Promise\ -Subscribes to system management events through the specified device administrator application. This API uses a promise to return the result. +Subscribes to system management events of a device administrator application. This API uses a promise to return the result. **Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT @@ -819,7 +821,7 @@ Subscribes to system management events through the specified device administrato | Type | Description | | ----- | ----------------------------------- | -| Promise\ | Promise that returns no value. If the operation fails, an error object is thrown.| +| Promise\ | Promise that returns no value. If the operation fails, an error object will be thrown.| **Error codes** @@ -849,7 +851,7 @@ adminManager.subscribeManagedEvent(wantTemp, events).then(() => { unsubscribeManagedEvent(admin: Want, managedEvents: Array\, callback: AsyncCallback\): void -Unsubscribes from system management events through the specified device administrator application. This API uses an asynchronous callback to return the result. +Unsubscribes from system management events of a device administrator application. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT @@ -896,7 +898,7 @@ adminManager.unsubscribeManagedEvent(wantTemp, events, (err) => { unsubscribeManagedEvent(admin: Want, managedEvents: Array\): Promise\ -Unsubscribes from system management events through the specified device administrator application. This API uses a promise to return the result. +Unsubscribes from system management events of a device administrator application. This API uses a promise to return the result. **Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT @@ -915,7 +917,7 @@ Unsubscribes from system management events through the specified device administ | Type | Description | | ----- | ----------------------------------- | -| Promise\ | Promise that returns no value. If the operation fails, an error object is thrown.| +| Promise\ | Promise that returns no value. If the operation fails, an error object will be thrown.| **Error codes** @@ -943,7 +945,7 @@ adminManager.unsubscribeManagedEvent(wantTemp, events).then(() => { ## EnterpriseInfo -Defines the enterprise information of a device administrator application. +Represents the enterprise information of a device administrator application. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager @@ -951,12 +953,12 @@ Defines the enterprise information of a device administrator application. | Name | Type | Mandatory| Description | | ----------- | --------| ---- | ------------------------------- | -| name | string | Yes | Name of the enterprise to which the device administrator application belongs.| -| description | string | Yes | Description of the enterprise to which the device administrator application belongs.| +| name | string | Yes | Name of the enterprise.| +| description | string | Yes | Description of the enterprise.| ## AdminType -Enumerates the administrator types of the device administrator application. +Enumerates the types of device administrator applications. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager @@ -964,8 +966,8 @@ Enumerates the administrator types of the device administrator application. | Name | Value | Description | | ----------------- | ---- | ----- | -| ADMIN_TYPE_NORMAL | 0x00 | Common administrator.| -| ADMIN_TYPE_SUPER | 0x01 | Super administrator.| +| ADMIN_TYPE_NORMAL | 0x00 | Common administrator application.| +| ADMIN_TYPE_SUPER | 0x01 | Super administrator application.| ## ManagedEvent -- GitLab