未验证 提交 b381fd93 编写于 作者: O openharmony_ci 提交者: Gitee

!13727 翻译完成:除元能力+语言基础库+bundle外的全量API更新

Merge pull request !13727 from wusongqing/E0117V2
...@@ -56,20 +56,20 @@ Users often need to share data (such as a text or an image) from one application ...@@ -56,20 +56,20 @@ Users often need to share data (such as a text or an image) from one application
} }
} }
} }
``` ```
In the preceding code, the custom field **parameters** is used. The **ability.picker.\*** fields in the first-layer **parameters** are used to pass the information to be displayed on the application selector. The following fields are involved: In the preceding code, the custom field **parameters** is used. The **ability.picker.\*** fields in the first-layer **parameters** are used to pass the information to be displayed on the application selector. The following fields are involved:
- **"ability.picker.type"**: The application selector renders the file type icon based on this field. - **"ability.picker.type"**: The application selector renders the file type icon based on this field.
- **"ability.picker.fileNames"**: The application selector displays the file name based on this field. - **"ability.picker.fileNames"**: The application selector displays the file name based on this field.
- **"ability.picker.fileSizes"**: The application selector displays the file size based on this field. The unit is byte. - **"ability.picker.fileSizes"**: The application selector displays the file size based on this field. The unit is byte.
- **"ability.picker.fileNames"** and **"ability.picker.fileSizes"** are arrays and have a one-to-one mapping. - **"ability.picker.fileNames"** and **"ability.picker.fileSizes"** are arrays and have a one-to-one mapping.
For example, when **"ability.picker.type"** is **"application/pdf"**, **"ability.picker.fileNames"** is **"["APIs.pdf"]"**, and **"ability.picker.fileSizes"** is **"[350 \* 1024]"**, the application selector is displayed as follows: For example, when **"ability.picker.type"** is **"application/pdf"**, **"ability.picker.fileNames"** is **"["APIs.pdf"]"**, and **"ability.picker.fileSizes"** is **"[350 \* 1024]"**, the application selector is displayed as follows:
<img src="figures/stage-want2.png" alt="stage-want2" style="zoom:50%;" /> <img src="figures/stage-want2.png" alt="stage-want2" style="zoom:50%;" />
In the preceding code, the **ability.want.params.INTENT** field is nested Want. In this field, **action** and **type** are used for implicit matching by the application selector. For details about implicit matching, see [Implicit Want Matching Rules](explicit-implicit-want-mappings.md#interpretation-of-implicit-want-matching-rules). After the user selects an application, the nested Want of the **ability.want.params.INTENT** field is passed to that application. In the preceding code, the **ability.want.params.INTENT** field is nested Want. In this field, **action** and **type** are used for implicit matching by the application selector. For details about implicit matching, see [Matching Rules of Implicit Want](explicit-implicit-want-mappings.md#matching-rules-of-implicit-want). After the user selects an application, the nested Want of the **ability.want.params.INTENT** field is passed to that application.
- Shared party - Shared party
1. As mentioned above, the application selector performs implicit matching based on the **ability.want.params.INTENT** field. Therefore, you must set **skills** in the ability configuration file (**module.json5** file in the stage model) of the shared party as follows: 1. As mentioned above, the application selector performs implicit matching based on the **ability.want.params.INTENT** field. Therefore, you must set **skills** in the ability configuration file (**module.json5** file in the stage model) of the shared party as follows:
......
...@@ -33,4 +33,4 @@ To enable an ability to be called by any application, configure the **config.jso ...@@ -33,4 +33,4 @@ To enable an ability to be called by any application, configure the **config.jso
``` ```
If the ability contains **skills**, you are advised to set **visible** to **true** so that the ability can be [implicitly started](explicit-implicit-want-mappings.md#interpretation-of-implicit-want-matching-rules) by other applications. If this attribute is set to **false**, the system returns **PERMISSION_DENIED** when other applications attempt to start the ability. In this case, a system application can request the [START_INVISIBLE_ABILITY](../security/permission-list.md) permission to start the ability. Example abilities with **visible** set to **false** are home screen, voice assistant, or search assistant. If the ability contains **skills**, you are advised to set **visible** to **true** so that the ability can be [implicitly started](explicit-implicit-want-mappings.md#matching-rules-of-implicit-want) by other applications. If this attribute is set to **false**, the system returns **PERMISSION_DENIED** when other applications attempt to start the ability. In this case, a system application can request the [START_INVISIBLE_ABILITY](../security/permission-list.md) permission to start the ability. Example abilities with **visible** set to **false** are home screen, voice assistant, or search assistant.
# @ohos.enterprise.EnterpriseAdminExtensionAbility # @ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)
The **EnterpriseAdminExtensionAbility** module provides Extension abilities for enterprise administrators. The **EnterpriseAdminExtensionAbility** module provides Extension abilities for enterprise administrators.
......
# Work Scheduler Callbacks # @ohos.WorkSchedulerExtensionAbility (Work Scheduler Callbacks)
The **WorkSchedulerExtensionAbility** module provides callbacks for Work Scheduler tasks. The **WorkSchedulerExtensionAbility** module provides callbacks for Work Scheduler tasks.
......
...@@ -22,8 +22,8 @@ import Want from '@ohos.app.ability.Want'; ...@@ -22,8 +22,8 @@ import Want from '@ohos.app.ability.Want';
| bundleName | string | No | Bundle name of the ability.| | bundleName | string | No | Bundle name of the ability.|
| moduleName | string | No| Name of the module to which the ability belongs.| | moduleName | string | No| Name of the module to which the ability belongs.|
| abilityName | string | No | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can match a specific ability. The value of **abilityName** must be unique in an application.| | abilityName | string | No | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can match a specific ability. The value of **abilityName** must be unique in an application.|
| [action](js-apis-app-ability-wantConstant.md#wantConstant.Action) | string | No | Action to take, such as viewing and sharing application details. In implicit Want, you can define this field and use it together with **uri** or **parameters** to specify the operation to be performed on the data. For details about the definition and matching rules of implicit Want, see [Matching Rules of Explicit Want and Implicit Want](application-models/explicit-implicit-want-mappings.md). | | [action](js-apis-app-ability-wantConstant.md#wantconstantaction) | string | No | Action to take, such as viewing and sharing application details. In implicit Want, you can define this field and use it together with **uri** or **parameters** to specify the operation to be performed on the data. For details about the definition and matching rules of implicit Want, see [Matching Rules of Explicit Want and Implicit Want](../../application-models/explicit-implicit-want-mappings.md). |
| [entities](js-apis-app-ability-wantConstant.md#wantConstant.Entity) | Array\<string> | No| Additional category information (such as browser and video player) of the ability. It is a supplement to the **action** field for implicit Want. and is used to filter ability types.| | [entities](js-apis-app-ability-wantConstant.md#wantconstantentity) | Array\<string> | No| Additional category information (such as browser and video player) of the ability. It is a supplement to the **action** field for implicit Want. and is used to filter ability types.|
| uri | string | No| Data carried. This field is used together with **type** to specify the data type. If **uri** is specified in a Want, the Want will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.| | uri | string | No| Data carried. This field is used together with **type** to specify the data type. If **uri** is specified in a Want, the Want will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.|
| type | string | No| MIME type, that is, the type of the file to open, for example, **text/xml** and **image/***. For details about the MIME type definition, see https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com.| | type | string | No| MIME type, that is, the type of the file to open, for example, **text/xml** and **image/***. For details about the MIME type definition, see https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com.|
| parameters | {[key: string]: any} | No | Want parameters in the form of custom key-value (KV) pairs. By default, the following keys are carried:<br>- **ohos.aafwk.callerPid**: PID of the caller.<br>- **ohos.aafwk.param.callerToken**: token of the caller.<br>- **ohos.aafwk.param.callerUid**: UID in [BundleInfo](js-apis-bundleManager-bundleInfo.md#bundleinfo-1), that is, the application UID in the bundle information. | | parameters | {[key: string]: any} | No | Want parameters in the form of custom key-value (KV) pairs. By default, the following keys are carried:<br>- **ohos.aafwk.callerPid**: PID of the caller.<br>- **ohos.aafwk.param.callerToken**: token of the caller.<br>- **ohos.aafwk.param.callerUid**: UID in [BundleInfo](js-apis-bundleManager-bundleInfo.md#bundleinfo-1), that is, the application UID in the bundle information. |
...@@ -133,4 +133,4 @@ import Want from '@ohos.app.ability.Want'; ...@@ -133,4 +133,4 @@ import Want from '@ohos.app.ability.Want';
- For more details and examples, see [Want](../../application-models/want-overview.md). - For more details and examples, see [Want](../../application-models/want-overview.md).
<!--no_check-->
...@@ -159,12 +159,12 @@ Requests a continuous task from the system. This API uses an asynchronous callba ...@@ -159,12 +159,12 @@ Requests a continuous task from the system. This API uses an asynchronous callba
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| --------- | ---------------------------------- | ---- | ---------------------------------------- | | --------- | --------------------------------------------- | ---- | ------------------------------------------------------------ |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md).| | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md).|
| bgMode | [BackgroundMode](#backgroundmode8) | Yes | Background mode requested. | | bgMode | [BackgroundMode](#backgroundmode8) | Yes | Background mode requested. |
| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked. | | wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -187,7 +187,7 @@ let wantAgentInfo = { ...@@ -187,7 +187,7 @@ let wantAgentInfo = {
wants: [ wants: [
{ {
bundleName: "com.example.myapplication", bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility" abilityName: "EntryAbility"
} }
], ],
operationType: wantAgent.OperationType.START_ABILITY, operationType: wantAgent.OperationType.START_ABILITY,
...@@ -205,7 +205,7 @@ wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => { ...@@ -205,7 +205,7 @@ wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => {
Stage model: Stage model:
```ts ```ts
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager'; import backgroundTaskManager from '@ohos.backgroundTaskManager';
import wantAgent from '@ohos.wantAgent'; import wantAgent from '@ohos.wantAgent';
...@@ -217,13 +217,13 @@ function callback(err, data) { ...@@ -217,13 +217,13 @@ function callback(err, data) {
} }
} }
export default class MainAbility extends Ability { export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
let wantAgentInfo = { let wantAgentInfo = {
wants: [ wants: [
{ {
bundleName: "com.example.myapplication", bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility" abilityName: "EntryAbility"
} }
], ],
operationType: wantAgent.OperationType.START_ABILITY, operationType: wantAgent.OperationType.START_ABILITY,
...@@ -251,11 +251,11 @@ Requests a continuous task from the system. This API uses a promise to return th ...@@ -251,11 +251,11 @@ Requests a continuous task from the system. This API uses a promise to return th
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| --------- | ---------------------------------- | ---- | ---------------------------------------- | | --------- | --------------------------------------------- | ---- | ------------------------------------------------------------ |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md).| | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md).|
| bgMode | [BackgroundMode](#backgroundmode8) | Yes | Background mode requested. | | bgMode | [BackgroundMode](#backgroundmode8) | Yes | Background mode requested. |
| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked. | | wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked. |
**Return value** **Return value**
...@@ -276,7 +276,7 @@ let wantAgentInfo = { ...@@ -276,7 +276,7 @@ let wantAgentInfo = {
wants: [ wants: [
{ {
bundleName: "com.example.myapplication", bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility" abilityName: "EntryAbility"
} }
], ],
operationType: wantAgent.OperationType.START_ABILITY, operationType: wantAgent.OperationType.START_ABILITY,
...@@ -297,17 +297,17 @@ wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => { ...@@ -297,17 +297,17 @@ wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => {
Stage model: Stage model:
```ts ```ts
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager'; import backgroundTaskManager from '@ohos.backgroundTaskManager';
import wantAgent from '@ohos.wantAgent'; import wantAgent from '@ohos.wantAgent';
export default class MainAbility extends Ability { export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
let wantAgentInfo = { let wantAgentInfo = {
wants: [ wants: [
{ {
bundleName: "com.example.myapplication", bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility" abilityName: "EntryAbility"
} }
], ],
operationType: wantAgent.OperationType.START_ABILITY, operationType: wantAgent.OperationType.START_ABILITY,
...@@ -365,7 +365,7 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext(), callbac ...@@ -365,7 +365,7 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext(), callbac
Stage model: Stage model:
```ts ```ts
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager'; import backgroundTaskManager from '@ohos.backgroundTaskManager';
function callback(err, data) { function callback(err, data) {
...@@ -376,7 +376,7 @@ function callback(err, data) { ...@@ -376,7 +376,7 @@ function callback(err, data) {
} }
} }
export default class MainAbility extends Ability { export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
backgroundTaskManager.stopBackgroundRunning(this.context, callback); backgroundTaskManager.stopBackgroundRunning(this.context, callback);
} }
...@@ -422,10 +422,10 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext()).then(() ...@@ -422,10 +422,10 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext()).then(()
Stage model: Stage model:
```ts ```ts
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager'; import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default class MainAbility extends Ability { export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
backgroundTaskManager.stopBackgroundRunning(this.context).then(() => { backgroundTaskManager.stopBackgroundRunning(this.context).then(() => {
console.info("Operation stopBackgroundRunning succeeded"); console.info("Operation stopBackgroundRunning succeeded");
......
# Color Space Management # @ohos.graphics.colorSpaceManager (Color Space Management)
The **colorSpaceManager** module provides APIs for creating and managing color space objects and obtaining basic color space attributes. The **colorSpaceManager** module provides APIs for creating and managing color space objects and obtaining basic color space attributes.
......
...@@ -297,9 +297,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -297,9 +297,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
```ts ```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, { defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, {
bundleName: "com.test.app", bundleName: "com.example.myapplication",
moduleName: "module01", moduleName: "module01",
abilityName: "MainAbility" abilityName: "EntryAbility"
}).then((data) => { }).then((data) => {
console.info('Operation successful.'); console.info('Operation successful.');
}).catch((error) => { }).catch((error) => {
...@@ -308,9 +308,9 @@ defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, { ...@@ -308,9 +308,9 @@ defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, {
let userId = 100; let userId = 100;
defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, { defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, {
bundleName: "com.test.app", bundleName: "com.example.myapplication",
moduleName: "module01", moduleName: "module01",
abilityName: "MainAbility" abilityName: "EntryAbility"
}, userId).then((data) => { }, userId).then((data) => {
console.info('Operation successful.'); console.info('Operation successful.');
}).catch((error) => { }).catch((error) => {
...@@ -318,9 +318,9 @@ defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, { ...@@ -318,9 +318,9 @@ defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, {
}); });
defaultAppMgr.setDefaultApplication("image/png", { defaultAppMgr.setDefaultApplication("image/png", {
bundleName: "com.test.app", bundleName: "com.example.myapplication",
moduleName: "module01", moduleName: "module01",
abilityName: "MainAbility" abilityName: "EntryAbility"
}, userId).then((data) => { }, userId).then((data) => {
console.info('Operation successful.'); console.info('Operation successful.');
}).catch((error) => { }).catch((error) => {
...@@ -365,9 +365,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -365,9 +365,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
let userId = 100; let userId = 100;
defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, { defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, {
bundleName: "com.test.app", bundleName: "com.example.myapplication",
moduleName: "module01", moduleName: "module01",
abilityName: "MainAbility" abilityName: "EntryAbility"
}, userId, (err, data) => { }, userId, (err, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
...@@ -377,9 +377,9 @@ defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, { ...@@ -377,9 +377,9 @@ defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, {
}); });
defaultAppMgr.setDefaultApplication("image/png", { defaultAppMgr.setDefaultApplication("image/png", {
bundleName: "com.test.app", bundleName: "com.example.myapplication",
moduleName: "module01", moduleName: "module01",
abilityName: "MainAbility" abilityName: "EntryAbility"
}, userId, (err, data) => { }, userId, (err, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
...@@ -424,9 +424,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -424,9 +424,9 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
```ts ```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, { defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, {
bundleName: "com.test.app", bundleName: "com.example.myapplication",
moduleName: "module01", moduleName: "module01",
abilityName: "MainAbility" abilityName: "EntryAbility"
}, (err, data) => { }, (err, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
...@@ -436,9 +436,9 @@ defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, { ...@@ -436,9 +436,9 @@ defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, {
}); });
defaultAppMgr.setDefaultApplication("image/png", { defaultAppMgr.setDefaultApplication("image/png", {
bundleName: "com.test.app", bundleName: "com.example.myapplication",
moduleName: "module01", moduleName: "module01",
abilityName: "MainAbility" abilityName: "EntryAbility"
}, (err, data) => { }, (err, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
......
# @ohos.display # @ohos.display (Display)
The **Display** module provides APIs for managing displays, such as obtaining information about the default display, obtaining information about all displays, and listening for the addition and removal of displays. The **Display** module provides APIs for managing displays, such as obtaining information about the default display, obtaining information about all displays, and listening for the addition and removal of displays.
...@@ -189,7 +189,7 @@ Checks whether there is a visible privacy window on a display. The privacy windo ...@@ -189,7 +189,7 @@ Checks whether there is a visible privacy window on a display. The privacy windo
| Type | Description | | Type | Description |
| -------------------------------- |-----------------------------------------------------------------------| | -------------------------------- |-----------------------------------------------------------------------|
|boolean | Whether there is a visible privacy window on the display. The value **true** means that there is a visible privacy window on the display, and **false** means the opposite. | |boolean | Whether there is a visible privacy window on the display. The value **true** means that there is a visible privacy window on the display, and **false** means the opposite.|
**Error codes** **Error codes**
......
# Image Effect # @ohos.effectKit (Image Effects)
The **EffectKit** module provides basic image processing capabilities, including brightness adjustment, blurring, grayscale adjustment, and color picker. The **EffectKit** module provides basic image processing capabilities, including brightness adjustment, blurring, grayscale adjustment, and color picker.
......
# @ohos.faultLogger (Fault Logger) # @ohos.faultLogger (FaultLogger)
The **faultLogger** module implements fault logging functions. > **NOTE**
>
> **NOTE**<br/>
> The initial APIs of this module are supported since API version 8. 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 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
......
# @ohos.bundle.freeInstall # @ohos.bundle.freeInstall (freeInstall)
The **Bundle.freeInstall** module provides APIs for setting and obtaining installation-free information and APIs for obtaining **BundlePackInfo** and **DispatchInfo**. The **Bundle.freeInstall** module provides APIs for setting and obtaining installation-free information and APIs for obtaining **BundlePackInfo** and **DispatchInfo**.
...@@ -63,7 +63,7 @@ Sets an upgrade flag for a module. This API uses an asynchronous callback to ret ...@@ -63,7 +63,7 @@ Sets an upgrade flag for a module. This API uses an asynchronous callback to ret
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ---------------------------- | | ----------- | --------------------------- | ---- | ---------------------------- |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name. |
| moduleName | string | Yes | Module name. | | moduleName | string | Yes | Module name. |
| upgradeFlag | [UpgradeFlag](#upgradeflag) | Yes | Upgrade flag, which is for internal use only. | | upgradeFlag | [UpgradeFlag](#upgradeflag) | Yes | Upgrade flag, which is for internal use only. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **null**; otherwise, **err** is an error object.| | callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **null**; otherwise, **err** is an error object.|
...@@ -113,7 +113,7 @@ Sets an upgrade flag for a module. This API uses a promise to return the result. ...@@ -113,7 +113,7 @@ Sets an upgrade flag for a module. This API uses a promise to return the result.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ---------------------- | | ----------- | --------------------------- | ---- | ---------------------- |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name.|
| moduleName | string | Yes | Module name. | | moduleName | string | Yes | Module name. |
| upgradeFlag | [UpgradeFlag](#upgradeflag) | Yes | Upgrade flag, which is for internal use only.| | upgradeFlag | [UpgradeFlag](#upgradeflag) | Yes | Upgrade flag, which is for internal use only.|
...@@ -166,7 +166,7 @@ Checks whether a module can be removed. This API uses an asynchronous callback t ...@@ -166,7 +166,7 @@ Checks whether a module can be removed. This API uses an asynchronous callback t
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ---------------------- | ---- | --------------------------------------------- | | ---------- | ---------------------- | ---- | --------------------------------------------- |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name. |
| moduleName | string | Yes | Module name. | | moduleName | string | Yes | Module name. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the module can be removed, **true** is returned; otherwise, **false** is returned.| | callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the module can be removed, **true** is returned; otherwise, **false** is returned.|
...@@ -266,7 +266,7 @@ Obtains **bundlePackInfo** based on **bundleName** and **bundlePackFlag**. This ...@@ -266,7 +266,7 @@ Obtains **bundlePackInfo** based on **bundleName** and **bundlePackFlag**. This
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name. |
| bundlePackFlag | [BundlePackFlag](#bundlepackflag) | Yes | Flag of the bundle package. | | bundlePackFlag | [BundlePackFlag](#bundlepackflag) | Yes | Flag of the bundle package. |
| callback | AsyncCallback<[BundlePackInfo](js-apis-bundleManager-packInfo.md)> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the **BundlePackInfo** object obtained; otherwise, **err** is an error object.| | callback | AsyncCallback<[BundlePackInfo](js-apis-bundleManager-packInfo.md)> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the **BundlePackInfo** object obtained; otherwise, **err** is an error object.|
**Error codes** **Error codes**
...@@ -311,7 +311,7 @@ Obtains **bundlePackInfo** based on **bundleName** and **bundleFlag**. This API ...@@ -311,7 +311,7 @@ Obtains **bundlePackInfo** based on **bundleName** and **bundleFlag**. This API
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------------- | --------------------------------- | ---- | ---------------------- | | -------------- | --------------------------------- | ---- | ---------------------- |
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name.|
| bundlePackFlag | [BundlePackFlag](#bundlepackflag) | Yes | Flag of the bundle package.| | bundlePackFlag | [BundlePackFlag](#bundlepackflag) | Yes | Flag of the bundle package.|
**Return value** **Return value**
......
...@@ -15,10 +15,10 @@ Want is a carrier for information transfer between objects (application componen ...@@ -15,10 +15,10 @@ Want is a carrier for information transfer between objects (application componen
| abilityName | string | No | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can match a specific ability. The value of **abilityName** must be unique in an application.| | abilityName | string | No | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can match a specific ability. The value of **abilityName** must be unique in an application.|
| uri | string | No | URI. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.| | uri | string | No | URI. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.|
| type | string | No | MIME type, that is, the type of the file to open, for example, **text/xml** and **image/***. For details about the MIME type definition, see https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com. | | type | string | No | MIME type, that is, the type of the file to open, for example, **text/xml** and **image/***. For details about the MIME type definition, see https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com. |
| flags | number | No | How the **Want** object will be handled. By default, numbers are passed in. For details, see [flags](js-apis-ability-wantConstant.md#wantConstant.Flags).| | flags | number | No | How the **Want** object will be handled. By default, numbers are passed in. For details, see [flags](js-apis-ability-wantConstant.md#wantconstantflags). |
| action | string | No | Action to take, such as viewing and sharing application details. In implicit Want, you can define this field and use it together with **uri** or **parameters** to specify the operation to be performed on the data. For details, see [action](js-apis-app-ability-wantConstant.md#wantConstant.Action). For details about the definition and matching rules of implicit Want, see [Matching Rules of Explicit Want and Implicit Want](application-models/explicit-implicit-want-mappings.md). | | action | string | No | Action to take, such as viewing and sharing application details. In implicit Want, you can define this field and use it together with **uri** or **parameters** to specify the operation to be performed on the data. For details, see [action](js-apis-app-ability-wantConstant.md#wantconstantaction). For details about the definition and matching rules of implicit Want, see [Matching Rules of Explicit Want and Implicit Want](../../application-models/explicit-implicit-want-mappings.md). |
| parameters | {[key: string]: any} | No | Want parameters in the form of custom key-value (KV) pairs. By default, the following keys are carried:<br>**ohos.aafwk.callerPid**: PID of the caller.<br>**ohos.aafwk.param.callerToken**: token of the caller.<br>**ohos.aafwk.param.callerUid**: UID in [bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo-1), that is, the application UID in the bundle information. | | parameters | {[key: string]: any} | No | Want parameters in the form of custom key-value (KV) pairs. By default, the following keys are carried:<br>**ohos.aafwk.callerPid**: PID of the caller.<br>**ohos.aafwk.param.callerToken**: token of the caller.<br>**ohos.aafwk.param.callerUid**: UID in [bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo-1), that is, the application UID in the bundle information. |
| entities | Array\<string> | No | Additional category information (such as browser and video player) of the target ability. It is a supplement to **action** in implicit Want and is used to filter ability types. For details, see [entity](js-apis-app-ability-wantConstant.md#wantConstant.Entity). | | entities | Array\<string> | No | Additional category information (such as browser and video player) of the target ability. It is a supplement to **action** in implicit Want and is used to filter ability types. For details, see [entity](js-apis-app-ability-wantConstant.md#wantconstantentity). |
| moduleName<sup>9+</sup> | string | No | Module to which the ability belongs.| | moduleName<sup>9+</sup> | string | No | Module to which the ability belongs.|
**Example** **Example**
...@@ -68,4 +68,4 @@ Want is a carrier for information transfer between objects (application componen ...@@ -68,4 +68,4 @@ Want is a carrier for information transfer between objects (application componen
- For more details and examples, see [Want](../../application-models/want-overview.md). - For more details and examples, see [Want](../../application-models/want-overview.md).
<!--no_check-->
# @ohos.bundle.installer # @ohos.bundle.installer (installer)
The **bundle.installer** module provides APIs for you to install, uninstall, and recover bundles on devices. The **bundle.installer** module provides APIs for you to install, uninstall, and recover bundles on devices.
......
# Media # @ohos.multimedia.media (Media)
> **NOTE** > **NOTE**
>
> The initial APIs of this module are supported since API version 6. 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 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The multimedia subsystem provides a set of simple and easy-to-use APIs for you to access the system and use media resources. The multimedia subsystem provides a set of simple and easy-to-use APIs for you to access the system and use media resources.
...@@ -1917,12 +1916,12 @@ Sets video recording parameters. This API uses an asynchronous callback to retur ...@@ -1917,12 +1916,12 @@ Sets video recording parameters. This API uses an asynchronous callback to retur
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | --------------------------------------- | | -------- | ------------------------------------------ |
| 201 | Permission denied. Return by callback. | | 201 | Permission denied. Return by callback. |
| 401 | Parameter error. Return by callback. | | 401 | Parameter error. Return by callback. |
| 5400102 | Operate not permit. Return by callback. | | 5400102 | Operation not allowed. Return by callback. |
| 5400105 | Service died. Return by callback. | | 5400105 | Service died. Return by callback. |
**Example** **Example**
...@@ -1987,12 +1986,12 @@ Sets video recording parameters. This API uses a promise to return the result. ...@@ -1987,12 +1986,12 @@ Sets video recording parameters. This API uses a promise to return the result.
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | -------------------------------------- | | -------- | ----------------------------------------- |
| 201 | Permission denied. Return by promise. | | 201 | Permission denied. Return by promise. |
| 401 | Parameter error. Return by promise. | | 401 | Parameter error. Return by promise. |
| 5400102 | Operate not permit. Return by promise. | | 5400102 | Operation not allowed. Return by promise. |
| 5400105 | Service died. Return by promise. | | 5400105 | Service died. Return by promise. |
**Example** **Example**
...@@ -2051,11 +2050,11 @@ This API can be called only after [prepare()](#videorecorder_prepare1) is called ...@@ -2051,11 +2050,11 @@ This API can be called only after [prepare()](#videorecorder_prepare1) is called
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | --------------------------------------- | | -------- | ------------------------------------------ |
| 5400102 | Operate not permit. Return by callback. | | 5400102 | Operation not allowed. Return by callback. |
| 5400103 | IO error. Return by callback. | | 5400103 | I/O error. Return by callback. |
| 5400105 | Service died. Return by callback. | | 5400105 | Service died. Return by callback. |
**Example** **Example**
...@@ -2096,11 +2095,11 @@ This API can be called only after [prepare()](#videorecorder_prepare1) is called ...@@ -2096,11 +2095,11 @@ This API can be called only after [prepare()](#videorecorder_prepare1) is called
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | -------------------------------------- | | -------- | ----------------------------------------- |
| 5400102 | Operate not permit. Return by promise. | | 5400102 | Operation not allowed. Return by promise. |
| 5400103 | IO error. Return by promise. | | 5400103 | I/O error. Return by promise. |
| 5400105 | Service died. Return by promise. | | 5400105 | Service died. Return by promise. |
**Example** **Example**
...@@ -2137,11 +2136,11 @@ This API can be called only after [prepare()](#videorecorder_prepare1) and [getI ...@@ -2137,11 +2136,11 @@ This API can be called only after [prepare()](#videorecorder_prepare1) and [getI
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | --------------------------------------- | | -------- | ------------------------------------------ |
| 5400102 | Operate not permit. Return by callback. | | 5400102 | Operation not allowed. Return by callback. |
| 5400103 | IO error. Return by callback. | | 5400103 | I/O error. Return by callback. |
| 5400105 | Service died. Return by callback. | | 5400105 | Service died. Return by callback. |
**Example** **Example**
...@@ -2178,11 +2177,11 @@ This API can be called only after [prepare()](#videorecorder_prepare1) and [getI ...@@ -2178,11 +2177,11 @@ This API can be called only after [prepare()](#videorecorder_prepare1) and [getI
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | -------------------------------------- | | -------- | ----------------------------------------- |
| 5400102 | Operate not permit. Return by promise. | | 5400102 | Operation not allowed. Return by promise. |
| 5400103 | IO error. Return by promise. | | 5400103 | I/O error. Return by promise. |
| 5400105 | Service died. Return by promise. | | 5400105 | Service died. Return by promise. |
**Example** **Example**
...@@ -2217,11 +2216,11 @@ This API can be called only after [start()](#videorecorder_start1) is called. Yo ...@@ -2217,11 +2216,11 @@ This API can be called only after [start()](#videorecorder_start1) is called. Yo
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | --------------------------------------- | | -------- | ------------------------------------------ |
| 5400102 | Operate not permit. Return by callback. | | 5400102 | Operation not allowed. Return by callback. |
| 5400103 | IO error. Return by callback. | | 5400103 | I/O error. Return by callback. |
| 5400105 | Service died. Return by callback. | | 5400105 | Service died. Return by callback. |
**Example** **Example**
...@@ -2258,11 +2257,11 @@ This API can be called only after [start()](#videorecorder_start1) is called. Yo ...@@ -2258,11 +2257,11 @@ This API can be called only after [start()](#videorecorder_start1) is called. Yo
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | -------------------------------------- | | -------- | ----------------------------------------- |
| 5400102 | Operate not permit. Return by promise. | | 5400102 | Operation not allowed. Return by promise. |
| 5400103 | IO error. Return by promise. | | 5400103 | I/O error. Return by promise. |
| 5400105 | Service died. Return by promise. | | 5400105 | Service died. Return by promise. |
**Example** **Example**
...@@ -2295,11 +2294,11 @@ Resumes video recording. This API uses an asynchronous callback to return the re ...@@ -2295,11 +2294,11 @@ Resumes video recording. This API uses an asynchronous callback to return the re
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | --------------------------------------- | | -------- | ------------------------------------------ |
| 5400102 | Operate not permit. Return by callback. | | 5400102 | Operation not allowed. Return by callback. |
| 5400103 | IO error. Return by callback. | | 5400103 | I/O error. Return by callback. |
| 5400105 | Service died. Return by callback. | | 5400105 | Service died. Return by callback. |
**Example** **Example**
...@@ -2334,11 +2333,11 @@ Resumes video recording. This API uses a promise to return the result. ...@@ -2334,11 +2333,11 @@ Resumes video recording. This API uses a promise to return the result.
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | -------------------------------------- | | -------- | ----------------------------------------- |
| 5400102 | Operate not permit. Return by promise. | | 5400102 | Operation not allowed. Return by promise. |
| 5400103 | IO error. Return by promise. | | 5400103 | I/O error. Return by promise. |
| 5400105 | Service died. Return by promise. | | 5400105 | Service died. Return by promise. |
**Example** **Example**
...@@ -2373,11 +2372,11 @@ To start another recording, you must call [prepare()](#videorecorder_prepare1) a ...@@ -2373,11 +2372,11 @@ To start another recording, you must call [prepare()](#videorecorder_prepare1) a
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | --------------------------------------- | | -------- | ------------------------------------------ |
| 5400102 | Operate not permit. Return by callback. | | 5400102 | Operation not allowed. Return by callback. |
| 5400103 | IO error. Return by callback. | | 5400103 | I/O error. Return by callback. |
| 5400105 | Service died. Return by callback. | | 5400105 | Service died. Return by callback. |
**Example** **Example**
...@@ -2414,11 +2413,11 @@ To start another recording, you must call [prepare()](#videorecorder_prepare1) a ...@@ -2414,11 +2413,11 @@ To start another recording, you must call [prepare()](#videorecorder_prepare1) a
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
| ID| Error Message | | ID| Error Message |
| -------- | -------------------------------------- | | -------- | ----------------------------------------- |
| 5400102 | Operate not permit. Return by promise. | | 5400102 | Operation not allowed. Return by promise. |
| 5400103 | IO error. Return by promise. | | 5400103 | I/O error. Return by promise. |
| 5400105 | Service died. Return by promise. | | 5400105 | Service died. Return by promise. |
**Example** **Example**
...@@ -2527,7 +2526,7 @@ For details about the error codes, see [Media Error Codes](../errorcodes/errorco ...@@ -2527,7 +2526,7 @@ For details about the error codes, see [Media Error Codes](../errorcodes/errorco
| ID| Error Message | | ID| Error Message |
| -------- | --------------------------------- | | -------- | --------------------------------- |
| 5400103 | IO error. Return by callback. | | 5400103 | I/O error. Return by callback. |
| 5400105 | Service died. Return by callback. | | 5400105 | Service died. Return by callback. |
**Example** **Example**
...@@ -2567,7 +2566,7 @@ For details about the error codes, see [Media Error Codes](../errorcodes/errorco ...@@ -2567,7 +2566,7 @@ For details about the error codes, see [Media Error Codes](../errorcodes/errorco
| ID| Error Message | | ID| Error Message |
| -------- | -------------------------------- | | -------- | -------------------------------- |
| 5400103 | IO error. Return by promise. | | 5400103 | I/O error. Return by promise. |
| 5400105 | Service died. Return by promise. | | 5400105 | Service died. Return by promise. |
**Example** **Example**
...@@ -2602,7 +2601,7 @@ For details about the error codes, see [Media Error Codes](../errorcodes/errorco ...@@ -2602,7 +2601,7 @@ For details about the error codes, see [Media Error Codes](../errorcodes/errorco
| ID| Error Message | | ID| Error Message |
| -------- | --------------------------------- | | -------- | --------------------------------- |
| 5400103 | IO error. Return by callback. | | 5400103 | I/O error. Return by callback. |
| 5400105 | Service died. Return by callback. | | 5400105 | Service died. Return by callback. |
**Example** **Example**
......
...@@ -202,7 +202,7 @@ Subscribes to the media library changes. This API uses an asynchronous callback ...@@ -202,7 +202,7 @@ Subscribes to the media library changes. This API uses an asynchronous callback
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | -------------------- | ---- | ---------------------------------------- | | -------- | -------------------- | ---- | ---------------------------------------- |
| type | 'deviceChange'&#124;'albumChange'&#124;'imageChange'&#124;'audioChange'&#124;'videoChange'&#124;'fileChange'&#124;'remoteFileChange' | Yes | Media type.<br>'deviceChange': registered device change<br>'albumChange': album change<br>'imageChange': image file change<br>'audioChange': audio file change<br>'videoChange': video file change<br>'fileChange': file change<br>'remoteFileChange': file change on the registered device| | type | 'deviceChange'&#124;<br>'albumChange'&#124;<br>'imageChange'&#124;<br>'audioChange'&#124;<br>'videoChange'&#124;<br>'fileChange'&#124;<br>'remoteFileChange' | Yes | Media type.<br>'deviceChange': registered device change<br>'albumChange': album change<br>'imageChange': image file change<br>'audioChange': audio file change<br>'videoChange': video file change<br>'fileChange': file change<br>'remoteFileChange': file change on the registered device|
| callback | Callback&lt;void&gt; | Yes | Void callback. | | callback | Callback&lt;void&gt; | Yes | Void callback. |
**Example** **Example**
...@@ -224,7 +224,7 @@ Unsubscribes from the media library changes. This API uses an asynchronous callb ...@@ -224,7 +224,7 @@ Unsubscribes from the media library changes. This API uses an asynchronous callb
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | -------------------- | ---- | ---------------------------------------- | | -------- | -------------------- | ---- | ---------------------------------------- |
| type | 'deviceChange'&#124;'albumChange'&#124;'imageChange'&#124;'audioChange'&#124;'videoChange'&#124;'fileChange'&#124;'remoteFileChange' | Yes | Media type.<br>'deviceChange': registered device change<br>'albumChange': album change<br>'imageChange': image file change<br>'audioChange': audio file change<br>'videoChange': video file change<br>'fileChange': file change<br>'remoteFileChange': file change on the registered device| | type | 'deviceChange'&#124;<br>'albumChange'&#124;<br>'imageChange'&#124;<br>'audioChange'&#124;<br>'videoChange'&#124;<br>'fileChange'&#124;<br>'remoteFileChange' | Yes | Media type.<br>'deviceChange': registered device change<br>'albumChange': album change<br>'imageChange': image file change<br>'audioChange': audio file change<br>'videoChange': video file change<br>'fileChange': file change<br>'remoteFileChange': file change on the registered device|
| callback | Callback&lt;void&gt; | No | Void callback. | | callback | Callback&lt;void&gt; | No | Void callback. |
**Example** **Example**
......
# @ohos.reminderAgent # @ohos.reminderAgent (reminderAgent)
The **reminderAgent** module provides APIs for publishing scheduled reminders through the reminder agent. The **reminderAgent** module provides APIs for publishing scheduled reminders through the reminder agent.
......
# @ohos.reminderAgentManager # @ohos.reminderAgentManager (reminderAgentManager)
The **reminderAgentManager** module provides APIs for publishing scheduled reminders through the reminder agent. The **reminderAgentManager** module provides APIs for publishing scheduled reminders through the reminder agent.
......
...@@ -236,7 +236,7 @@ Requests a continuous task from the system. This API uses an asynchronous callba ...@@ -236,7 +236,7 @@ Requests a continuous task from the system. This API uses an asynchronous callba
| --------- | ---------------------------------- | ---- | ---------------------------------------- | | --------- | ---------------------------------- | ---- | ---------------------------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md).| | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md).|
| bgMode | [BackgroundMode](#backgroundmode) | Yes | Background mode requested. | | bgMode | [BackgroundMode](#backgroundmode) | Yes | Background mode requested. |
| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked. | | wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes** **Error codes**
...@@ -256,7 +256,7 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -256,7 +256,7 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
**Example** **Example**
```js ```js
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import backgroundTaskManager from '@ohos.resourceschedule.backgroundTaskManager'; import backgroundTaskManager from '@ohos.resourceschedule.backgroundTaskManager';
import wantAgent from '@ohos.wantAgent'; import wantAgent from '@ohos.wantAgent';
...@@ -268,13 +268,13 @@ function callback(error, data) { ...@@ -268,13 +268,13 @@ function callback(error, data) {
} }
} }
export default class MainAbility extends Ability { export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
let wantAgentInfo = { let wantAgentInfo = {
wants: [ wants: [
{ {
bundleName: "com.example.myapplication", bundleName: "com.example.myapplication",
abilityName: "MainAbility" abilityName: "EntryAbility"
} }
], ],
operationType: wantAgent.OperationType.START_ABILITY, operationType: wantAgent.OperationType.START_ABILITY,
...@@ -310,7 +310,7 @@ Requests a continuous task from the system. This API uses a promise to return th ...@@ -310,7 +310,7 @@ Requests a continuous task from the system. This API uses a promise to return th
| --------- | ---------------------------------- | ---- | ---------------------------------------- | | --------- | ---------------------------------- | ---- | ---------------------------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md).| | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md).|
| bgMode | [BackgroundMode](#backgroundmode) | Yes | Background mode requested. | | bgMode | [BackgroundMode](#backgroundmode) | Yes | Background mode requested. |
| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked. | | wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked. |
**Return value** **Return value**
...@@ -335,17 +335,17 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -335,17 +335,17 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
**Example** **Example**
```js ```js
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import backgroundTaskManager from '@ohos.resourceschedule.backgroundTaskManager'; import backgroundTaskManager from '@ohos.resourceschedule.backgroundTaskManager';
import wantAgent from '@ohos.wantAgent'; import wantAgent from '@ohos.wantAgent';
export default class MainAbility extends Ability { export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
let wantAgentInfo = { let wantAgentInfo = {
wants: [ wants: [
{ {
bundleName: "com.example.myapplication", bundleName: "com.example.myapplication",
abilityName: "MainAbility" abilityName: "EntryAbility"
} }
], ],
operationType: wantAgent.OperationType.START_ABILITY, operationType: wantAgent.OperationType.START_ABILITY,
...@@ -401,7 +401,7 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -401,7 +401,7 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
**Example** **Example**
```js ```js
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import backgroundTaskManager from '@ohos.resourceschedule.backgroundTaskManager'; import backgroundTaskManager from '@ohos.resourceschedule.backgroundTaskManager';
function callback(error, data) { function callback(error, data) {
...@@ -412,7 +412,7 @@ function callback(error, data) { ...@@ -412,7 +412,7 @@ function callback(error, data) {
} }
} }
export default class MainAbility extends Ability { export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
try { try {
backgroundTaskManager.stopBackgroundRunning(this.context, callback); backgroundTaskManager.stopBackgroundRunning(this.context, callback);
...@@ -462,10 +462,10 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -462,10 +462,10 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
**Example** **Example**
```js ```js
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import backgroundTaskManager from '@ohos.resourceschedule.backgroundTaskManager'; import backgroundTaskManager from '@ohos.resourceschedule.backgroundTaskManager';
export default class MainAbility extends Ability { export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
try { try {
backgroundTaskManager.stopBackgroundRunning(this.context).then(() => { backgroundTaskManager.stopBackgroundRunning(this.context).then(() => {
......
...@@ -219,8 +219,8 @@ Queries the application usage duration statistics based on the specified start t ...@@ -219,8 +219,8 @@ Queries the application usage duration statistics based on the specified start t
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------------------------- | | -------- | ---------------------------------------- | ---- | --------------------------------------- |
| begin | number | Yes | Start time. | | begin | number | Yes | Start time, in milliseconds. |
| end | number | Yes | End time. | | end | number | Yes | End time, in milliseconds. |
| callback | AsyncCallback&lt;[BundleStatsMap](#bundlestatsmap)&gt; | Yes | Callback used to return the application usage duration statistics.| | callback | AsyncCallback&lt;[BundleStatsMap](#bundlestatsmap)&gt; | Yes | Callback used to return the application usage duration statistics.|
**Error codes** **Error codes**
...@@ -274,8 +274,8 @@ Queries the application usage duration statistics based on the specified start t ...@@ -274,8 +274,8 @@ Queries the application usage duration statistics based on the specified start t
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ----- | | ----- | ------ | ---- | ----- |
| begin | number | Yes | Start time.| | begin | number | Yes | Start time, in milliseconds.|
| end | number | Yes | End time.| | end | number | Yes | End time, in milliseconds.|
**Return value** **Return value**
...@@ -333,8 +333,8 @@ Queries the application usage duration statistics in the specified time frame at ...@@ -333,8 +333,8 @@ Queries the application usage duration statistics in the specified time frame at
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ---------------------------------------- | ---- | ---------------------------------------- | | ---------- | ---------------------------------------- | ---- | ---------------------------------------- |
| byInterval | [IntervalType](#intervaltype) | Yes | Type of information to be queried. | | byInterval | [IntervalType](#intervaltype) | Yes | Type of information to be queried. |
| begin | number | Yes | Start time. | | begin | number | Yes | Start time, in milliseconds. |
| end | number | Yes | End time. | | end | number | Yes | End time, in milliseconds. |
| callback | AsyncCallback&lt;Array&lt;[BundleStatsInfo](#bundlestatsinfo)&gt;&gt; | Yes | Callback used to return the application usage duration statistics.| | callback | AsyncCallback&lt;Array&lt;[BundleStatsInfo](#bundlestatsinfo)&gt;&gt; | Yes | Callback used to return the application usage duration statistics.|
**Error codes** **Error codes**
...@@ -387,8 +387,8 @@ Queries the application usage duration statistics in the specified time frame at ...@@ -387,8 +387,8 @@ Queries the application usage duration statistics in the specified time frame at
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ----------------------------- | ---- | ----- | | ---------- | ----------------------------- | ---- | ----- |
| byInterval | [IntervalType](#intervaltype) | Yes | Type of information to be queried.| | byInterval | [IntervalType](#intervaltype) | Yes | Type of information to be queried.|
| begin | number | Yes | Start time.| | begin | number | Yes | Start time, in milliseconds.|
| end | number | Yes | End time.| | end | number | Yes | End time, in milliseconds.|
**Return value** **Return value**
...@@ -443,8 +443,8 @@ Queries events of all applications based on the specified start time and end tim ...@@ -443,8 +443,8 @@ Queries events of all applications based on the specified start time and end tim
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------------------------- | | -------- | ---------------------------------------- | ---- | --------------------------------------- |
| begin | number | Yes | Start time. | | begin | number | Yes | Start time, in milliseconds. |
| end | number | Yes | End time. | | end | number | Yes | End time, in milliseconds. |
| callback | AsyncCallback&lt;Array&lt;[BundleEvents](#bundleevents)&gt;&gt; | Yes | Callback used to return the events obtained.| | callback | AsyncCallback&lt;Array&lt;[BundleEvents](#bundleevents)&gt;&gt; | Yes | Callback used to return the events obtained.|
**Error codes** **Error codes**
...@@ -496,8 +496,8 @@ Queries events of all applications based on the specified start time and end tim ...@@ -496,8 +496,8 @@ Queries events of all applications based on the specified start time and end tim
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ----- | | ----- | ------ | ---- | ----- |
| begin | number | Yes | Start time.| | begin | number | Yes | Start time, in milliseconds.|
| end | number | Yes | End time.| | end | number | Yes | End time, in milliseconds.|
**Return value** **Return value**
...@@ -548,8 +548,8 @@ Queries events of this application based on the specified start time and end tim ...@@ -548,8 +548,8 @@ Queries events of this application based on the specified start time and end tim
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------------------------- | | -------- | ---------------------------------------- | ---- | --------------------------------------- |
| begin | number | Yes | Start time. | | begin | number | Yes | Start time, in milliseconds. |
| end | number | Yes | End time. | | end | number | Yes | End time, in milliseconds. |
| callback | AsyncCallback&lt;Array&lt;[BundleEvents](#bundleevents)&gt;&gt; | Yes | Callback used to return the events obtained.| | callback | AsyncCallback&lt;Array&lt;[BundleEvents](#bundleevents)&gt;&gt; | Yes | Callback used to return the events obtained.|
**Error codes** **Error codes**
...@@ -597,8 +597,8 @@ Queries events of this application based on the specified start time and end tim ...@@ -597,8 +597,8 @@ Queries events of this application based on the specified start time and end tim
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ----- | | ----- | ------ | ---- | ----- |
| begin | number | Yes | Start time.| | begin | number | Yes | Start time, in milliseconds.|
| end | number | Yes | End time.| | end | number | Yes | End time, in milliseconds.|
**Return value** **Return value**
...@@ -1276,8 +1276,8 @@ Queries statistics about system events (hibernation, wakeup, unlocking, and scre ...@@ -1276,8 +1276,8 @@ Queries statistics about system events (hibernation, wakeup, unlocking, and scre
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ----- | | ----- | ------ | ---- | ----- |
| begin | number | Yes | Start time.| | begin | number | Yes | Start time, in milliseconds.|
| end | number | Yes | End time.| | end | number | Yes | End time, in milliseconds.|
**Return value** **Return value**
...@@ -1329,8 +1329,8 @@ queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback&lt;Arr ...@@ -1329,8 +1329,8 @@ queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback&lt;Arr
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| begin | number | Yes | Start time. | | begin | number | Yes | Start time, in milliseconds. |
| end | number | Yes | End time. | | end | number | Yes | End time, in milliseconds. |
| callback | AsyncCallback&lt;Array&lt;[DeviceEventStats](#deviceeventstats)&gt;&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;Array&lt;[DeviceEventStats](#deviceeventstats)&gt;&gt; | Yes | Callback used to return the result. |
**Error codes** **Error codes**
...@@ -1379,8 +1379,8 @@ Queries the number of notifications from all applications based on the specified ...@@ -1379,8 +1379,8 @@ Queries the number of notifications from all applications based on the specified
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ----- | | ----- | ------ | ---- | ----- |
| begin | number | Yes | Start time.| | begin | number | Yes | Start time, in milliseconds.|
| end | number | Yes | End time.| | end | number | Yes | End time, in milliseconds.|
**Return value** **Return value**
...@@ -1432,8 +1432,8 @@ Queries the number of notifications from all applications based on the specified ...@@ -1432,8 +1432,8 @@ Queries the number of notifications from all applications based on the specified
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| begin | number | Yes | Start time. | | begin | number | Yes | Start time, in milliseconds. |
| end | number | Yes | End time. | | end | number | Yes | End time, in milliseconds. |
| callback | AsyncCallback&lt;Array&lt;[DeviceEventStats](#deviceeventstats)&gt;&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;Array&lt;[DeviceEventStats](#deviceeventstats)&gt;&gt; | Yes | Callback used to return the result. |
**Error codes** **Error codes**
...@@ -1476,7 +1476,7 @@ Provides the information about the FA usage. ...@@ -1476,7 +1476,7 @@ Provides the information about the FA usage.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------------------- | ---------------------------------------- | ---- | ----------------------------- | | -------------------- | ---------------------------------------- | ---- | ----------------------------- |
| deviceId | string | No | ID of the device to which the FA belongs. | | deviceId | string | No | ID of the device to which the FA belongs. |
| bundleName | string | Yes | Name of the application bundle to which the FA belongs. | | bundleName | string | Yes | Name of the bundle to which the FA belongs. |
| moduleName | string | Yes | Name of the module to which the FA belongs. | | moduleName | string | Yes | Name of the module to which the FA belongs. |
| abilityName | string | No | **MainAbility** name of the FA. | | abilityName | string | No | **MainAbility** name of the FA. |
| appLabelId | number | No | Application label ID of the FA. | | appLabelId | number | No | Application label ID of the FA. |
......
# @ohos.resourceschedule.workScheduler # @ohos.resourceschedule.workScheduler (workScheduler)
The **workScheduler** module provides the APIs for registering, canceling, and querying Work Scheduler tasks, which do not have real-time constraints. The **workScheduler** module provides the APIs for registering, canceling, and querying Work Scheduler tasks, which do not have real-time constraints.
......
# @ohos.screen (Screen) # @ohos.screen (Screen)
The **screen** module implements basic screen management. You can use the APIs of this module to obtain a **Screen** object, listen for screen changes, and create and destroy virtual screens. The **Screen** module implements basic screen management. You can use the APIs of this module to obtain a **Screen** object, listen for screen changes, and create and destroy virtual screens.
> **NOTE** > **NOTE**
> >
......
# Sensor # @ohos.sensor (Sensor)
The **Sensor** module provides APIs for obtaining the sensor list and subscribing to sensor data. It also provides some common sensor algorithms. The **Sensor** module provides APIs for obtaining the sensor list and subscribing to sensor data. It also provides some common sensor algorithms.
> **NOTE** > **NOTE**
>
> The initial APIs of this module are supported since API version 8. 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 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -3495,9 +3496,9 @@ Describes the acceleration sensor data. It extends from [Response](#response). ...@@ -3495,9 +3496,9 @@ Describes the acceleration sensor data. It extends from [Response](#response).
| Name| Type | Readable| Writable| Description | | Name| Type | Readable| Writable| Description |
| ---- | ------ | ---- | ---- | ------------------------------------ | | ---- | ------ | ---- | ---- | ------------------------------------ |
| x | number | Yes | Yes | Acceleration along the x-axis of the device, in m/s2.| | x | number | Yes | Yes | Acceleration along the x-axis of the device, in m/s². |
| y | number | Yes | Yes | Acceleration along the y-axis of the device, in m/s2.| | y | number | Yes | Yes | Acceleration along the y-axis of the device, in m/s². |
| z | number | Yes | Yes | Acceleration along the z-axis of the device, in m/s2.| | z | number | Yes | Yes | Acceleration along the z-axis of the device, in m/s². |
## LinearAccelerometerResponse ## LinearAccelerometerResponse
...@@ -3509,9 +3510,9 @@ Describes the linear acceleration sensor data. It extends from [Response](#respo ...@@ -3509,9 +3510,9 @@ Describes the linear acceleration sensor data. It extends from [Response](#respo
| Name| Type | Readable| Writable| Description | | Name| Type | Readable| Writable| Description |
| ---- | ------ | ---- | ---- | ---------------------------------------- | | ---- | ------ | ---- | ---- | ---------------------------------------- |
| x | number | Yes | Yes | Linear acceleration along the x-axis of the device, in m/s2.| | x | number | Yes | Yes | Linear acceleration along the x-axis of the device, in m/s². |
| y | number | Yes | Yes | Linear acceleration along the y-axis of the device, in m/s2.| | y | number | Yes | Yes | Linear acceleration along the y-axis of the device, in m/s². |
| z | number | Yes | Yes | Linear acceleration along the z-axis of the device, in m/s2.| | z | number | Yes | Yes | Linear acceleration along the z-axis of the device, in m/s². |
## AccelerometerUncalibratedResponse ## AccelerometerUncalibratedResponse
...@@ -3523,12 +3524,12 @@ Describes the uncalibrated acceleration sensor data. It extends from [Response]( ...@@ -3523,12 +3524,12 @@ Describes the uncalibrated acceleration sensor data. It extends from [Response](
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| ----- | ------ | ---- | ---- | ------------------------------------------------ | | ----- | ------ | ---- | ---- | ------------------------------------------------ |
| x | number | Yes | Yes | Uncalibrated acceleration along the x-axis of the device, in m/s2. | | x | number | Yes | Yes | Uncalibrated acceleration along the x-axis of the device, in m/s². |
| y | number | Yes | Yes | Uncalibrated acceleration along the y-axis of the device, in m/s2. | | y | number | Yes | Yes | Uncalibrated acceleration along the y-axis of the device, in m/s². |
| z | number | Yes | Yes | Uncalibrated acceleration along the z-axis of the device, in m/s2. | | z | number | Yes | Yes | Uncalibrated acceleration along the z-axis of the device, in m/s². |
| biasX | number | Yes | Yes | Uncalibrated acceleration bias along the x-axis of the device, in m/s2. | | biasX | number | Yes | Yes | Uncalibrated acceleration bias along the x-axis of the device, in m/s². |
| biasY | number | Yes | Yes | Uncalibrated acceleration bias along the y-axis of the device, in m/s2.| | biasY | number | Yes | Yes | Uncalibrated acceleration bias along the y-axis of the device, in m/s². |
| biasZ | number | Yes | Yes | Uncalibrated acceleration bias along the z-axis of the device, in m/s2. | | biasZ | number | Yes | Yes | Uncalibrated acceleration bias along the z-axis of the device, in m/s². |
## GravityResponse ## GravityResponse
...@@ -3540,9 +3541,9 @@ Describes the gravity sensor data. It extends from [Response](#response). ...@@ -3540,9 +3541,9 @@ Describes the gravity sensor data. It extends from [Response](#response).
| Name| Type | Readable| Writable| Description | | Name| Type | Readable| Writable| Description |
| ---- | ------ | ---- | ---- | ---------------------------------------- | | ---- | ------ | ---- | ---- | ---------------------------------------- |
| x | number | Yes | Yes | Gravitational acceleration along the x-axis of the device, in m/s2.| | x | number | Yes | Yes | Gravitational acceleration along the x-axis of the device, in m/s². |
| y | number | Yes | Yes | Gravitational acceleration along the y-axis of the device, in m/s2.| | y | number | Yes | Yes | Gravitational acceleration along the y-axis of the device, in m/s². |
| z | number | Yes | Yes | Gravitational acceleration along the z-axis of the device, in m/s2.| | z | number | Yes | Yes | Gravitational acceleration along the z-axis of the device, in m/s². |
## OrientationResponse ## OrientationResponse
......
# @system.app # @system.app (Application Context)
> **NOTE** > **NOTE**
> - The APIs of this module are no longer maintained since API version 7. You are advised to use the new APIs. > - The APIs of this module are no longer maintained since API version 7. You are advised to use the new APIs.
......
# Sensor # @system.sensor (Sensor)
The **Sensor** module provides APIs for querying the sensor list, subscribing to or unsubscribing from sensor data, and executing control commands. The **Sensor** module provides APIs for querying the sensor list, subscribing to or unsubscribing from sensor data, and executing control commands.
...@@ -21,9 +21,9 @@ import sensor from '@system.sensor'; ...@@ -21,9 +21,9 @@ import sensor from '@system.sensor';
## Error Codes ## Error Codes
| Error Code | Description | | Error Code | Description |
| ---------- | ---------------------------------------- | | ---- | -------------- |
| 900 | The current device does not support the corresponding sensor. | | 900 | The current device does not support the corresponding sensor.|
## sensor.subscribeAccelerometer ## sensor.subscribeAccelerometer
...@@ -37,19 +37,19 @@ Subscribes to data changes of the acceleration sensor. If this API is called mul ...@@ -37,19 +37,19 @@ Subscribes to data changes of the acceleration sensor. If this API is called mul
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | -------- | --------- | ---------------------------------------- | | -------- | -------- | ---- | ---------------------------------------- |
| interval | string | Yes | Execution frequency of the callback for returning the acceleration sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. | | interval | string | Yes | Execution frequency of the callback for returning the acceleration sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
| success | Function | Yes | Called when the acceleration sensor data changes. | | success | Function | Yes | Called when the acceleration sensor data changes. |
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure. |
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| ---- | ------ | --------------------------- | | ---- | ------ | ------- |
| x | number | Acceleration on the x-axis. | | x | number | Acceleration on the x-axis.|
| y | number | Acceleration on the y-axis. | | y | number | Acceleration on the y-axis.|
| z | number | Acceleration on the z-axis. | | z | number | Acceleration on the z-axis.|
**Example** **Example**
...@@ -68,7 +68,6 @@ sensor.subscribeAccelerometer({ ...@@ -68,7 +68,6 @@ sensor.subscribeAccelerometer({
``` ```
> **NOTE** > **NOTE**
>
> To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback. > To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback.
## sensor.unsubscribeAccelerometer ## sensor.unsubscribeAccelerometer
...@@ -97,16 +96,16 @@ Subscribes to data changes of the compass sensor. If this API is called multiple ...@@ -97,16 +96,16 @@ Subscribes to data changes of the compass sensor. If this API is called multiple
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- | | ------- | -------- | ---- | --------------- |
| success | Function | Yes | Called when the compass sensor data changes. | | success | Function | Yes | Called when the compass sensor data changes.|
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure. |
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| --------- | ------ | ------------------------------------ | | --------- | ------ | ---------- |
| direction | number | Direction of the device, in degrees. | | direction | number | Direction of the device, in degrees.|
**Example** **Example**
...@@ -122,7 +121,6 @@ sensor.subscribeCompass({ ...@@ -122,7 +121,6 @@ sensor.subscribeCompass({
``` ```
> **NOTE** > **NOTE**
>
> To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback. > To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback.
## sensor.unsubscribeCompass ## sensor.unsubscribeCompass
...@@ -149,16 +147,16 @@ Subscribes to data changes of the proximity sensor. If this API is called multip ...@@ -149,16 +147,16 @@ Subscribes to data changes of the proximity sensor. If this API is called multip
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- | | ------- | -------- | ---- | ----------------- |
| success | Function | Yes | Called when the proximity sensor data changes. | | success | Function | Yes | Called when the proximity sensor data changes.|
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure. |
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| -------- | ------ | ---------------------------------------- | | -------- | ------ | --------------------- |
| distance | number | Distance between a visible object and the device screen. | | distance | number | Distance between a visible object and the device screen.|
**Example** **Example**
...@@ -174,7 +172,6 @@ sensor.subscribeProximity({ ...@@ -174,7 +172,6 @@ sensor.subscribeProximity({
``` ```
> **NOTE** > **NOTE**
>
> To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback. > To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback.
## sensor.unsubscribeProximity ## sensor.unsubscribeProximity
...@@ -201,16 +198,16 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu ...@@ -201,16 +198,16 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- | | ------- | -------- | ---- | --------------- |
| success | Function | Yes | Called when the ambient light sensor data changes | | success | Function | Yes | Called when the ambient light sensor data changes|
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure. |
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| --------- | ------ | ------------------------ | | --------- | ------ | ------------ |
| intensity | number | Light intensity, in lux. | | intensity | number | Light intensity, in lux.|
**Example** **Example**
...@@ -226,7 +223,6 @@ sensor.subscribeLight({ ...@@ -226,7 +223,6 @@ sensor.subscribeLight({
``` ```
> **NOTE** > **NOTE**
>
> To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback. > To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback.
## sensor.unsubscribeLight ## sensor.unsubscribeLight
...@@ -255,16 +251,16 @@ Subscribes to data changes of the step counter sensor. If this API is called mul ...@@ -255,16 +251,16 @@ Subscribes to data changes of the step counter sensor. If this API is called mul
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- | | ------- | -------- | ---- | ---------------- |
| success | Function | Yes | Called when the step counter sensor data changes. | | success | Function | Yes | Called when the step counter sensor data changes.|
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure. |
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| ----- | ------ | ---------------------------------------- | | ----- | ------ | --------------------- |
| steps | number | Number of counted steps after the sensor is restarted.<br> | | steps | number | Number of counted steps after the sensor is restarted.<br>|
**Example** **Example**
...@@ -280,7 +276,6 @@ sensor.subscribeStepCounter({ ...@@ -280,7 +276,6 @@ sensor.subscribeStepCounter({
``` ```
> **NOTE** > **NOTE**
>
> To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback. > To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback.
## sensor.unsubscribeStepCounter ## sensor.unsubscribeStepCounter
...@@ -310,16 +305,16 @@ Subscribes to data changes of the barometer sensor. If this API is called multip ...@@ -310,16 +305,16 @@ Subscribes to data changes of the barometer sensor. If this API is called multip
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- | | ------- | -------- | ---- | ---------------- |
| success | Function | Yes | Called when the barometer sensor data changes. | | success | Function | Yes | Called when the barometer sensor data changes.|
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure. |
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| -------- | ------ | -------------------- | | -------- | ------ | ----------- |
| pressure | number | Pressure, in pascal. | | pressure | number | Pressure, in pascal.|
**Example** **Example**
...@@ -335,7 +330,6 @@ sensor.subscribeBarometer({ ...@@ -335,7 +330,6 @@ sensor.subscribeBarometer({
``` ```
> **NOTE** > **NOTE**
>
> To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback. > To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback.
...@@ -366,16 +360,16 @@ Subscribes to data changes of the heart rate sensor. If this API is called multi ...@@ -366,16 +360,16 @@ Subscribes to data changes of the heart rate sensor. If this API is called multi
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- | | ------- | -------- | ---- | ------------------------- |
| success | Function | Yes | Called when the heart rate sensor data changes. This callback is invoked every five seconds. | | success | Function | Yes | Called when the heart rate sensor data changes. This callback is invoked every five seconds.|
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure. |
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| --------- | ------ | ----------- | | --------- | ------ | ---- |
| heartRate | number | Heart rate. | | heartRate | number | Heart rate.|
**Example** **Example**
...@@ -391,7 +385,6 @@ sensor.subscribeHeartRate({ ...@@ -391,7 +385,6 @@ sensor.subscribeHeartRate({
``` ```
> **NOTE** > **NOTE**
>
> To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback. > To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback.
...@@ -421,16 +414,16 @@ Subscribes to changes of the wearing state of a wearable device. If this API is ...@@ -421,16 +414,16 @@ Subscribes to changes of the wearing state of a wearable device. If this API is
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | -------- | --------- | -------------------------------------- | | ------- | -------- | ---- | ------------- |
| success | Function | Yes | Called when the wearing state changes. | | success | Function | Yes | Called when the wearing state changes.|
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure. |
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| ----- | ------- | ------------------------------------ | | ----- | ------- | ------ |
| value | boolean | Whether the wearable device is worn. | | value | boolean | Whether the wearable device is worn.|
**Example** **Example**
...@@ -446,7 +439,6 @@ sensor.subscribeOnBodyState({ ...@@ -446,7 +439,6 @@ sensor.subscribeOnBodyState({
``` ```
> **NOTE** > **NOTE**
>
> To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback. > To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback.
## sensor.unsubscribeOnBodyState ## sensor.unsubscribeOnBodyState
...@@ -473,17 +465,17 @@ Obtains the wearing state of a wearable device. ...@@ -473,17 +465,17 @@ Obtains the wearing state of a wearable device.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | -------- | --------- | -------------------------------------- | | -------- | -------- | ---- | ------------ |
| success | Function | No | Callback upon success. | | success | Function | No | Callback upon success.|
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure.|
| complete | Function | No | Called when the execution is complete. | | complete | Function | No | Called when the execution is complete.|
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| ----- | ------- | ------------------------------------ | | ----- | ------- | ------ |
| value | boolean | Whether the wearable device is worn. | | value | boolean | Whether the wearable device is worn.|
**Example** **Example**
...@@ -510,18 +502,18 @@ If this API is called multiple times for the same application, the last call tak ...@@ -510,18 +502,18 @@ If this API is called multiple times for the same application, the last call tak
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | -------- | --------- | ---------------------------------------- | | -------- | -------- | ---- | ---------------------------------------- |
| interval | string | Yes | Interval at which the callback is invoked to return the device orientation sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. | | interval | string | Yes | Interval at which the callback is invoked to return the device orientation sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
| success | Function | Yes | Called when the device orientation sensor data changes. | | success | Function | Yes | Called when the device orientation sensor data changes. |
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure. |
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| ----- | ------ | ---------------------------------------- | | ----- | ------ | ---------------------------------------- |
| alpha | number | Rotation angle around the Z axis when the X/Y axis of the device coincides with the X/Y axis of the earth. | | alpha | number | Rotation angle around the Z axis when the X/Y axis of the device coincides with the X/Y axis of the earth.|
| beta | number | Rotation angle around the X axis when the Y/Z axis of the device coincides with the Y/Z axis of the earth. | | beta | number | Rotation angle around the X axis when the Y/Z axis of the device coincides with the Y/Z axis of the earth.|
| gamma | number | Rotation angle around the Y axis when the X/Z axis of the device coincides with the X/Z axis of the earth. | | gamma | number | Rotation angle around the Y axis when the X/Z axis of the device coincides with the X/Z axis of the earth.|
**Example** **Example**
...@@ -540,7 +532,6 @@ sensor.subscribeDeviceOrientation({ ...@@ -540,7 +532,6 @@ sensor.subscribeDeviceOrientation({
``` ```
> **NOTE** > **NOTE**
>
> To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback. > To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback.
## sensor.unsubscribeDeviceOrientation<sup>6+</sup> ## sensor.unsubscribeDeviceOrientation<sup>6+</sup>
...@@ -571,19 +562,19 @@ If this API is called multiple times for the same application, the last call tak ...@@ -571,19 +562,19 @@ If this API is called multiple times for the same application, the last call tak
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | -------- | --------- | ---------------------------------------- | | -------- | -------- | ---- | ---------------------------------------- |
| interval | string | Yes | Interval at which the callback is invoked to return the gyroscope sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. | | interval | string | Yes | Interval at which the callback is invoked to return the gyroscope sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
| success | Function | Yes | Called when the gyroscope sensor data changes. | | success | Function | Yes | Called when the gyroscope sensor data changes. |
| fail | Function | No | Callback upon failure. | | fail | Function | No | Callback upon failure. |
Return values of the success callback Return values of the success callback
| Name | Type | Description | | Name | Type | Description |
| ---- | ------ | ---------------------------------------- | | ---- | ------ | --------- |
| x | number | Rotation angular velocity of the X axis. | | x | number | Rotation angular velocity of the X axis.|
| y | number | Rotation angular velocity of the Y axis. | | y | number | Rotation angular velocity of the Y axis.|
| z | number | Rotation angular velocity of the Z axis. | | z | number | Rotation angular velocity of the Z axis.|
**Example** **Example**
...@@ -602,7 +593,6 @@ sensor.subscribeGyroscope({ ...@@ -602,7 +593,6 @@ sensor.subscribeGyroscope({
``` ```
> **NOTE** > **NOTE**
>
> To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback. > To reduce performance overhead, you are advised to unsubscribe from the sensor data in the **onDestory** callback.
## sensor.unsubscribeGyroscope<sup>6+</sup> ## sensor.unsubscribeGyroscope<sup>6+</sup>
......
# Vibrator # @system.vibrator (Vibrator)
The **Vibrate** module provides APIs for controlling LED lights and vibrators. You can use the APIs to query the LED light list, turn on and off the LED light, query the vibrator list, query the vibrator effect, and trigger and turn off the vibrator.
The **Vibrator** module provides APIs for controlling LED lights and vibrators. You can use the APIs to query the LED light list, turn on and off the LED light, query the vibrator list, query the vibrator effect, and trigger and turn off the vibrator.
Misc devices refer to LED lights and vibrators on devices. LED lights are mainly used for indication (for example, indicating the charging state) and blinking (such as tri-colored lights). Vibrators are mainly used in scenarios such as the alarm clock, power-on/off, and incoming call vibration. Misc devices refer to LED lights and vibrators on devices. LED lights are mainly used for indication (for example, indicating the charging state) and blinking (such as tri-colored lights). Vibrators are mainly used in scenarios such as the alarm clock, power-on/off, and incoming call vibration.
......
# Vibrator # @ohos.vibrator (Vibrator)
The **vibrator** module provides APIs for starting or stopping vibration. The **vibrator** module provides APIs for starting or stopping vibration.
......
...@@ -248,7 +248,7 @@ Enumerates the color spaces. ...@@ -248,7 +248,7 @@ Enumerates the color spaces.
| Name | Value| Description | | Name | Value| Description |
| ---------- | ------ | -------------- | | ---------- | ------ | -------------- |
| DEFAULT | 0 | Default gamut.| | DEFAULT | 0 | Default SRGB gamut.|
| WIDE_GAMUT | 1 | Wide-gamut. | | WIDE_GAMUT | 1 | Wide-gamut. |
## ScaleOptions<sup>9+</sup> ## ScaleOptions<sup>9+</sup>
...@@ -1544,6 +1544,8 @@ moveWindowTo(x: number, y: number, callback: AsyncCallback&lt;void&gt;): void ...@@ -1544,6 +1544,8 @@ moveWindowTo(x: number, y: number, callback: AsyncCallback&lt;void&gt;): void
Moves this window. This API uses an asynchronous callback to return the result. Moves this window. This API uses an asynchronous callback to return the result.
This operation is not supported in a window in full-screen mode.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters** **Parameters**
...@@ -1585,6 +1587,8 @@ moveWindowTo(x: number, y: number): Promise&lt;void&gt; ...@@ -1585,6 +1587,8 @@ moveWindowTo(x: number, y: number): Promise&lt;void&gt;
Moves this window. This API uses a promise to return the result. Moves this window. This API uses a promise to return the result.
This operation is not supported in a window in full-screen mode.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters** **Parameters**
...@@ -1636,6 +1640,8 @@ The system window has the following size limits: [0, 2560] in width and [0, 2560 ...@@ -1636,6 +1640,8 @@ The system window has the following size limits: [0, 2560] in width and [0, 2560
The new width and height you set must meet the limits. The new width and height you set must meet the limits.
This operation is not supported in a window in full-screen mode.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters** **Parameters**
...@@ -1683,6 +1689,8 @@ The system window has the following size limits: [0, 2560] in width and [0, 2560 ...@@ -1683,6 +1689,8 @@ The system window has the following size limits: [0, 2560] in width and [0, 2560
The new width and height you set must meet the limits. The new width and height you set must meet the limits.
This operation is not supported in a window in full-screen mode.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters** **Parameters**
...@@ -3721,6 +3729,41 @@ try { ...@@ -3721,6 +3729,41 @@ try {
### snapshot<sup>9+</sup> ### snapshot<sup>9+</sup>
snapshot(callback: AsyncCallback&lt;image.PixelMap&gt;): void
Captures this window. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | --------- | ----------------------------------- |
| callback | AsyncCallback&lt;[image.PixelMap](js-apis-image.md#pixelmap7)&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the error codes, see [Window Error Codes](../errorcodes/errorcode-window.md).
| ID | Error Message |
| ------- | ------------------------------ |
| 1300002 | This window state is abnormal. |
**Example**
```js
windowClass.snapshot((err, pixelMap) => {
if (err.code) {
console.error('Failed to snapshot window. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in snapshotting window. Pixel bytes number: ' + pixelMap.getPixelBytesNumber());
pixelMap.release(); // Release the memory in time after the PixelMap is used.
});
```
### snapshot<sup>9+</sup>
snapshot(): Promise&lt;image.PixelMap&gt; snapshot(): Promise&lt;image.PixelMap&gt;
Captures this window. This API uses a promise to return the result. Captures this window. This API uses a promise to return the result.
...@@ -4041,6 +4084,7 @@ try { ...@@ -4041,6 +4084,7 @@ try {
} catch (exception) { } catch (exception) {
console.error('Failed to set backdrop blur. Cause: ' + JSON.stringify(exception)); console.error('Failed to set backdrop blur. Cause: ' + JSON.stringify(exception));
} }
``` ```
### setBackdropBlurStyle<sup>9+</sup> ### setBackdropBlurStyle<sup>9+</sup>
...@@ -4282,6 +4326,8 @@ moveTo(x: number, y: number, callback: AsyncCallback&lt;void&gt;): void ...@@ -4282,6 +4326,8 @@ moveTo(x: number, y: number, callback: AsyncCallback&lt;void&gt;): void
Moves this window. This API uses an asynchronous callback to return the result. Moves this window. This API uses an asynchronous callback to return the result.
This operation is not supported in a window in full-screen mode.
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [moveWindowTo()](#movewindowto9) instead. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [moveWindowTo()](#movewindowto9) instead.
...@@ -4315,6 +4361,8 @@ moveTo(x: number, y: number): Promise&lt;void&gt; ...@@ -4315,6 +4361,8 @@ moveTo(x: number, y: number): Promise&lt;void&gt;
Moves this window. This API uses a promise to return the result. Moves this window. This API uses a promise to return the result.
This operation is not supported in a window in full-screen mode.
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [moveWindowTo()](#movewindowto9-1) instead. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [moveWindowTo()](#movewindowto9-1) instead.
...@@ -4358,6 +4406,8 @@ The system window has the following size limits: [0, 2560] in width and [0, 2560 ...@@ -4358,6 +4406,8 @@ The system window has the following size limits: [0, 2560] in width and [0, 2560
The new width and height you set must meet the limits. The new width and height you set must meet the limits.
This operation is not supported in a window in full-screen mode.
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [resize()](#resize9) instead. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [resize()](#resize9) instead.
...@@ -4397,6 +4447,8 @@ The system window has the following size limits: [0, 2560] in width and [0, 2560 ...@@ -4397,6 +4447,8 @@ The system window has the following size limits: [0, 2560] in width and [0, 2560
The new width and height you set must meet the limits. The new width and height you set must meet the limits.
This operation is not supported in a window in full-screen mode.
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [resize()](#resize9-1) instead. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [resize()](#resize9-1) instead.
...@@ -5864,12 +5916,12 @@ Describes the lifecycle of a window stage. ...@@ -5864,12 +5916,12 @@ Describes the lifecycle of a window stage.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Value | Description | | Name | Value | Description |
| ---------- | ----- | ---------------------------------------------- | | -------- | ----- | ---------------------------------------------- |
| FOREGROUND | 1 | The window stage is running in the foreground. | | SHOWN | 1 | The window stage is running in the foreground. |
| ACTIVE | 2 | The window stage gains focus. | | ACTIVE | 2 | The window stage gains focus. |
| INACTIVE | 3 | The window stage loses focus. | | INACTIVE | 3 | The window stage loses focus. |
| BACKGROUND | 4 | The window stage is running in the background. | | HIDDEN | 4 | The window stage is running in the background. |
## WindowStage<sup>9+</sup> ## WindowStage<sup>9+</sup>
...@@ -5905,9 +5957,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -5905,9 +5957,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
let windowClass = null; let windowClass = null;
...@@ -5952,9 +6006,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -5952,9 +6006,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
let windowClass = null; let windowClass = null;
...@@ -5998,9 +6054,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -5998,9 +6054,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
try { try {
...@@ -6042,9 +6100,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6042,9 +6100,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
let windowClass = null; let windowClass = null;
...@@ -6100,9 +6160,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6100,9 +6160,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
let windowClass = null; let windowClass = null;
...@@ -6149,9 +6211,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6149,9 +6211,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
let windowClass = null; let windowClass = null;
...@@ -6195,9 +6259,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6195,9 +6259,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
let windowClass = null; let windowClass = null;
...@@ -6243,9 +6309,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6243,9 +6309,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
storage : LocalStorage storage : LocalStorage
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
this.storage = new LocalStorage(); this.storage = new LocalStorage();
...@@ -6302,9 +6370,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6302,9 +6370,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
storage : LocalStorage storage : LocalStorage
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
this.storage = new LocalStorage(); this.storage = new LocalStorage();
...@@ -6354,9 +6424,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6354,9 +6424,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
try { try {
...@@ -6404,9 +6476,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6404,9 +6476,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
try { try {
...@@ -6452,9 +6526,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6452,9 +6526,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
try { try {
...@@ -6492,9 +6568,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6492,9 +6568,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('disableWindowDecor'); console.log('disableWindowDecor');
windowStage.disableWindowDecor(); windowStage.disableWindowDecor();
...@@ -6533,9 +6611,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ...@@ -6533,9 +6611,11 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
export default class EntryAbility extends UIAbility {
// ...
class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
try { try {
...@@ -6659,6 +6739,7 @@ controller.animationForShown = (context : window.TransitionContext) => { ...@@ -6659,6 +6739,7 @@ controller.animationForShown = (context : window.TransitionContext) => {
); );
console.info('complete transition end'); console.info('complete transition end');
}; };
``` ```
### animationForHidden<sup>9+</sup> ### animationForHidden<sup>9+</sup>
...@@ -6705,5 +6786,4 @@ controller.animationForHidden = (context : window.TransitionContext) => { ...@@ -6705,5 +6786,4 @@ controller.animationForHidden = (context : window.TransitionContext) => {
) )
console.info('complete transition end'); console.info('complete transition end');
}; };
``` ```
\ No newline at end of file
# Window Animation Management # @ohos.animation.windowAnimationManager (Window Animation Management)
The **WindowAnimationManager** module provides APIs to listen for application start/exit events and window minimization/maximization events and associate animations with these events. The **WindowAnimationManager** module provides APIs to listen for application start/exit events and window minimization/maximization events and associate animations with these events.
> **NOTE** > **NOTE**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册