[Context](../reference/apis/js-apis-inner-application-context.md) is the context of an object in an application. It provides basic information about the application, for example, **resourceManager**, **applicationInfo**, **dir** (application development path), and **area** (encrypted area). It also provides basic methods such as **createBundleContext()** and **getApplicationContext()**. The UIAbility component and ExtensionAbility derived class components have their own **Context** classes, for example, the base class **Context**, **ApplicationContext**, **AbilityStageContext**, **UIAbilityContext**, **ExtensionContext**, and **ServiceExtensionContext**.
[Context](../reference/apis/js-apis-inner-application-context.md) is the context of an object in an application. It provides basic information about the application, for example, **resourceManager**, **applicationInfo**, **dir** (application development path), and **area** (encrypted level). It also provides basic methods such as **createBundleContext()** and **getApplicationContext()**. The UIAbility component and ExtensionAbility derived class components have their own **Context** classes, for example, the base class **Context**, **ApplicationContext**, **AbilityStageContext**, **UIAbilityContext**, **ExtensionContext**, and **ServiceExtensionContext**.
- The figure below illustrates the inheritance relationship of contexts.
...
...
@@ -71,7 +71,7 @@ This topic describes how to use the context in the following scenarios:
-[Obtaining the Application Development Path](#obtaining-the-application-development-path)
-[Obtaining and Modifying Encryption Areas](#obtaining-and-modifying-encryption-areas)
-[Obtaining and Modifying Encryption Levels](#obtaining-and-modifying-encryption-levels)
-[Creating Context of Another Application or Module](#creating-context-of-another-application-or-module)
-[Subscribing to UIAbility Lifecycle Changes in a Process](#subscribing-to-uiability-lifecycle-changes-in-a-process)
> The sample code obtains the sandbox path of the application development path. The absolute path can be obtained by running the **find / -name <fileName>** command in the hdc shell after file creation or modification.
### Obtaining and Modifying Encryption Areas
### Obtaining and Modifying Encryption Levels
Encrypting application files enhances data security by preventing files from unauthorized access. Different application files require different levels of protection. For private files, such as alarms and wallpapers, the application must place them in the device-level encryption area (EL1) to ensure that they can be accessed before the user enters the password. For sensitive files, such as personal privacy data, the application must place them in the user-level encryption area (EL2).
Encrypting application files enhances data security by preventing files from unauthorized access. Different application files require different levels of protection. For private files, such as alarms and wallpapers, the application must place them in a directory with the device-level encryption (EL1) to ensure that they can be accessed before the user enters the password. For sensitive files, such as personal privacy data, the application must place them in a directory with the user-level encryption (EL2).
In practice, you need to select a proper encrypted area based on scenario-specific requirements to protect application data security. The proper use of EL1 and the EL2 can efficiently improve the security.
In practice, you need to select a proper encrypted level based on scenario-specific requirements to protect application data security. The proper use of EL1 and the EL2 can efficiently improve the security.
> **NOTE**
>
> - AreaMode.EL1: device-level encryption area, which is accessible after the device is powered on.
> - AreaMode.EL1: device-level encryption. Directories with this encryption level are accessible after the device is powered on.
>
> - AreaMode.EL2: user-level encryption area, which is accessible only after the device is powered on and the password is entered (for the first time).
> - AreaMode.EL2: user-level encryption. Directories with this encryption level are accessible only after the device is powered on and the password is entered (for the first time).
You can obtain and set the encryption area by reading and writing the [area attribute in Context](../reference/apis/js-apis-inner-application-context.md).
You can obtain and set the encryption level by reading and writing the [area attribute in Context](../reference/apis/js-apis-inner-application-context.md).
Kills a process by bundle name and account ID. This API uses a promise to return the result.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) and ohos.permission.CLEAN_BACKGROUND_PROCESSES
> **NOTE**
>
> The **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** permission is not required when **accountId** specifies the current user.
**Required permissions**: ohos.permission.CLEAN_BACKGROUND_PROCESSES and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**System API**: This is a system API and cannot be called by third-party applications.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) and ohos.permission.CLEAN_BACKGROUND_PROCESSES
> 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.
| language | string | Yes| Yes| Language of the application, for example, **zh**.|
| colorMode | [ColorMode](js-apis-app-ability-configurationConstant.md#configurationconstantcolormode) | Yes| Yes| Color mode. The default value is **COLOR_MODE_LIGHT**. The options are as follows:<br>- **COLOR_MODE_NOT_SET**: The color mode is not set.<br>- **COLOR_MODE_LIGHT**: light mode.<br>- **COLOR_MODE_DARK**: dark mode.|
| bundleVersionCode | number | Yes | Internal version number of the application. |
| bundleVersionName | string | Yes | Version number of the application that is shown to users. |
| quickFixVersionCode | number | Yes | Version code of the quick fix patch package. |
...
...
@@ -57,19 +57,19 @@ Applies a quick fix patch. This API uses an asynchronous callback to return the
**Parameters**
| Parameter| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| hapModuleQuickFixFiles | Array\<string> | Yes| Quick fix patch files, each of which must contain a valid file path.|
| callback | AsyncCallback\<void> | Yes| Callback used to return the result.|
| Parameter| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| hapModuleQuickFixFiles | Array\<string> | Yes| Quick fix patch files, each of which must contain a valid file path.|
| callback | AsyncCallback\<void> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 18500002 | Copy file failed, maybe not exist or inaccessible. |
| 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. |
| 18500008 | Internal error. |
If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9). The table below lists the possible error codes and messages.
If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEventManager-definitions.md#common_event_quick_fix_apply_result-9). The table below lists the possible error codes and messages.
| ID| Error Message|
| ------- | -------- |
...
...
@@ -118,24 +118,24 @@ Applies a quick fix patch. This API uses a promise to return the result.
**Parameters**
| Parameter| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| hapModuleQuickFixFiles | Array\<string> | Yes| Quick fix patch files, each of which must contain a valid file path.|
| Parameter| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| hapModuleQuickFixFiles | Array\<string> | Yes| Quick fix patch files, each of which must contain a valid file path.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise\<void> | Promise used to return the result.|
| Type| Description|
| -------- | -------- |
| Promise\<void> | Promise used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 18500002 | Copy file failed, maybe not exist or inaccessible. |
| 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. |
| 18500008 | Internal error. |
If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9). The table below lists the possible error codes and messages.
If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEventManager-definitions.md#common_event_quick_fix_apply_result-9). The table below lists the possible error codes and messages.
| ID| Error Message|
| ------- | -------- |
...
...
@@ -178,16 +178,16 @@ Obtains the quick fix information of the application. This API uses an asynchron
**Parameters**
| Parameter| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes|Bundle name. |
| callback | AsyncCallback\<[ApplicationQuickFixInfo](#applicationquickfixinfo)> | Yes| Callback used to return the quick fix information.|
| Parameter| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes|Bundle name. |
| callback | AsyncCallback\<[ApplicationQuickFixInfo](#applicationquickfixinfo)> | Yes| Callback used to return the quick fix information.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 18500001 | The bundle is not exist. |
| 18500001 | The specified bundleName is invalid. |
| 18500008 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
...
...
@@ -225,21 +225,21 @@ Obtains the quick fix information of the application. This API uses a promise to
**Parameters**
| Parameter| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.|
| Parameter| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name. |
**Return value**
| Type| Description|
| -------- | -------- |
| Promise\<[ApplicationQuickFixInfo](#applicationquickfixinfo)> | Promise used to return the quick fix information.|
| Type| Description|
| -------- | -------- |
| Promise\<[ApplicationQuickFixInfo](#applicationquickfixinfo)> | Promise used to return the quick fix information.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 18500001 | The bundle is not exist. |
| 18500001 | The specified bundleName is invalid. |
| 18500008 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
@@ -26,7 +26,7 @@ import Want from '@ohos.app.ability.Want';
| entities | 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**.|
| 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.callerBundleName**: bundle name 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.<br>- **component.startup.newRules**: whether to enable the new control rule.<br>- **moduleName**: module name of the caller. No matter what this field is set to, the correct module name will be sent to the peer.<br>- **ohos.dlp.params.sandbox**: available only for DLP files.|
| 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.callerBundleName**: bundle name 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.<br>- **component.startup.newRules**: whether to enable the new control rule.<br>- **moduleName**: module name of the caller. No matter what this field is set to, the correct module name will be sent to the peer.<br>- **ohos.dlp.params.sandbox**: available only for DLP files.<br>- **ability.params.backToOtherMissionStack**: whether to support redirection back across mission stacks.|
| [flags](js-apis-ability-wantConstant.md#wantconstantflags) | number | No| How the **Want** object will be handled. By default, a number is passed in.<br>For example, **wantConstant.Flags.FLAG_ABILITY_CONTINUATION** specifies whether to start the ability in cross-device migration scenarios.|
**Example**
...
...
@@ -34,7 +34,8 @@ import Want from '@ohos.app.ability.Want';
- Basic usage: called in a UIAbility object, as shown in the example below. For details about how to obtain the context, see [Obtaining the Context of UIAbility](../../application-models/uiability-usage.md#obtaining-the-context-of-uiability).
'deviceId':'',// An empty deviceId indicates the local device.
'bundleName':'com.example.myapplication',
...
...
@@ -52,7 +53,8 @@ import Want from '@ohos.app.ability.Want';
* String
```ts
let context = ...; // UIAbilityContext
import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = {
bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility',
...
...
@@ -67,7 +69,8 @@ import Want from '@ohos.app.ability.Want';
```
* Number
```ts
let context = ...; // UIAbilityContext
import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = {
bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility',
...
...
@@ -83,7 +86,8 @@ import Want from '@ohos.app.ability.Want';
```
* Boolean
```ts
let context = ...; // UIAbilityContext
import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = {
bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility',
...
...
@@ -98,7 +102,8 @@ import Want from '@ohos.app.ability.Want';
```
* Object
```ts
let context = ...; // UIAbilityContext
import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = {
bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility',
...
...
@@ -118,7 +123,8 @@ import Want from '@ohos.app.ability.Want';
```
* Array
```ts
let context = ...; // UIAbilityContext
import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = {
bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility',
...
...
@@ -138,7 +144,8 @@ import Want from '@ohos.app.ability.Want';
```ts
import fs from '@ohos.file.fs';
let context = ...; // UIAbilityContext
import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let fd;
try {
...
...
@@ -160,3 +167,33 @@ import Want from '@ohos.app.ability.Want';
console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
});
```
- Usage of **parameters**: The following uses **ability.params.backToOtherMissionStack** as an example. When a ServiceExtensionAbility starts a UIAbility, redirection back across mission stacks is supported.
```ts
// (1) UIAbility1 starts a ServiceExtensionAbility.
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = {
bundleName: 'com.example.myapplication1',
abilityName: 'ServiceExtensionAbility',
};
context.startAbility(want, (err) => {
console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
});
// (2) The ServiceExtensionAbility starts UIAbility2, carrying **"ability.params.backToOtherMissionStack": true** during the startup.
let context = ...; // ServiceExtensionContext
let want = {
bundleName: 'com.example.myapplication2',
abilityName: 'MainAbility',
parameters: {
"ability.params.backToOtherMissionStack": true,
},
};
context.startAbility(want, (err) => {
console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
});
```
Note: In the preceding example, when the ServiceExtensionAbility starts UIAbility2, **"ability.params.backToOtherMissionStack": true** is carried, indicating that redirection back across mission stacks is supported. Therefore, when you press **Back** on the page of UIAbility 2, the page of UIAbility1 page is displayed. However, if **ability.params.backToOtherMissionStack** is not carried or if **"ability.params.backToOtherMissionStack": false** is carried, the page of UIAbility1 is not displayed when you press **Back** on the page of UIAbility 2.
| DLP_PARAMS_SANDBOX |ohos.dlp.params.sandbox | Action of obtaining the sandbox flag.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| DLP_PARAMS_BUNDLE_NAME |ohos.dlp.params.bundleName |Action of obtaining the DLP bundle name.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| DLP_PARAMS_MODULE_NAME |ohos.dlp.params.moduleName |Action of obtaining the DLP module name.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| DLP_PARAMS_ABILITY_NAME |ohos.dlp.params.abilityName |Action of obtaining the DLP ability name.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| DLP_PARAMS_INDEX |ohos.dlp.params.index |Action of obtaining the DLP index.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| ABILITY_BACK_TO_OTHER_MISSION_STACK |ability.params.backToOtherMissionStack |Action of returning the ability to the mission stack. |
| DLP_PARAMS_SANDBOX | ohos.dlp.params.sandbox | Action of obtaining the sandbox flag.<br>**System API**: This is a system API and cannot be called by third-party applications.|
| DLP_PARAMS_BUNDLE_NAME | ohos.dlp.params.bundleName | Action of obtaining the DLP bundle name.<br>**System API**: This is a system API and cannot be called by third-party applications.|
| DLP_PARAMS_MODULE_NAME | ohos.dlp.params.moduleName | Action of obtaining the DLP module name.<br>**System API**: This is a system API and cannot be called by third-party applications.|
| DLP_PARAMS_ABILITY_NAME | ohos.dlp.params.abilityName | Action of obtaining the DLP ability name.<br>**System API**: This is a system API and cannot be called by third-party applications.|
| DLP_PARAMS_INDEX | ohos.dlp.params.index | Action of obtaining the DLP index.<br>**System API**: This is a system API and cannot be called by third-party applications.|
| ABILITY_BACK_TO_OTHER_MISSION_STACK | ability.params.backToOtherMissionStack | Whether to support redirection back across mission stacks.<br>**System API**: This is a system API and cannot be called by third-party applications.|
## wantConstant.Flags
...
...
@@ -37,4 +37,4 @@ Enumerates the action constants of the **Want** object. **action** specifies the
| bundleName | string | Yes | No | Name of the bundle to which the widget belongs. |
| moduleName | string | Yes | No | Name of the module to which the widget belongs. |
| bundleName | string | Yes | No | Name of the bundle to which the widget belongs. |
| moduleName | string | Yes | No | Name of the module to which the widget belongs. |
| abilityName | string | Yes | No | Name of the ability to which the widget belongs. |
| name | string | Yes | No | Widget name. |
| description | string | Yes | No | Description of the widget. |
...
...
@@ -30,10 +32,10 @@ Describes widget information.
| colorMode | [ColorMode](#colormode) | Yes | No | Color mode of the widget. |
| isDefault | boolean | Yes | No | Whether the widget is the default one. |
| updateEnabled | boolean | Yes | No | Whether the widget is updatable. |
| formVisibleNotify | boolean | Yes | No | Whether to send a notification when the widget is visible. |
| formVisibleNotify | string | Yes | No | Whether to send a notification when the widget is visible. |
| scheduledUpdateTime | string | Yes | No | Time when the widget was updated. |
| formConfigAbility | string | Yes | No | Configuration ability of the widget, that is, the ability corresponding to the option in the selection box displayed when the widget is long pressed. |
| updateDuration | number | Yes | No | Update period of the widget.|
| updateDuration | string | Yes | No | Update period of the widget.|
| defaultDimension | number | Yes | No | Default dimension of the widget. |
| supportDimensions | Array<number> | Yes | No | Dimensions supported by the widget. For details, see [FormDimension](#formdimension). |
| customizeData | {[key: string]: [value: string]} | Yes | No | Custom data of the widget. |
...
...
@@ -99,8 +101,8 @@ Enumerates the widget parameters.
| moduleName | string | Optional. Only the information about the widget whose **moduleName** is the same as the provided value is returned.<br>If this parameter is not set, **moduleName** is not used for filtering. |
| Name | Description |
| ----------- | ------------ |
| moduleName | Only the information about the widget whose **moduleName** is the same as the provided value is returned.|
## VisibilityType
...
...
@@ -136,5 +138,6 @@ Enumerates the visibility types of the widget.
| Name | Value | Description |
| ----------- | ---- | ------------ |
| UNKNOWN | 0 | The visibility type of the widget is unknown.|
The **FormProvider** module provides APIs related to the widget provider. You can use the APIs to update a widget, set the next refresh time for a widget, obtain widget information, and request a widget release.
...
...
@@ -39,7 +39,8 @@ Sets the next refresh time for a widget. This API uses an asynchronous callback
| 16501001 | The ID of the form to be operated does not exist. |
| 16501002 | The number of forms exceeds upper bound. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).||
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example**
...
...
@@ -91,7 +92,8 @@ Sets the next refresh time for a widget. This API uses a promise to return the r
| 16501001 | The ID of the form to be operated does not exist. |
| 16501002 | The number of forms exceeds upper bound. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).||
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example**
...
...
@@ -135,12 +137,14 @@ Updates a widget. This API uses an asynchronous callback to return the result.
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).||
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
| want | [Want](js-apis-application-want.md) | Yes | Request used for publishing. The following fields must be included:<br>Information about the target widget.<br>**abilityName**: ability of the target widget.<br>**parameters**:<br>'ohos.extra.param.key.form_dimension'<br>'ohos.extra.param.key.form_name'<br>'ohos.extra.param.key.module_name' |
| formBindingData.FormBindingData | [FormBindingData](js-apis-app-form-formBindingData.md#formbindingdata)| Yes | Data used for creating the widget.|
| formBindingData.FormBindingData | [FormBindingData](js-apis-app-form-formBindingData.md#formbindingdata) | Yes | Data used for creating the widget.|
| callback | AsyncCallback<string> | Yes| Callback used to return the widget ID.|
**Error codes**
...
...
@@ -370,13 +379,15 @@ Requests to publish a widget carrying data to the widget host. This API uses an
| 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).||
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
| want | [Want](js-apis-application-want.md) | Yes | Request used for publishing. The following fields must be included:<br>Information about the target widget.<br>**abilityName**: ability of the target widget.<br>**parameters**:<br>'ohos.extra.param.key.form_dimension'<br>'ohos.extra.param.key.form_name'<br>'ohos.extra.param.key.module_name' |
| formBindingData.FormBindingData | [FormBindingData](js-apis-app-form-formBindingData.md#formbindingdata) | No | Data used for creating the widget. By default, no value is passed, indicating that no data is provided. |
| formBindingData.FormBindingData | [FormBindingData](js-apis-app-form-formBindingData.md#formbindingdata) | No | Data used for creating the widget. |
**Return value**
...
...
@@ -483,12 +495,13 @@ Requests to publish a widget to the widget host. This API uses a promise to retu
| 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).||
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example**
```ts
varwant={
letwant={
abilityName:'FormAbility',
parameters:{
'ohos.extra.param.key.form_dimension':2,
...
...
@@ -531,7 +544,8 @@ Checks whether a widget can be published to the widget host. This API uses an as
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).||
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
**Example**
...
...
@@ -593,7 +607,8 @@ Checks whether a widget can be published to the widget host. This API uses a pro
| 202 | The application is not a system application. |
| 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).||
For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).
Obtains information about the applications that are running in the foreground. This API uses an asynchronous callback to return the result. The application information is defined by [AppStateData](js-apis-inner-application-appStateData.md).
@@ -397,10 +401,10 @@ Kills a process by bundle name and account ID. This API uses a promise to return
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
**System API**: This is a system API and cannot be called by third-party applications.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES
**Required permissions**: ohos.permission.CLEAN_BACKGROUND_PROCESSES and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the result.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the result.|
The **Configuration** module defines environment change information. **Configuration** is an interface definition and is used only for field declaration.
> **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.
> This module is deprecated since API version 9. You are advised to use [@ohos.app.ability.Configuration](js-apis-app-ability-configuration.md) instead.
The **ContinueCallback** module defines the callback function that indicates the result of mission continuation. For details about mission continuation, see [continueMission](js-apis-distributedMissionManager.md#distributedmissionmanagercontinuemission).
> **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 **ContinueDeviceInfo** module defines the parameters required for initiating mission continuation. For details about mission continuation, see [continueMission](js-apis-distributedMissionManager.md#distributedmissionmanagercontinuemission).
> **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 **MissionCallback** module defines the callbacks invoked after synchronization starts. These callbacks can be used as input parameters in [registerMissionListener](js-apis-distributedMissionManager.md#distributedmissionmanagerregistermissionlistener).
> **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 **MissionParameter** module defines the parameters required for mission synchronization. It can be used an input parameter in [startSyncRemoteMissions](js-apis-distributedMissionManager.md#distributedmissionmanagerstartsyncremotemissions).
> **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.