diff --git a/en/application-dev/reference/apis/js-apis-enterprise-device-manager.md b/en/application-dev/reference/apis/js-apis-enterprise-device-manager.md index 869472d43c046a68cd3d50cfe262b424b660dd0d..3db2ea00aa2e0ad4cbc68bbcf4ae945f0ca79745 100644 --- a/en/application-dev/reference/apis/js-apis-enterprise-device-manager.md +++ b/en/application-dev/reference/apis/js-apis-enterprise-device-manager.md @@ -11,11 +11,11 @@ import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager'; ``` -## enterpriseDeviceManager.activateAdmin +## enterpriseDeviceManager.enableAdmin -activateAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback\): void +enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback\): void -Activates a device administrator application based on the specified bundle name and class name. This API uses an asynchronous callback to return the result. +Enables a device administrator application based on the specified bundle name and class name. This API uses an asynchronous callback to return the result. **Required permissions** @@ -27,12 +27,13 @@ SystemCapability.Customation.EnterpriseDeviceManager **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. | - | enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | Yes | Enterprise information of the device administrator application. | - | type | [AdminType](#AdminType) | Yes | Type of the device administrator to activate. | - | callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory | Description | +| -------- | -------- | -------- | -------- | +| admin | [Want](js-apis-application-Want.md) | Yes | 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. | +| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -45,7 +46,7 @@ let enterpriseInfo = { name: "enterprise name", description: "enterprise description" } -enterpriseDeviceManager.activateAdmin(wantTemp, enterpriseInfo, enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL, (error, result) => { +enterpriseDeviceManager.enableAdmin(wantTemp, enterpriseInfo, enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL, 100, (error, result) => { if (error != null) { console.log("error occurs" + error); return; @@ -54,11 +55,11 @@ enterpriseDeviceManager.activateAdmin(wantTemp, enterpriseInfo, enterpriseDevice }); ``` -## enterpriseDeviceManager.activateAdmin +## enterpriseDeviceManager.enableAdmin -activateAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType): Promise\ +enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType): Promise\ -Activates a device administrator application based on the specified bundle name and class name. This API uses a promise to return the result. +Enables a device administrator application based on the specified bundle name and class name. This API uses a promise to return the result. **Required permissions** @@ -70,11 +71,12 @@ SystemCapability.Customation.EnterpriseDeviceManager **Parameters** - | Name | Type | Mandatory | Description | - | -------------- | ---------------------------------------------- | ---- | ------------------------ | - | admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. | - | enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | Yes | Enterprise information of the device administrator application. | - | type | [AdminType](#AdminType) | Yes | Type of the device administrator to activate. | +| Name | Type | Mandatory | Description | +| -------------- | ---------------------------------------------- | ---- | ------------------------ | +| admin | [Want](js-apis-application-Want.md) | Yes | 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. | +| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | **Return value** @@ -93,7 +95,7 @@ let enterpriseInfo = { name: "enterprise name", description: "enterprise description" } -enterpriseDeviceManager.activateAdmin(wantTemp, enterpriseInfo, enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL) +enterpriseDeviceManager.enableAdmin(wantTemp, enterpriseInfo, enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL, 100) .then((result) => { console.log(result); }).catch(error => { @@ -101,11 +103,11 @@ enterpriseDeviceManager.activateAdmin(wantTemp, enterpriseInfo, enterpriseDevice }); ``` -## enterpriseDeviceManager.deactivateAdmin +## enterpriseDeviceManager.disableAdmin -deactivateAdmin(admin: Want, callback: AsyncCallback\): void +disableAdmin(admin: Want, callback: AsyncCallback\): void -Deactivates a device common administrator application based on the specified bundle name and class name. This API uses an asynchronous callback to return the result. +Disables a device common administrator application based on the specified bundle name and class name. This API uses an asynchronous callback to return the result. **Required permissions** @@ -117,10 +119,11 @@ SystemCapability.Customation.EnterpriseDeviceManager **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------------- | ---- | ------------------------------ | - | admin | [Want](js-apis-application-Want.md) | Yes | Device common administrator application. | - | callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------------- | ---- | ------------------------------ | +| admin | [Want](js-apis-application-Want.md) | Yes | Device common administrator application. | +| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -129,7 +132,7 @@ let wantTemp = { bundleName: elementName.bundleName, abilityName: elementName.abilityName, }; -enterpriseDeviceManager.deactivateAdmin(wantTemp, (error, result) => { +enterpriseDeviceManager.disableAdmin(wantTemp, 100, (error, result) => { if (error != null) { console.log("error occurs" + error); return; @@ -140,11 +143,11 @@ enterpriseDeviceManager.deactivateAdmin(wantTemp, (error, result) => { -## enterpriseDeviceManager.deactivateAdmin +## enterpriseDeviceManager.disableAdmin -deactivateAdmin(admin: Want): Promise\ +disableAdmin(admin: Want): Promise\ -Deactivates a device common administrator application based on the specified bundle name and class name. This API uses a promise to return the result. +Disables a device common administrator application based on the specified bundle name and class name. This API uses a promise to return the result. **Required permissions** @@ -156,9 +159,10 @@ SystemCapability.Customation.EnterpriseDeviceManager **Parameters** - | Name | Type | Mandatory | Description | - | ------ | ---------------------------------------------- | ---- | ------------------ | - | admin | [Want](js-apis-application-Want.md) | Yes | Device common administrator application. | +| Name | Type | Mandatory | Description | +| ------ | ---------------------------------------------- | ---- | ------------------ | +| admin | [Want](js-apis-application-Want.md) | Yes | Device common administrator application. | +| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | **Return value** @@ -173,18 +177,18 @@ let wantTemp = { bundleName: "bundleName", abilityName: "abilityName", }; -enterpriseDeviceManager.deactivateAdmin(wantTemp).then((result) => { +enterpriseDeviceManager.disableAdmin(wantTemp, 100).then((result) => { console.log(result); }).catch(error => { console.log("error occurs" + error); }); ``` -## enterpriseDeviceManager.deactivateSuperAdmin +## enterpriseDeviceManager.disableSuperAdmin -deactivateSuperAdmin(bundleName: String, callback: AsyncCallback\): void +disableSuperAdmin(bundleName: String, callback: AsyncCallback\): void -Deactivates a device super administrator application based on the specified bundle name. This API uses an asynchronous callback to return the result. +Disables a device super administrator application based on the specified bundle name. This API uses an asynchronous callback to return the result. **System capability** @@ -201,7 +205,7 @@ SystemCapability.Customation.EnterpriseDeviceManager ``` let bundleName = "com.example.myapplication"; -enterpriseDeviceManager.deactivateSuperAdmin(bundleName, (error, result) => { +enterpriseDeviceManager.disableSuperAdmin(bundleName, (error, result) => { if (error != null) { console.log("error occurs" + error); return; @@ -210,11 +214,11 @@ enterpriseDeviceManager.deactivateSuperAdmin(bundleName, (error, result) => { }); ``` -## enterpriseDeviceManager.deactivateSuperAdmin +## enterpriseDeviceManager.disableSuperAdmin -deactivateSuperAdmin(bundleName: String): Promise\ +disableSuperAdmin(bundleName: String): Promise\ -Deactivates a device super administrator application based on the specified bundle name. This API uses a promise to return the result. +Disables a device super administrator application based on the specified bundle name. This API uses a promise to return the result. **System capability** @@ -236,18 +240,18 @@ SystemCapability.Customation.EnterpriseDeviceManager ``` let bundleName = "com.example.myapplication"; -enterpriseDeviceManager.deactivateSuperAdmin(bundleName).then((result) => { +enterpriseDeviceManager.disableSuperAdmin(bundleName).then((result) => { console.log(result); }).catch(error => { console.log("error occurs" + error); }); ``` -## enterpriseDeviceManager.isAdminAppActive +## enterpriseDeviceManager.isAdminEnabled -isAdminAppActive(admin: Want, callback: AsyncCallback\): void +isAdminEnabled(admin: Want, callback: AsyncCallback\): void -Checks whether a device administrator application is activated based on the specified bundle name and class name. This API uses an asynchronous callback to return the result. +Checks whether a device administrator application is enabled based on the specified bundle name and class name. This API uses an asynchronous callback to return the result. **System capability** @@ -255,10 +259,11 @@ SystemCapability.Customation.EnterpriseDeviceManager **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------------- | ---- | -------------------------------- | - | admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. | - | callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------------- | ---- | -------------------------------- | +| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. | +| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -267,7 +272,7 @@ let wantTemp = { bundleName: elementName.bundleName, abilityName: elementName.abilityName, }; -enterpriseDeviceManager.isAdminAppActive(wantTemp, (error, result) => { +enterpriseDeviceManager.isAdminEnabled(wantTemp, 100, (error, result) => { if (error != null) { console.log("error occurs" + error); return; @@ -278,11 +283,11 @@ enterpriseDeviceManager.isAdminAppActive(wantTemp, (error, result) => { -## enterpriseDeviceManager.isAdminAppActive +## enterpriseDeviceManager.isAdminEnabled -isAdminAppActive(admin: Want): Promise\ +isAdminEnabled(admin: Want): Promise\ -Checks whether a device administrator application is activated based on the specified bundle name and class name. This API uses a promise to return the result. +Checks whether a device administrator application is enabled based on the specified bundle name and class name. This API uses a promise to return the result. **System capability** @@ -290,9 +295,10 @@ SystemCapability.Customation.EnterpriseDeviceManager **Parameters** - | Name | Type | Mandatory | Description | - | ------ | ---------------------------------------------- | ---- | -------------- | - | admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. | +| Name | Type | Mandatory | Description | +| ------ | ---------------------------------------------- | ---- | -------------- | +| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. | +| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | **Return value** @@ -307,7 +313,7 @@ let wantTemp = { bundleName: "bundleName", abilityName: "abilityName", }; -enterpriseDeviceManager.isAdminAppActive(wantTemp).then((result) => { +enterpriseDeviceManager.isAdminEnabled(wantTemp, 100).then((result) => { console.log(result); }).catch(error => { console.log("error occurs" + error); @@ -318,7 +324,7 @@ enterpriseDeviceManager.isAdminAppActive(wantTemp).then((result) => { isSuperAdmin(bundleName: String, callback: AsyncCallback\): void -Checks whether a device super administrator application is activated based on the specified bundle name. This API uses an asynchronous callback to return the result. +Checks whether a device super administrator application is enabled based on the specified bundle name. This API uses an asynchronous callback to return the result. **System capability** @@ -350,7 +356,7 @@ enterpriseDeviceManager.isSuperAdmin(bundleName, (error, result) => { isSuperAdmin(bundleName: String): Promise\ -Checks whether a device super administrator application is activated based on the specified bundle name. This API uses a promise to return the result. +Checks whether a device super administrator application is enabled based on the specified bundle name. This API uses a promise to return the result. **System capability** diff --git a/zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md b/zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md index 0099c245026ecdffe0d2bdae8a4015413c6163a1..e0a5a5825dbdb495def0df8f84aeae182fa3466d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md @@ -12,9 +12,9 @@ import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager'; ``` -## enterpriseDeviceManager.activateAdmin +## enterpriseDeviceManager.enableAdmin -activateAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback\): void +enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback\): void 以异步方法根据给定的包名和类名激活设备管理员应用,使用Callback形式返回是否激活成功。 @@ -26,12 +26,13 @@ SystemCapability.Customation.EnterpriseDeviceManager **参数**: -| 参数名 | 类型 | 必填 | 说明 | -| -------------- | ----------------------------------- | ---- | ------------------ | -| admin | [Want](js-apis-application-Want.md) | 是 | 设备管理员应用 | -| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | 是 | 设备管理员应用的企业信息 | -| type | [AdminType](#AdminType) | 是 | 激活的设备管理员类型 | -| callback | AsyncCallback\ | 是 | callback方式返回是否激活成功 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ----------------------------------- | ---- | ----------------------------------------------------- | +| admin | [Want](js-apis-application-Want.md) | 是 | 设备管理员应用 | +| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | 是 | 设备管理员应用的企业信息 | +| type | [AdminType](#AdminType) | 是 | 激活的设备管理员类型 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| callback | AsyncCallback\ | 是 | callback方式返回是否激活成功 | **示例**: @@ -44,7 +45,7 @@ let enterpriseInfo = { name: "enterprise name", description: "enterprise description" } -enterpriseDeviceManager.activateAdmin(wantTemp, enterpriseInfo, enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL, (error, result) => { +enterpriseDeviceManager.enableAdmin(wantTemp, enterpriseInfo, enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL, 100, (error, result) => { if (error != null) { console.log("error occurs" + error); return; @@ -53,9 +54,9 @@ enterpriseDeviceManager.activateAdmin(wantTemp, enterpriseInfo, enterpriseDevice }); ``` -## enterpriseDeviceManager.activateAdmin +## enterpriseDeviceManager.enableAdmin -activateAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType): Promise\ +enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType): Promise\ 以异步方法根据给定的包名和类名激活设备管理员应用,使用Promise形式返回是否激活成功。 @@ -67,11 +68,12 @@ SystemCapability.Customation.EnterpriseDeviceManager **参数**: -| 参数名 | 类型 | 必填 | 说明 | -| -------------- | ----------------------------------- | ---- | ------------ | -| admin | [Want](js-apis-application-Want.md) | 是 | 设备管理员应用 | -| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | 是 | 设备管理员应用的企业信息 | -| type | [AdminType](#AdminType) | 是 | 激活的设备管理员类型 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ----------------------------------- | ---- | ----------------------------------------------------- | +| admin | [Want](js-apis-application-Want.md) | 是 | 设备管理员应用 | +| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | 是 | 设备管理员应用的企业信息 | +| type | [AdminType](#AdminType) | 是 | 激活的设备管理员类型 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | **返回值:** @@ -90,7 +92,7 @@ let enterpriseInfo = { name: "enterprise name", description: "enterprise description" } -enterpriseDeviceManager.activateAdmin(wantTemp, enterpriseInfo, enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL) +enterpriseDeviceManager.enableAdmin(wantTemp, enterpriseInfo, enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL, 100) .then((result) => { console.log("result is " + result); }).catch(error => { @@ -98,9 +100,9 @@ enterpriseDeviceManager.activateAdmin(wantTemp, enterpriseInfo, enterpriseDevice }); ``` -## enterpriseDeviceManager.deactivateAdmin +## enterpriseDeviceManager.disableAdmin -deactivateAdmin(admin: Want, callback: AsyncCallback\): void +disableAdmin(admin: Want, callback: AsyncCallback\): void 以异步方法根据给定的包名和类名将设备普通管理员应用去激活,使用Callback形式返回是否去激活成功。 @@ -112,10 +114,11 @@ SystemCapability.Customation.EnterpriseDeviceManager **参数**: -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ----------------------------------- | ---- | ------------------- | -| admin | [Want](js-apis-application-Want.md) | 是 | 普通设备管理员应用 | -| callback | AsyncCallback\ | 是 | callback方式返回是否去激活成功 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------- | ---- | ----------------------------------------------------- | +| admin | [Want](js-apis-application-Want.md) | 是 | 普通设备管理员应用 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| callback | AsyncCallback\ | 是 | callback方式返回是否去激活成功 | **示例**: @@ -124,7 +127,7 @@ let wantTemp = { bundleName: "bundleName", abilityName: "abilityName", }; -enterpriseDeviceManager.deactivateAdmin(wantTemp, (error, result) => { +enterpriseDeviceManager.disableAdmin(wantTemp, 100, (error, result) => { if (error != null) { console.log("error occurs" + error); return; @@ -135,9 +138,9 @@ enterpriseDeviceManager.deactivateAdmin(wantTemp, (error, result) => { -## enterpriseDeviceManager.deactivateAdmin +## enterpriseDeviceManager.disableAdmin -deactivateAdmin(admin: Want): Promise\ +disableAdmin(admin: Want): Promise\ 以异步方法根据给定的包名和类名将设备普通管理员应用去激活,使用Promise形式返回是否去激活成功。 @@ -149,9 +152,10 @@ SystemCapability.Customation.EnterpriseDeviceManager **参数**: -| 参数名 | 类型 | 必填 | 说明 | -| ----- | ----------------------------------- | ---- | --------- | -| admin | [Want](js-apis-application-Want.md) | 是 | 普通设备管理员应用 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ----------------------------------- | ---- | ----------------------------------------------------- | +| admin | [Want](js-apis-application-Want.md) | 是 | 普通设备管理员应用 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | **返回值:** @@ -166,16 +170,16 @@ let wantTemp = { bundleName: "bundleName", abilityName: "abilityName", }; -enterpriseDeviceManager.deactivateAdmin(wantTemp).then((result) => { +enterpriseDeviceManager.disableAdmin(wantTemp, 100).then((result) => { console.log("result is " + result); }).catch(error => { console.log("error occurs" + error); }); ``` -## enterpriseDeviceManager.deactivateSuperAdmin +## enterpriseDeviceManager.disableSuperAdmin -deactivateSuperAdmin(bundleName: String, callback: AsyncCallback\): void +disableSuperAdmin(bundleName: String, callback: AsyncCallback\): void 以异步方法根据给定的包名将设备超级管理员应用去激活,使用Callback形式返回是否去激活成功。 @@ -193,7 +197,7 @@ SystemCapability.Customation.EnterpriseDeviceManager ```js let bundleName = "com.example.myapplication"; -enterpriseDeviceManager.deactivateSuperAdmin(bundleName, (error, result) => { +enterpriseDeviceManager.disableSuperAdmin(bundleName, (error, result) => { if (error != null) { console.log("error occurs" + error); return; @@ -202,9 +206,9 @@ enterpriseDeviceManager.deactivateSuperAdmin(bundleName, (error, result) => { }); ``` -## enterpriseDeviceManager.deactivateSuperAdmin +## enterpriseDeviceManager.disableSuperAdmin -deactivateSuperAdmin(bundleName: String): Promise\ +disableSuperAdmin(bundleName: String): Promise\ 以异步方法根据给定的包名将设备超级管理员应用去激活,使用Promise形式返回是否去激活成功。 @@ -227,16 +231,16 @@ SystemCapability.Customation.EnterpriseDeviceManager ```js let bundleName = "com.example.myapplication"; -enterpriseDeviceManager.deactivateSuperAdmin(bundleName).then((result) => { +enterpriseDeviceManager.disableSuperAdmin(bundleName).then((result) => { console.log("result is " + result); }).catch(error => { console.log("error occurs" + error); }); ``` -## enterpriseDeviceManager.isAdminAppActive +## enterpriseDeviceManager.isAdminEnabled -isAdminAppActive(admin: Want, callback: AsyncCallback\): void +isAdminEnabled(admin: Want, callback: AsyncCallback\): void 以异步方法根据给定的包名和类名判断设备管理员应用是否被激活,使用Callback形式返回是否处于激活状态。 @@ -245,10 +249,11 @@ SystemCapability.Customation.EnterpriseDeviceManager **参数**: -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ----------------------------------- | ---- | -------------------- | -| admin | [Want](js-apis-application-Want.md) | 是 | 设备管理员应用 | -| callback | AsyncCallback\ | 是 | callback方式返回是否处于激活状态 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------- | ---- | ----------------------------------------------------- | +| admin | [Want](js-apis-application-Want.md) | 是 | 设备管理员应用 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| callback | AsyncCallback\ | 是 | callback方式返回是否处于激活状态 | **示例**: @@ -257,7 +262,7 @@ let wantTemp = { bundleName: "bundleName", abilityName: "abilityName", }; -enterpriseDeviceManager.isAdminAppActive(wantTemp, (error, result) => { +enterpriseDeviceManager.isAdminEnabled(wantTemp, 100, (error, result) => { if (error != null) { console.log("error occurs" + error); return; @@ -268,9 +273,9 @@ enterpriseDeviceManager.isAdminAppActive(wantTemp, (error, result) => { -## enterpriseDeviceManager.isAdminAppActive +## enterpriseDeviceManager.isAdminEnabled -isAdminAppActive(admin: Want): Promise\ +isAdminEnabled(admin: Want): Promise\ 以异步方法根据给定的包名和类名判断设备管理员应用是否被激活,使用Promise形式返回是否处于激活状态。 @@ -279,9 +284,10 @@ SystemCapability.Customation.EnterpriseDeviceManager **参数**: -| 参数名 | 类型 | 必填 | 说明 | -| ----- | ----------------------------------- | ---- | ------- | -| admin | [Want](js-apis-application-Want.md) | 是 | 设备管理员应用 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ----------------------------------- | ---- | ----------------------------------------------------- | +| admin | [Want](js-apis-application-Want.md) | 是 | 设备管理员应用 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | **返回值:** @@ -296,7 +302,7 @@ let wantTemp = { bundleName: "bundleName", abilityName: "abilityName", }; -enterpriseDeviceManager.isAdminAppActive(wantTemp).then((result) => { +enterpriseDeviceManager.isAdminEnabled(wantTemp, 100).then((result) => { console.log("result is " + result); }).catch(error => { console.log("error occurs" + error);