@@ -6,7 +6,9 @@ The **deviceSettings** module provides APIs for setting enterprise devices, incl
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module apply only to the [device administrator applications](enterpriseDeviceManagement-overview.md#basic-concepts). Before calling the APIs, you must enable the device administrator application(js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
> 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) that is [enabled](js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
## Modules to Import
...
...
@@ -18,7 +20,7 @@ import deviceSettings from '@ohos.enterprise.deviceSettings';
Obtains the screen-off time of a device through the specified device administrator application. This API uses an asynchronous callback to return the result.
Obtains the device screen-off time through the specified device administrator application. This API uses an asynchronous callback to return the result.
| certificate | [CertBlob](#certblob) | Yes | Information about the certificate to install. |
| callback | AsyncCallback<string> | 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).
| certUri | string | Yes | Certificate URI, which is returned by **installUserCertificate()**. |
| 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**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
The **usbManager** module provides APIs for USB management.
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs of this module can be 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) that is [enabled](js-apis-enterprise-adminManager.md#adminmanagerenableadmin).
| usbPolicy | [UsbPolicy](#usbpolicy) | Yes| USB read/write policy 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.|
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
@@ -426,7 +426,7 @@ Clears the cloud data locally. This API uses an asynchronous callback to return
| ---------- | ------ | ---- | ---- |
| accountId | string | Yes | Account ID.|
| appActions | object | Yes | Action to take. **bundleName** indicates the application bundle to clear, and [Action](#action) indicates the action to take.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result.|
| callback | AsyncCallback<void> | Yes | Callback invoked to clear the cloud data locally.|
Registers listening for the card reading events of an NFC tag foreground application. You can set the supported tag technologies in **discTech**, and obtain the [TagInfo](#taginfo) read in a callback. <br>This API must be used with [tag.unregisterForegroundDispatch](#tagunregisterforegrounddispatch10) in pairs. The registered event listening must be unregistered before the page exits the foreground or the page is destroyed.
| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | Information about the application page. It must contain at least the **bundleName**, **abilityName**, and **moduleName**. |
| discTech | number[] | Yes | Technologies supported by the foreground dispatch system. Each number indicates the constant value of the supported technology. Based on the value of **number**, the system sets tag technologies ([NFC_A](#technology-type-definition), [NFC_B](#technology-type-definition), and [NFC_F](#technology-type-definition), and [NFC_V](#technology-type-definition)) for NFC card read polling and disable card emulation. If the **number** length is 0, both card read polling and card emulation will be disabled.|
| callback | AsyncCallback<[TagInfo](#taginfo)> | Yes | Callback invoked to return the card read event in the foreground.|
**Example**
See the example of [tag.unregisterForegroundDispatch](#tagunregisterforegrounddispatch10).
Unregisters the listening for card reading events of an NFC tag foreground application. The registered event listening must be unregistered before the page exits the foreground or the page is destroyed.
| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | Information about the application page. It must contain at least the **bundleName**, **abilityName**, and **moduleName**. |
**Example**
```js
importUIAbilityfrom'@ohos.app.ability.UIAbility'
importtagfrom'@ohos.nfc.tag';
letelementName=null;
letdiscTech=[tag.NFC_A,tag.NFC_B];// replace with the tech(s) that is needed by foreground ability
functionforegroundCb(tagInfo:any){
console.log("foreground callback: tag found tagInfo = ",JSON.stringify(tagInfo));