You need to sign in or sign up before continuing.
未验证 提交 273d6a5d 编写于 作者: O openharmony_ci 提交者: Gitee

!5673 翻译完成:4632 Fix sample code question of ability

Merge pull request !5673 from wusongqing/TR4632
# MissionSnapshot # MissionSnapshot
> **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.
...@@ -10,7 +9,7 @@ Provides the snapshot of a mission. ...@@ -10,7 +9,7 @@ Provides the snapshot of a mission.
## Modules to Import ## Modules to Import
``` ```
import abilitymanager from '@ohos.application.abilityManager'; import missionManager from '@ohos.application.missionManager'
import ElementName from '@ohos.bundle'; import ElementName from '@ohos.bundle';
import image from '@ohos.multimedia.image'; import image from '@ohos.multimedia.image';
``` ```
......
# Context # Context
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br> > **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. >
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module can be used only in the stage model.
Provides the context for running code, including **applicationInfo** and **resourceManager**. Provides the context for running code, including **applicationInfo** and **resourceManager**.
...@@ -19,43 +20,43 @@ You must extend **AbilityContext** to implement this module. ...@@ -19,43 +20,43 @@ You must extend **AbilityContext** to implement this module.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| resourceManager | ResourceManager | Yes| No| **ResourceManager** object.| | resourceManager | ResourceManager | Yes| No| **ResourceManager** object.|
| applicationInfo | ApplicationInfo | Yes| No| Information about the application.| | applicationInfo | ApplicationInfo | Yes| No| Information about the application.|
| cacheDir | string | Yes| No| Cache directory of the application on the internal storage.| | cacheDir | string | Yes| No| Cache directory of the application on the internal storage.|
| tempDir | string | Yes| No| Temporary file directory of the application.| | tempDir | string | Yes| No| Temporary file directory of the application.|
| filesDir | string | Yes| No| File directory of the application on the internal storage.| | filesDir | string | Yes| No| File directory of the application on the internal storage.|
| databaseDir | string | Yes| No| Storage directory of local data.| | databaseDir | string | Yes| No| Storage directory of local data.|
| storageDir | string | Yes| No| Storage directory of lightweight data.| | storageDir | string | Yes| No| Storage directory of lightweight data.|
| bundleCodeDir | string | Yes| No| Application installation path.| | bundleCodeDir | string | Yes| No| Application installation path.|
| distributedFilesDir | string | Yes| No| Storage directory of distributed application data files.| | distributedFilesDir | string | Yes| No| Storage directory of distributed application data files.|
| eventHub | [EventHub](js-apis-eventhub.md) | Yes| No| Event hub information.| | eventHub | [EventHub](js-apis-eventhub.md) | Yes| No| Event hub information.|
| area | [AreaMode](#areamode) | Yes| Yes| Area in which the file to be access is located.| | area | [AreaMode](#areamode) | Yes| Yes| Area in which the file to be access is located.|
## Context.createBundleContext ## Context.createBundleContext
createBundleContext(bundleName: string): Context; createBundleContext(bundleName: string): Context;
Creates an application context. Creates a context for a given application.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Application bundle name.| | bundleName | string | Yes| Application bundle name.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Context | Context of the application created.| | Context | Context created.|
**Example** **Example**
```js ```js
import AbilityContext from '@ohos.application.Ability' import AbilityContext from '@ohos.application.Ability'
class MainAbility extends AbilityContext { class MainAbility extends AbilityContext {
...@@ -68,6 +69,76 @@ Creates an application context. ...@@ -68,6 +69,76 @@ Creates an application context.
``` ```
## Context.createModuleContext
createModuleContext(moduleName: string): Context;
Creates a context for a given HAP.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| moduleName | string | Yes| HAP name in the application.|
**Return value**
| Type| Description|
| -------- | -------- |
| Context | Context created.|
**Example**
```js
import AbilityContext from '@ohos.application.Ability'
class MainAbility extends AbilityContext {
onWindowStageCreate(windowStage) {
let moduleName = "module";
let context = this.context.createModuleContext(moduleName);
}
}
```
## Context.createModuleContext
createModuleContext(bundleName: string, moduleName: string): Context;
Creates a context for a given HAP in an application.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Application bundle name.|
| moduleName | string | Yes| HAP name in the application.|
**Return value**
| Type| Description|
| -------- | -------- |
| Context | Context created.|
**Example**
```js
import AbilityContext from '@ohos.application.Ability'
class MainAbility extends AbilityContext {
onWindowStageCreate(windowStage) {
let bundleName = "com.example.bundle";
let moduleName = "module";
let context = this.context.createModuleContext(bundleName, moduleName);
}
}
```
## Context.getApplicationContext ## Context.getApplicationContext
getApplicationContext(): ApplicationContext; getApplicationContext(): ApplicationContext;
...@@ -83,7 +154,7 @@ Obtains the context of this application. ...@@ -83,7 +154,7 @@ Obtains the context of this application.
| ApplicationContext | Current application context.| | ApplicationContext | Current application context.|
**Example** **Example**
```js ```js
// This part is mandatory. // This part is mandatory.
let applicationContext = this.context.getApplicationContext(); let applicationContext = this.context.getApplicationContext();
......
# EventHub # EventHub
> **NOTE**<br/> > **NOTE**
> The initial APIs of this module are supported since API 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. >
> The initial APIs of this module are supported since API 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module can be used only in the stage model.
Implements event subscription, unsubscription, and triggering. Implements event subscription, unsubscription, and triggering.
...@@ -14,11 +15,8 @@ import Ability from '@ohos.application.Ability' ...@@ -14,11 +15,8 @@ import Ability from '@ohos.application.Ability'
## Usage ## Usage
​Before using any APIs in the **EventHub**, you must obtain an **EventHub** instance through the member variable **context** of the **Ability** instance. ​Before using any APIs in the **EventHub**, you must obtain an **EventHub** instance through the member variable **context** of the **Ability** instance.
```js ```js
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
# ExtensionRunningInfo # ExtensionRunningInfo
> **NOTE**<br/> > **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Provides extension running information. Provides extension running information.
## Modules to Import ## Modules to Import
...@@ -14,11 +14,8 @@ import abilitymanager from '@ohos.application.abilityManager'; ...@@ -14,11 +14,8 @@ import abilitymanager from '@ohos.application.abilityManager';
## Usage ## Usage
The extension running information is obtained through an **abilityManager** instance. The extension running information is obtained through an **abilityManager** instance.
```js ```js
import abilitymanager from '@ohos.application.abilityManager'; import abilitymanager from '@ohos.application.abilityManager';
let upperLimit=1 let upperLimit=1
......
# FeatureAbility Module (JavaScript) # FeatureAbility
> **NOTE**<br/> > **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 APIs of this module can be used only in the FA model.
## Constraints ## Constraints
...@@ -923,7 +925,7 @@ Enumerates operation types of the Data ability. ...@@ -923,7 +925,7 @@ Enumerates operation types of the Data ability.
**System capability**: SystemCapability.Ability.AbilityBase **System capability**: SystemCapability.Ability.AbilityBase
| Name | Value | Description | | Name | Value | Description |
| ------------------------------------ | ---------- | ---------------------------------------- | | ------------------------------------ | ---------- | ---------------------------------------- |
| FLAG_AUTH_READ_URI_PERMISSION | 0x00000001 | Indicates the permission to read the URI. | | FLAG_AUTH_READ_URI_PERMISSION | 0x00000001 | Indicates the permission to read the URI. |
| FLAG_AUTH_WRITE_URI_PERMISSION | 0x00000002 | Indicates the permission to write the URI. | | FLAG_AUTH_WRITE_URI_PERMISSION | 0x00000002 | Indicates the permission to write the URI. |
......
# FormBindingData # FormBindingData
> ![icon-note.gif](public_sys-resources/icon-note.gif) **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.
## Modules to Import ## Modules to Import
...@@ -38,12 +39,20 @@ Creates a **FormBindingData** object. ...@@ -38,12 +39,20 @@ Creates a **FormBindingData** object.
**Example** **Example**
```js ```js
let fd = fileio.openSync(path); import featureAbility from '@ohos.ability.featureAbility';
let obj = { import fileio from '@ohos.fileio';
"temperature": "21°", let context=featureAbility.getContext();
"formImages": {"image": fd} context.getOrCreateLocalDir((err,data)=>{
}; let path=data+"/xxx.jpg";
let formBindingDataObj = formBindingData.createFormBindingData(obj); let fd = fileio.openSync(path);
let obj = {
"temperature": "21°",
"formImages": {"image": fd}
};
let formBindingDataObj = formBindingData.createFormBindingData(obj);
})
``` ```
## Attributes ## Attributes
......
# FormExtension # FormExtension
> **NOTE**<br/> > **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. >
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module can be used only in the stage model.
Provides **FormExtension** APIs. Provides **FormExtension** APIs.
......
# FormExtensionContext # FormExtensionContext
> **NOTE**<br/> > **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. >
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module can be used only in the stage model.
Implements the context that provides the capabilities and APIs of **FormExtension**. This class is inherited from **ExtensionContext**. Implements the context that provides the capabilities and APIs of **FormExtension**. This class is inherited from **ExtensionContext**.
...@@ -21,11 +23,11 @@ Updates a widget. This method uses a callback to return the result. ...@@ -21,11 +23,11 @@ Updates a widget. This method uses a callback to return the result.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- | ------------------------------------------------------------ | ---- | -------------------------------------- | | --------------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
| formId | string | Yes | ID of the widget that requests to be updated. | | formId | string | Yes | ID of the widget that requests to be updated. |
| formBindingData | [formBindingData.FormBindingData](js-apis-formbindingdata.md#formbindingdata) | Yes | New data of the widget. | | formBindingData | [formBindingData.FormBindingData](js-apis-formbindingdata.md#formbindingdata) | Yes | New data of the widget. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result indicating whether the method is successfully called.| | callback | AsyncCallback\<void> | Yes | Callback used to return the result indicating whether the method is successfully called.|
**Example** **Example**
...@@ -54,16 +56,16 @@ Updates a widget. This method uses a promise to return the result. ...@@ -54,16 +56,16 @@ Updates a widget. This method uses a promise to return the result.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- | ------------------------------------------------------------ | ---- | ------------------ | | --------------- | ------------------------------------------------------------ | ---- | ------------------ |
| formId | string | Yes | ID of the widget that requests to be updated.| | formId | string | Yes | ID of the widget that requests to be updated.|
| formBindingData | [formBindingData.FormBindingData](js-apis-formbindingdata.md#formbindingdata) | Yes | New data of the widget. | | formBindingData | [formBindingData.FormBindingData](js-apis-formbindingdata.md#formbindingdata) | Yes | New data of the widget. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| -------------- | --------------------------------- | | -------------- | --------------------------------- |
| Promise\<void> | Promise returned with the result indicating whether the method is successfully called.| | Promise\<void> | Promise returned with the result indicating whether the method is successfully called.|
**Example** **Example**
......
# FormHost # FormHost
> **NOTE**<br> > **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.
Provides APIs related to the widget host. Provides APIs related to the widget host.
......
# missionManager # missionManager
> **NOTE**<br/> > **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.
missionManager provides APIs to lock, unlock, and clear missions, and switch a mission to the foreground. missionManager provides APIs to lock, unlock, and clear missions, and switch a mission to the foreground.
...@@ -26,15 +27,15 @@ Registers a listener to observe the mission status. ...@@ -26,15 +27,15 @@ Registers a listener to observe the mission status.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| listener | MissionListener | Yes| Listener to register.| | listener | MissionListener | Yes| Listener to register.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| number | Returns the unique index of the mission status listener, which is created by the system and allocated when the listener is registered.| | number | Returns the unique index of the mission status listener, which is created by the system and allocated when the listener is registered.|
**Example** **Example**
...@@ -62,10 +63,10 @@ Deregisters a mission status listener. This API uses an asynchronous callback to ...@@ -62,10 +63,10 @@ Deregisters a mission status listener. This API uses an asynchronous callback to
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.| | listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.|
| 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**
...@@ -96,15 +97,15 @@ Deregisters a mission status listener. This API uses a promise to return the res ...@@ -96,15 +97,15 @@ Deregisters a mission status listener. This API uses a promise to return the res
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.| | listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -135,11 +136,11 @@ Obtains the information about a given mission. This API uses an asynchronous cal ...@@ -135,11 +136,11 @@ Obtains the information about a given mission. This API uses an asynchronous cal
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| | deviceId | string | Yes| Device ID. It is a null string by default for the local device.|
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
| callback | AsyncCallback&lt;[MissionInfo](#missioninfo)&gt; | Yes| Callback used to return the mission information obtained.| | callback | AsyncCallback&lt;[MissionInfo](#missioninfo)&gt; | Yes| Callback used to return the mission information obtained.|
**Example** **Example**
...@@ -169,16 +170,16 @@ Obtains the information about a given mission. This API uses a promise to return ...@@ -169,16 +170,16 @@ Obtains the information about a given mission. This API uses a promise to return
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| | deviceId | string | Yes| Device ID. It is a null string by default for the local device.|
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[MissionInfo](#missioninfo)&gt; | Promise used to return the mission information obtained.| | Promise&lt;[MissionInfo](#missioninfo)&gt; | Promise used to return the mission information obtained.|
**Example** **Example**
...@@ -201,11 +202,11 @@ Obtains information about all missions. This API uses an asynchronous callback t ...@@ -201,11 +202,11 @@ Obtains information about all missions. This API uses an asynchronous callback t
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| | deviceId | string | Yes| Device ID. It is a null string by default for the local device.|
| numMax | number | Yes| Maximum number of missions whose information can be obtained.| | numMax | number | Yes| Maximum number of missions whose information can be obtained.|
| callback | AsyncCallback&lt;Array&lt;[MissionInfo](#missioninfo)&gt;&gt; | Yes| Callback used to return the array of mission information obtained.| | callback | AsyncCallback&lt;Array&lt;[MissionInfo](#missioninfo)&gt;&gt; | Yes| Callback used to return the array of mission information obtained.|
**Example** **Example**
...@@ -230,16 +231,16 @@ Obtains information about all missions. This API uses a promise to return the re ...@@ -230,16 +231,16 @@ Obtains information about all missions. This API uses a promise to return the re
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| | deviceId | string | Yes| Device ID. It is a null string by default for the local device.|
| numMax | number | Yes| Maximum number of missions whose information can be obtained.| | numMax | number | Yes| Maximum number of missions whose information can be obtained.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;Array&lt;[MissionInfo](#missioninfo)&gt;&gt; | Promise used to return the array of mission information obtained.| | Promise&lt;Array&lt;[MissionInfo](#missioninfo)&gt;&gt; | Promise used to return the array of mission information obtained.|
**Example** **Example**
...@@ -262,11 +263,11 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback ...@@ -262,11 +263,11 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| | deviceId | string | Yes| Device ID. It is a null string by default for the local device.|
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
| callback | AsyncCallback&lt;[MissionSnapshot](js-apis-application-MissionSnapshot.md)&gt; | Yes| Callback used to return the snapshot information obtained.| | callback | AsyncCallback&lt;[MissionSnapshot](js-apis-application-MissionSnapshot.md)&gt; | Yes| Callback used to return the snapshot information obtained.|
**Example** **Example**
...@@ -297,16 +298,16 @@ Obtains the snapshot of a given mission. This API uses a promise to return the r ...@@ -297,16 +298,16 @@ Obtains the snapshot of a given mission. This API uses a promise to return the r
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| | deviceId | string | Yes| Device ID. It is a null string by default for the local device.|
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[MissionSnapshot](js-apis-application-MissionSnapshot.md)&gt; | Promise used to return the snapshot information obtained.| | Promise&lt;[MissionSnapshot](js-apis-application-MissionSnapshot.md)&gt; | Promise used to return the snapshot information obtained.|
**Example** **Example**
...@@ -337,10 +338,10 @@ Locks a given mission. This API uses an asynchronous callback to return the resu ...@@ -337,10 +338,10 @@ Locks a given mission. This API uses an asynchronous callback to return the resu
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
| 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**
...@@ -370,15 +371,15 @@ Locks a given mission. This API uses a promise to return the result. ...@@ -370,15 +371,15 @@ Locks a given mission. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -441,15 +442,15 @@ Unlocks a given mission. This API uses a promise to return the result. ...@@ -441,15 +442,15 @@ Unlocks a given mission. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -483,10 +484,10 @@ Clears a given mission, regardless of whether it is locked. This API uses an asy ...@@ -483,10 +484,10 @@ Clears a given mission, regardless of whether it is locked. This API uses an asy
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
| 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**
...@@ -516,15 +517,15 @@ Clears a given mission, regardless of whether it is locked. This API uses a prom ...@@ -516,15 +517,15 @@ Clears a given mission, regardless of whether it is locked. This API uses a prom
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -574,9 +575,9 @@ Clears all unlocked missions. This API uses a promise to return the result. ...@@ -574,9 +575,9 @@ Clears all unlocked missions. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -598,10 +599,10 @@ Switches a given mission to the foreground. This API uses an asynchronous callba ...@@ -598,10 +599,10 @@ Switches a given mission to the foreground. This API uses an asynchronous callba
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
| 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**
...@@ -631,11 +632,11 @@ Switches a given mission to the foreground, with the startup parameters for the ...@@ -631,11 +632,11 @@ Switches a given mission to the foreground, with the startup parameters for the
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
| options | StartOptions | Yes| Startup parameters, which are used to specify the window mode and device ID for switching the mission to the foreground.| | options | StartOptions | Yes| Startup parameters, which are used to specify the window mode and device ID for switching the mission to the foreground.|
| 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**
...@@ -665,16 +666,16 @@ Switches a given mission to the foreground, with the startup parameters for the ...@@ -665,16 +666,16 @@ Switches a given mission to the foreground, with the startup parameters for the
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| missionId | number | Yes| Mission ID.| | missionId | number | Yes| Mission ID.|
| options | StartOptions | No| Startup parameters, which are used to specify the window mode and device ID for switching the mission to the foreground.| | options | StartOptions | No| Startup parameters, which are used to specify the window mode and device ID for switching the mission to the foreground.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -700,13 +701,13 @@ Describes the mission information. ...@@ -700,13 +701,13 @@ Describes the mission information.
**System capability**: SystemCapability.Ability.AbilityBase **System capability**: SystemCapability.Ability.AbilityBase
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| missionId | number | Yes| Yes| Mission ID.| | missionId | number | Yes| Yes| Mission ID.|
| runningState | number | Yes| Yes| Running state of the mission.| | runningState | number | Yes| Yes| Running state of the mission.|
| lockedState | boolean | Yes| Yes| Locked state of the mission.| | lockedState | boolean | Yes| Yes| Locked state of the mission.|
| timestamp | string | Yes| Yes| Latest time when the mission was created or updated.| | timestamp | string | Yes| Yes| Latest time when the mission was created or updated.|
| want | [Want](js-apis-application-Want.md) | Yes| Yes| **Want** information of the mission.| | want | [Want](js-apis-application-Want.md) | Yes| Yes| **Want** information of the mission.|
| label | string | Yes| Yes| Label of the mission.| | label | string | Yes| Yes| Label of the mission.|
| iconPath | string | Yes| Yes| Path of the mission icon.| | iconPath | string | Yes| Yes| Path of the mission icon.|
| continuable | boolean | Yes| Yes| Whether the mission can be continued on another device. | | continuable | boolean | Yes| Yes| Whether the mission can be continued on another device. |
# ProcessRunningInfo # ProcessRunningInfo
> **NOTE**<br> > **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.
Provides process running information. Provides process running information.
## Modules to Import ## Modules to Import
...@@ -14,11 +14,8 @@ import appManager from '@ohos.application.appManager' ...@@ -14,11 +14,8 @@ import appManager from '@ohos.application.appManager'
## Usage ## Usage
The process running information is obtained through an **appManager** instance. The process running information is obtained through an **appManager** instance.
```js ```js
import appManager from '@ohos.application.appManager'; import appManager from '@ohos.application.appManager';
appManager.getProcessRunningInfos((error,data) => { appManager.getProcessRunningInfos((error,data) => {
......
# uriPermissionManager # uriPermissionManager
> **NOTE**<br> > **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......
# WantAgent Module # WantAgent
>**NOTE** > **NOTE**
> >
>The initial APIs of this module are supported since API version 7. 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 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册