提交 36072f7c 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 7f5c1996
...@@ -4,9 +4,11 @@ The **adminManager** module provides enterprise device management capabilities s ...@@ -4,9 +4,11 @@ The **adminManager** module provides enterprise device management capabilities s
> **NOTE** > **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 ## Modules to Import
...@@ -18,7 +20,7 @@ import adminManager from '@ohos.enterprise.adminManager'; ...@@ -18,7 +20,7 @@ import adminManager from '@ohos.enterprise.adminManager';
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback\<void>): void enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback\<void>): 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 **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 ...@@ -30,9 +32,9 @@ Enables a device administrator application of the current user. This API uses an
| Name | Type | Mandatory | Description | | 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. | | 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\<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.|
**Error codes** **Error codes**
...@@ -70,7 +72,7 @@ adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_ ...@@ -70,7 +72,7 @@ adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback\<void>): void enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback\<void>): 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 **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
...@@ -82,10 +84,10 @@ Enables a device administrator application of the user specified by **userId**. ...@@ -82,10 +84,10 @@ Enables a device administrator application of the user specified by **userId**.
| Name | Type | Mandatory | Description | | 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. | | 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. |
| 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**.| | userId | number | Yes | User ID, which must be greater than or equal to 0.<br>The default value is the user ID of the caller. |
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. | | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. |
**Error codes** **Error codes**
...@@ -123,7 +125,7 @@ adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_ ...@@ -123,7 +125,7 @@ adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise\<void> enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise\<void>
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 **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
...@@ -135,16 +137,16 @@ Enables a device administrator application of the specified user (if **userId** ...@@ -135,16 +137,16 @@ Enables a device administrator application of the specified user (if **userId**
| Name | Type | Mandatory | Description | | 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. | | 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. |
| 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**.| | userId | number | No | User ID, which must be greater than or equal to 0.<br> - If **userId** is passed in, the application of the specified user is enabled.<br> - If **userId** is not passed in, the application of the current user is enabled.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ----------------- | | ----------------- | ----------------- |
| Promise\<void> | Promise that returns no value. If the operation fails, an error object is thrown.| | Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.|
**Error codes** **Error codes**
...@@ -177,7 +179,7 @@ adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_ ...@@ -177,7 +179,7 @@ adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_
disableAdmin(admin: Want, callback: AsyncCallback\<void>): void disableAdmin(admin: Want, callback: AsyncCallback\<void>): 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 **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 ...@@ -189,7 +191,7 @@ Disables a device administrator application of the current user. This API uses a
| Name | Type | Mandatory | Description | | 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\<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.|
**Error codes** **Error codes**
...@@ -221,7 +223,7 @@ adminManager.disableAdmin(wantTemp, (err) => { ...@@ -221,7 +223,7 @@ adminManager.disableAdmin(wantTemp, (err) => {
disableAdmin(admin: Want, userId: number, callback: AsyncCallback\<void>): void disableAdmin(admin: Want, userId: number, callback: AsyncCallback\<void>): 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 **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
...@@ -233,8 +235,8 @@ Disables a device administrator application of the user specified by **userId**. ...@@ -233,8 +235,8 @@ Disables a device administrator application of the user specified by **userId**.
| Name | Type | Mandatory | Description | | 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. |
| 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**.| | userId | number | Yes | User ID, which must be greater than or equal to 0.<br>The default value is the user ID of the caller. |
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. | | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. |
**Error codes** **Error codes**
...@@ -266,7 +268,7 @@ adminManager.disableAdmin(wantTemp, 100, (err) => { ...@@ -266,7 +268,7 @@ adminManager.disableAdmin(wantTemp, 100, (err) => {
disableAdmin(admin: Want, userId?: number): Promise\<void> disableAdmin(admin: Want, userId?: number): Promise\<void>
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 **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
...@@ -278,14 +280,14 @@ Disables a device administrator application of the specified user (if **userId** ...@@ -278,14 +280,14 @@ Disables a device administrator application of the specified user (if **userId**
| Name | Type | Mandatory | Description | | 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. |
| 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**.| | userId | number | No | User ID, which must be greater than or equal to 0.<br> - If **userId** is passed in, the application of the specified user is disabled.<br> - If **userId** is not passed in, the application of the current user is disabled.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ----------------- | | ----------------- | ----------------- |
| Promise\<void> | Promise that returns no value. If the operation fails, an error object is thrown.| | Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.|
**Error codes** **Error codes**
...@@ -312,7 +314,7 @@ adminManager.disableAdmin(wantTemp, 100).catch((err) => { ...@@ -312,7 +314,7 @@ adminManager.disableAdmin(wantTemp, 100).catch((err) => {
disableSuperAdmin(bundleName: String, callback: AsyncCallback\<void>): void disableSuperAdmin(bundleName: String, callback: AsyncCallback\<void>): 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 **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
...@@ -324,14 +326,14 @@ Disables a super device administrator application based on the specified bundle ...@@ -324,14 +326,14 @@ Disables a super device administrator application based on the specified bundle
| Name | Type | Mandatory | Description | | 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\<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.|
**Error codes** **Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). 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. | | 9200005 | failed to disable the administrator application of the device. |
...@@ -353,7 +355,7 @@ adminManager.disableSuperAdmin(bundleName, (err) => { ...@@ -353,7 +355,7 @@ adminManager.disableSuperAdmin(bundleName, (err) => {
disableSuperAdmin(bundleName: String): Promise\<void> disableSuperAdmin(bundleName: String): Promise\<void>
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 **Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
...@@ -365,13 +367,13 @@ Disables a super device administrator application based on the specified bundle ...@@ -365,13 +367,13 @@ Disables a super device administrator application based on the specified bundle
| Name | Type | Mandatory | Description | | 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** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ----------------- | | ----------------- | ----------------- |
| Promise\<void> | Promise that returns no value. If the operation fails, an error object is thrown.| | Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.|
**Error codes** **Error codes**
...@@ -405,7 +407,7 @@ Checks whether a device administrator application of the current user is enabled ...@@ -405,7 +407,7 @@ Checks whether a device administrator application of the current user is enabled
| Name | Type | Mandatory | Description | | 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\<boolean> | 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.| | 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** means that the device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object.|
**Example** **Example**
...@@ -429,7 +431,7 @@ adminManager.isAdminEnabled(wantTemp, (err, result) => { ...@@ -429,7 +431,7 @@ adminManager.isAdminEnabled(wantTemp, (err, result) => {
isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback\<boolean>): void isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback\<boolean>): 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 **System capability**: SystemCapability.Customization.EnterpriseDeviceManager
...@@ -439,8 +441,8 @@ Checks whether a device administrator application of the user specified by **use ...@@ -439,8 +441,8 @@ Checks whether a device administrator application of the user specified by **use
| Name | Type | Mandatory | Description | | 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. |
| 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**.| | userId | number | Yes | User ID, which must be greater than or equal to 0.<br> The default value is the user ID of the caller. |
| 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** means that the device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object. | | 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** means that the device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object. |
**Example** **Example**
...@@ -464,7 +466,7 @@ adminManager.isAdminEnabled(wantTemp, 100, (err, result) => { ...@@ -464,7 +466,7 @@ adminManager.isAdminEnabled(wantTemp, 100, (err, result) => {
isAdminEnabled(admin: Want, userId?: number): Promise\<boolean> isAdminEnabled(admin: Want, userId?: number): Promise\<boolean>
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 **System capability**: SystemCapability.Customization.EnterpriseDeviceManager
...@@ -474,14 +476,14 @@ Checks whether a device administrator application of the specified user (if **us ...@@ -474,14 +476,14 @@ Checks whether a device administrator application of the specified user (if **us
| Name | Type | Mandatory | Description | | 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. |
| 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**.| | userId | number | No | User ID, which must be greater than or equal to 0.<br> - If **userId** is passed in, the application of the specified user is checked.<br> - If **userId** is not passed in, the application of the current user is checked.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ------------------- | | ----------------- | ------------------- |
| Promise\<boolean> | 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\<boolean> | Promise used to return the result. The value **true** means the device administrator application is enabled; the value **false** means the opposite.|
**Example** **Example**
...@@ -502,7 +504,7 @@ adminManager.isAdminEnabled(wantTemp, 100).then((result) => { ...@@ -502,7 +504,7 @@ adminManager.isAdminEnabled(wantTemp, 100).then((result) => {
isSuperAdmin(bundleName: String, callback: AsyncCallback\<boolean>): void isSuperAdmin(bundleName: String, callback: AsyncCallback\<boolean>): 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 **System capability**: SystemCapability.Customization.EnterpriseDeviceManager
...@@ -512,8 +514,8 @@ Checks whether a super device administrator application is enabled based on the ...@@ -512,8 +514,8 @@ Checks whether a super device administrator application is enabled based on the
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ----------------------- | ---- | -------------------- | | ---------- | ----------------------- | ---- | -------------------- |
| bundleName | String | Yes | Device administrator application. | | bundleName | String | Yes | Super administrator application to check. |
| 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** means that the super device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object.| | 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** means that the device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object.|
**Example** **Example**
...@@ -533,7 +535,7 @@ adminManager.isSuperAdmin(bundleName, (err, result) => { ...@@ -533,7 +535,7 @@ adminManager.isSuperAdmin(bundleName, (err, result) => {
isSuperAdmin(bundleName: String): Promise\<boolean> isSuperAdmin(bundleName: String): Promise\<boolean>
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 **System capability**: SystemCapability.Customization.EnterpriseDeviceManager
...@@ -543,13 +545,13 @@ Checks whether a super device administrator application is enabled based on the ...@@ -543,13 +545,13 @@ Checks whether a super device administrator application is enabled based on the
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | --------- | | ---------- | ------ | ---- | --------- |
| bundleName | String | Yes | Super device administrator application.| | bundleName | String | Yes | Super administrator application to check.|
**Return value** **Return value**
| ID | Error Message | | ID | Error Message |
| ----------------- | ------------------- | | ----------------- | ------------------- |
| Promise\<boolean> | 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\<boolean> | Promise used to return the result. The value **true** means the super administrator application is enabled; the value **false** means the opposite. |
**Example** **Example**
...@@ -567,7 +569,7 @@ adminManager.isSuperAdmin(bundleName).then((result) => { ...@@ -567,7 +569,7 @@ adminManager.isSuperAdmin(bundleName).then((result) => {
setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback\<void>;): void setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback\<void>;): 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 **Required permissions**: ohos.permission.SET_ENTERPRISE_INFO
...@@ -580,7 +582,7 @@ Sets the enterprise information of a device administrator application. This API ...@@ -580,7 +582,7 @@ Sets the enterprise information of a device administrator application. This API
| Name | Type | Mandatory | Description | | 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. |
| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information of the device administrator application. | | enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information to set. |
| callback | AsyncCallback\<void>; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| | callback | AsyncCallback\<void>; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.|
**Error codes** **Error codes**
...@@ -616,7 +618,7 @@ adminManager.setEnterpriseInfo(wantTemp, enterpriseInfo, (err) => { ...@@ -616,7 +618,7 @@ adminManager.setEnterpriseInfo(wantTemp, enterpriseInfo, (err) => {
setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise\<void>; setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise\<void>;
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 **Required permissions**: ohos.permission.SET_ENTERPRISE_INFO
...@@ -629,13 +631,13 @@ Sets the enterprise information of a device administrator application. This API ...@@ -629,13 +631,13 @@ Sets the enterprise information of a device administrator application. This API
| Name | Type | Mandatory | Description | | 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. |
| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information of the device administrator application.| | enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information to set.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | --------------------- | | ----------------- | --------------------- |
| Promise\<void> | Promise that returns no value. If the operation fails, an error object is thrown.| | Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.|
**Error codes** **Error codes**
...@@ -724,7 +726,7 @@ Obtains the enterprise information of a device administrator application. This A ...@@ -724,7 +726,7 @@ Obtains the enterprise information of a device administrator application. This A
| Type | Description | | Type | Description |
| ---------------------------------------- | ------------------------- | | ---------------------------------------- | ------------------------- |
| Promise&lt;[EnterpriseInfo](#enterpriseinfo)&gt; | Promise used to return the enterprise information of the specified device administrator application obtained.| | Promise&lt;[EnterpriseInfo](#enterpriseinfo)&gt; | Promise used to return the enterprise information obtained.|
**Error codes** **Error codes**
...@@ -753,7 +755,7 @@ adminManager.getEnterpriseInfo(wantTemp).then((result) => { ...@@ -753,7 +755,7 @@ adminManager.getEnterpriseInfo(wantTemp).then((result) => {
subscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>, callback: AsyncCallback\<void>): void subscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>, callback: AsyncCallback\<void>): 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 **Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT
...@@ -800,7 +802,7 @@ adminManager.subscribeManagedEvent(wantTemp, events, (err) => { ...@@ -800,7 +802,7 @@ adminManager.subscribeManagedEvent(wantTemp, events, (err) => {
subscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>): Promise\<void> subscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>): Promise\<void>
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 **Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT
...@@ -819,7 +821,7 @@ Subscribes to system management events through the specified device administrato ...@@ -819,7 +821,7 @@ Subscribes to system management events through the specified device administrato
| Type | Description | | Type | Description |
| ----- | ----------------------------------- | | ----- | ----------------------------------- |
| Promise\<void> | Promise that returns no value. If the operation fails, an error object is thrown.| | Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.|
**Error codes** **Error codes**
...@@ -849,7 +851,7 @@ adminManager.subscribeManagedEvent(wantTemp, events).then(() => { ...@@ -849,7 +851,7 @@ adminManager.subscribeManagedEvent(wantTemp, events).then(() => {
unsubscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>, callback: AsyncCallback\<void>): void unsubscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>, callback: AsyncCallback\<void>): 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 **Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT
...@@ -896,7 +898,7 @@ adminManager.unsubscribeManagedEvent(wantTemp, events, (err) => { ...@@ -896,7 +898,7 @@ adminManager.unsubscribeManagedEvent(wantTemp, events, (err) => {
unsubscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>): Promise\<void> unsubscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>): Promise\<void>
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 **Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT
...@@ -915,7 +917,7 @@ Unsubscribes from system management events through the specified device administ ...@@ -915,7 +917,7 @@ Unsubscribes from system management events through the specified device administ
| Type | Description | | Type | Description |
| ----- | ----------------------------------- | | ----- | ----------------------------------- |
| Promise\<void> | Promise that returns no value. If the operation fails, an error object is thrown.| | Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.|
**Error codes** **Error codes**
...@@ -943,7 +945,7 @@ adminManager.unsubscribeManagedEvent(wantTemp, events).then(() => { ...@@ -943,7 +945,7 @@ adminManager.unsubscribeManagedEvent(wantTemp, events).then(() => {
## EnterpriseInfo ## EnterpriseInfo
Defines the enterprise information of a device administrator application. Represents the enterprise information of a device administrator application.
**System capability**: SystemCapability.Customization.EnterpriseDeviceManager **System capability**: SystemCapability.Customization.EnterpriseDeviceManager
...@@ -951,12 +953,12 @@ Defines the enterprise information of a device administrator application. ...@@ -951,12 +953,12 @@ Defines the enterprise information of a device administrator application.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | --------| ---- | ------------------------------- | | ----------- | --------| ---- | ------------------------------- |
| name | string | Yes | Name of the enterprise to which the device administrator application belongs.| | name | string | Yes | Name of the enterprise.|
| description | string | Yes | Description of the enterprise to which the device administrator application belongs.| | description | string | Yes | Description of the enterprise.|
## AdminType ## AdminType
Enumerates the administrator types of the device administrator application. Enumerates the types of device administrator applications.
**System capability**: SystemCapability.Customization.EnterpriseDeviceManager **System capability**: SystemCapability.Customization.EnterpriseDeviceManager
...@@ -964,8 +966,8 @@ Enumerates the administrator types of the device administrator application. ...@@ -964,8 +966,8 @@ Enumerates the administrator types of the device administrator application.
| Name | Value | Description | | Name | Value | Description |
| ----------------- | ---- | ----- | | ----------------- | ---- | ----- |
| ADMIN_TYPE_NORMAL | 0x00 | Common administrator.| | ADMIN_TYPE_NORMAL | 0x00 | Common administrator application.|
| ADMIN_TYPE_SUPER | 0x01 | Super administrator.| | ADMIN_TYPE_SUPER | 0x01 | Super administrator application.|
## ManagedEvent ## ManagedEvent
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册