提交 8892fd4d 编写于 作者: G Gloria

Update docs against 17748+18092+17886

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 66c44a8d
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
- ExtensionAbility Component - ExtensionAbility Component
- [ExtensionAbility Component Overview](extensionability-overview.md) - [ExtensionAbility Component Overview](extensionability-overview.md)
- [ServiceExtensionAbility](serviceextensionability.md) - [ServiceExtensionAbility](serviceextensionability.md)
- [DataShareExtensionAbility (for System Applications Only)](datashareextensionability.md)
- [AccessibilityExtensionAbility](accessibilityextensionability.md) - [AccessibilityExtensionAbility](accessibilityextensionability.md)
- [EnterpriseAdminExtensionAbility](enterprise-extensionAbility.md) - [EnterpriseAdminExtensionAbility](enterprise-extensionAbility.md)
- [InputMethodExtensionAbility](inputmethodextentionability.md) - [InputMethodExtensionAbility](inputmethodextentionability.md)
...@@ -37,9 +36,9 @@ ...@@ -37,9 +36,9 @@
- [Applying Custom Drawing in the Widget](arkts-ui-widget-page-custom-drawing.md) - [Applying Custom Drawing in the Widget](arkts-ui-widget-page-custom-drawing.md)
- Widget Event Development - Widget Event Development
- [Widget Event Capability Overview](arkts-ui-widget-event-overview.md) - [Widget Event Capability Overview](arkts-ui-widget-event-overview.md)
- [Redirecting to a Specified Page Through the Router Event](arkts-ui-widget-event-router.md)
- [Updating Widget Content Through FormExtensionAbility](arkts-ui-widget-event-formextensionability.md) - [Updating Widget Content Through FormExtensionAbility](arkts-ui-widget-event-formextensionability.md)
- [Updating Widget Content Through UIAbility](arkts-ui-widget-event-uiability.md) - [Updating Widget Content Through UIAbility](arkts-ui-widget-event-uiability.md)
- [Redirecting to a Specified Page Through the Router Event](arkts-ui-widget-event-router.md)
- Widget Data Interaction - Widget Data Interaction
- [Widget Data Interaction Overview](arkts-ui-widget-interaction-overview.md) - [Widget Data Interaction Overview](arkts-ui-widget-interaction-overview.md)
- [Configuring a Widget to Update Periodically](arkts-ui-widget-update-by-time.md) - [Configuring a Widget to Update Periodically](arkts-ui-widget-update-by-time.md)
...@@ -61,8 +60,9 @@ ...@@ -61,8 +60,9 @@
- [Continuation Overview](inter-device-interaction-hop-overview.md) - [Continuation Overview](inter-device-interaction-hop-overview.md)
- [Cross-Device Migration (for System Applications Only)](hop-cross-device-migration.md) - [Cross-Device Migration (for System Applications Only)](hop-cross-device-migration.md)
- [Multi-device Collaboration (for System Applications Only)](hop-multi-device-collaboration.md) - [Multi-device Collaboration (for System Applications Only)](hop-multi-device-collaboration.md)
- IPC - [Subscribing to System Environment Variable Changes](subscribe-system-environment-variable-changes.md)
- [Process Model](process-model-stage.md) - Process Model
- [Process Model Overview](process-model-stage.md)
- Common Events - Common Events
- [Introduction to Common Events](common-event-overview.md) - [Introduction to Common Events](common-event-overview.md)
- Common Event Subscription - Common Event Subscription
...@@ -72,14 +72,16 @@ ...@@ -72,14 +72,16 @@
- [Unsubscribing from Common Events](common-event-unsubscription.md) - [Unsubscribing from Common Events](common-event-unsubscription.md)
- [Publishing Common Events](common-event-publish.md) - [Publishing Common Events](common-event-publish.md)
- [Background Services](background-services.md) - [Background Services](background-services.md)
- Inter-Thread Communication - Thread Model
- [Thread Model](thread-model-stage.md) - [Thread Model Overview](thread-model-stage.md)
- [Using Emitter for Inter-Thread Communication](itc-with-emitter.md) - [Using Emitter for Inter-Thread Communication](itc-with-emitter.md)
- [Using Worker for Inter-Thread Communication](itc-with-worker.md) - [Using Worker for Inter-Thread Communication](itc-with-worker.md)
- Mission Management - Mission Management
- [Mission Management Scenarios](mission-management-overview.md) - [Mission Management Scenarios](mission-management-overview.md)
- [Mission Management and Launch Type](mission-management-launch-type.md) - [Mission Management and Launch Type](mission-management-launch-type.md)
- [Page Stack and MissionList](page-mission-stack.md) - [Page Stack and MissionList](page-mission-stack.md)
- [Setting the Icon and Name of a Mission Snapshot](mission-set-icon-name-for-task-snapshot.md)
- [Application Configuration File (Stage Model)](config-file-stage.md)
- FA Model Development - FA Model Development
- [FA Model Development Overview](fa-model-development-overview.md) - [FA Model Development Overview](fa-model-development-overview.md)
- FA Mode Application Components - FA Mode Application Components
...@@ -116,12 +118,12 @@ ...@@ -116,12 +118,12 @@
- [Context](application-context-fa.md) - [Context](application-context-fa.md)
- [Want](want-fa.md) - [Want](want-fa.md)
- [Component Startup Rules](component-startup-rules-fa.md) - [Component Startup Rules](component-startup-rules-fa.md)
- IPC - Process Model
- [Process Model](process-model-fa.md) - [Process Model Overview](process-model-fa.md)
- [Common Events](common-event-fa.md) - [Common Events](common-event-fa.md)
- [Background Services](rpc.md) - [Background Services](rpc.md)
- Inter-Thread Communication - Thread Model
- [Thread Model](thread-model-fa.md) - [Thread Model Overview](thread-model-fa.md)
- [Inter-Thread Communication](itc-fa-overview.md) - [Inter-Thread Communication](itc-fa-overview.md)
- [Mission Management](mission-management-fa.md) - [Mission Management](mission-management-fa.md)
- Development of Component Interaction Between the FA Model and Stage Model - Development of Component Interaction Between the FA Model and Stage Model
......
# Application Configuration File (Stage Model)
The application configuration file contains information about the application configuration, application components, and permissions, as well as custom information. The information will be provided for the compiler, application market, and operating system in the build, distribution, and running phases.
The application project code developed based on the stage model contains one **app.json5** file and one or more **module.json5** files. For details about common configuration items, see [Application- or Component-Level Configuration (Stage Model)](application-component-configuration-stage.md). For details about the two files, see [Application Configuration File Overview (Stage Model)](../quick-start/application-configuration-file-overview-stage.md).
...@@ -11,13 +11,13 @@ The following describes how the mission list manager manages the UIAbility insta ...@@ -11,13 +11,13 @@ The following describes how the mission list manager manages the UIAbility insta
![mission-and-singleton](figures/mission-and-singleton.png) ![mission-and-singleton](figures/mission-and-singleton.png)
- **multiton**: Each time **startAbility()** is called, a **UIAbility** instance is created in the application process. - **multiton**: Each time [startAbility()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability) is called, a UIAbility instance is created in the application process.
**Figure 2** Missions and multiton mode **Figure 2** Missions and multiton mode
![mission-and-multiton](figures/mission-and-standard.png) ![mission-and-multiton](figures/mission-and-multiton.png)
- **specified**: The ([onAcceptWant()](../reference/apis/js-apis-app-ability-abilityStage.md#abilitystageonacceptwant)) method of [AbilityStage](abilitystage.md) determines whether to create an instance. - **specified**: The ([onAcceptWant()](../reference/apis/js-apis-app-ability-abilityStage.md#abilitystageonacceptwant)) method of [AbilityStage](abilitystage.md) determines whether to create a UIAbility instance.
**Figure 3** Missions and specified mode **Figure 3** Missions and specified mode
...@@ -33,4 +33,3 @@ Every mission retains a snapshot of the UIAbility instance. After the UIAbility ...@@ -33,4 +33,3 @@ Every mission retains a snapshot of the UIAbility instance. After the UIAbility
> **NOTE** > **NOTE**
> >
> The **specified** mode is supported in the stage model only. > The **specified** mode is supported in the stage model only.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
Before getting started with the development of mission management, be familiar with the following concepts related to mission management: Before getting started with the development of mission management, be familiar with the following concepts related to mission management:
- AbilityRecord: minimum unit for the system service to manage a UIAbility instance. It corresponds to a UIAbility component instance of an application. - AbilityRecord: minimum unit for the system service to manage a UIAbility instance. It corresponds to a UIAbility component instance of an application. A maximum of 512 UIAbility instances can be managed on the system service side.
- MissionRecord: minimum unit for mission management. One MissionRecord has only one AbilityRecord. In other words, a UIAbility component instance corresponds to a mission. - MissionRecord: minimum unit for mission management. One MissionRecord has only one AbilityRecord. In other words, a UIAbility component instance corresponds to a mission.
...@@ -13,7 +13,6 @@ Before getting started with the development of mission management, be familiar w ...@@ -13,7 +13,6 @@ Before getting started with the development of mission management, be familiar w
- MissionListManager: system mission management module that maintains all the MissionLists and is consistent with the list in **Recents**. - MissionListManager: system mission management module that maintains all the MissionLists and is consistent with the list in **Recents**.
**Figure 1** Mission management **Figure 1** Mission management
![mission-list-manager](figures/mission-list-manager.png) ![mission-list-manager](figures/mission-list-manager.png)
...@@ -29,18 +28,16 @@ Missions are managed by system applications (such as home screen), rather than t ...@@ -29,18 +28,16 @@ Missions are managed by system applications (such as home screen), rather than t
- Switch a mission to the foreground. - Switch a mission to the foreground.
A UIAbility instance corresponds to an independent mission. Therefore, when an application calls **startAbility()** to start a UIAbility, a mission is created. A UIAbility instance corresponds to an independent mission. Therefore, when an application calls [startAbility()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability) to start a UIAbility, a mission is created.
To call [missionManager](../reference/apis/js-apis-application-missionManager.md) to manage missions, the home screen application must request the **ohos.permission.MANAGE_MISSIONS** permission. For details about the configuration, see [Declaring Permissions in the Configuration File](../security/accesstoken-guidelines.md#declaring-permissions-in-the-configuration-file).
1. To call [missionManager](../reference/apis/js-apis-application-missionManager.md) to manage missions, the home screen application must request the **ohos.permission.MANAGE_MISSIONS** permission. For details about the configuration, see [Declaring Permissions in the Configuration File](../security/accesstoken-guidelines.md#declaring-permissions-in-the-configuration-file).
You can use **missionManager** to manage missions, for example, listening for mission changes, obtaining mission information or snapshots, and clearing, locking, or unlocking missions. The sample code is as follows: 2. You can use **missionManager** to manage missions, for example, listening for mission changes, obtaining mission information or snapshots, and clearing, locking, or unlocking missions.
```ts ```ts
import missionManager from '@ohos.app.ability.missionManager' import missionManager from '@ohos.app.ability.missionManager'
let listener = { let listener = {
// Listen for mission creation. // Listen for mission creation.
onMissionCreated: function (mission) { onMissionCreated: function (mission) {
console.info("--------onMissionCreated-------") console.info("--------onMissionCreated-------")
...@@ -69,62 +66,64 @@ let listener = { ...@@ -69,62 +66,64 @@ let listener = {
onMissionClosed: function (mission) { onMissionClosed: function (mission) {
console.info("--------onMissionClosed-------") console.info("--------onMissionClosed-------")
} }
}; };
// 1. Register a mission change listener. // 1. Register a mission change listener.
let listenerId = missionManager.on('mission', listener); let listenerId = missionManager.on('mission', listener);
// 2. Obtain the latest 20 missions in the system. // 2. Obtain the latest 20 missions in the system.
missionManager.getMissionInfos("", 20, (error, missions) => { missionManager.getMissionInfos("", 20, (error, missions) => {
console.info("getMissionInfos is called, error.code = " + error.code); console.info("getMissionInfos is called, error.code = " + error.code);
console.info("size = " + missions.length); console.info("size = " + missions.length);
console.info("missions = " + JSON.stringify(missions)); console.info("missions = " + JSON.stringify(missions));
}); });
// 3. Obtain the detailed information about a mission. // 3. Obtain the detailed information about a mission.
let missionId = 11; // The mission ID 11 is only an example. let missionId = 11; // The mission ID 11 is only an example.
let mission = missionManager.getMissionInfo("", missionId).catch(function (err) { let mission = missionManager.getMissionInfo("", missionId).catch(function (err) {
console.info(err); console.info(err);
}); });
// 4. Obtain the mission snapshot. // 4. Obtain the mission snapshot.
missionManager.getMissionSnapShot("", missionId, (error, snapshot) => { missionManager.getMissionSnapShot("", missionId, (error, snapshot) => {
console.info("getMissionSnapShot is called, error.code = " + error.code); console.info("getMissionSnapShot is called, error.code = " + error.code);
console.info("bundleName = " + snapshot.ability.bundleName); console.info("bundleName = " + snapshot.ability.bundleName);
}) })
// 5. Obtain the low-resolution mission snapshot. // 5. Obtain the low-resolution mission snapshot.
missionManager.getLowResolutionMissionSnapShot("", missionId, (error, snapshot) => { missionManager.getLowResolutionMissionSnapShot("", missionId, (error, snapshot) => {
console.info("getLowResolutionMissionSnapShot is called, error.code = " + error.code); console.info("getLowResolutionMissionSnapShot is called, error.code = " + error.code);
console.info("bundleName = " + snapshot.ability.bundleName); console.info("bundleName = " + snapshot.ability.bundleName);
}) })
// 6. Lock or unlock the mission. // 6. Lock or unlock the mission.
missionManager.lockMission(missionId).then(() => { missionManager.lockMission(missionId).then(() => {
console.info("lockMission is called "); console.info("lockMission is called ");
}); });
missionManager.unlockMission(missionId).then(() => { missionManager.unlockMission(missionId).then(() => {
console.info("unlockMission is called "); console.info("unlockMission is called ");
}); });
// 7. Switch the mission to the foreground. // 7. Switch the mission to the foreground.
missionManager.moveMissionToFront(missionId).then(() => { missionManager.moveMissionToFront(missionId).then(() => {
console.info("moveMissionToFront is called "); console.info("moveMissionToFront is called ");
}); });
// 8. Clear a single mission. // 8. Clear a single mission.
missionManager.clearMission(missionId).then(() => { missionManager.clearMission(missionId).then(() => {
console.info("clearMission is called "); console.info("clearMission is called ");
}); });
// 9. Clear all missions. // 9. Clear all missions.
missionManager.clearAllMissions().catch(function (err) { missionManager.clearAllMissions().catch(function (err) {
console.info(err); console.info(err);
}); });
// 10. Deregister the mission change listener. // 10. Deregister the mission change listener.
missionManager.off('mission', listenerId, (error) => { missionManager.off('mission', listenerId, (error) => {
console.info("unregisterMissionListener"); console.info("unregisterMissionListener");
}) })
``` ```
# Setting the Icon and Name of a Mission Snapshot
Setting a unique icon and name for each mission snapshot of an application helps you better manage the missions and functions of the application.
By default, the **icon** and **label** fields in the [abilities tag](../quick-start/module-configuration-file.md#abilities) of the [module.json5 file](../quick-start/module-configuration-file.md) are used to set the icon and label.
Figure 1 Mission snapshot of a UIAbility
![](figures/mission-list-recent.png)
You can also use [UIAbilityContext.setMissionIcon()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissionicon) and [UIAbilityContext.setMissionLabel()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissionlabel) to customize the icon and name for a mission snapshot. For example, for a UIAbility instance in multiton mode, you can configure the icon and name for each mission snapshot based on different functions.
This document describes the following operations:
- [Setting a Mission Snapshot Icon (for System Applications Only)](#setting-a-mission-snapshot-icon-for-system-applications-only)
- [Setting a Mission Snapshot Name](#setting-a-mission-snapshot-name)
## Setting a Mission Snapshot Icon (for System Applications Only)
Call [UIAbilityContext.setMissionIcon()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissionicon) to set the icon of a mission snapshot. The icon is an object of the [PixelMap](../reference/apis/js-apis-image.md#pixelmap7) type. For details about how to obtain the context, see [Obtaining the Context of UIAbility](uiability-usage.md#obtaining-the-context-of-uiability).
```ts
let imagePixelMap: PixelMap = undefined; // Obtain the PixelMap information.
this.context.setMissionIcon(imagePixelMap, (err) => {
console.error(`setMissionLabel failed, code is ${err.code}, message is ${err.message}`);
})
```
The display effect is shown below.
Figure 2 Mission snapshot icon
![](figures/mission-set-task-snapshot-icon.png)
## Setting a Mission Snapshot Name
Call [UIAbilityContext.setMissionLabel()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissionlabel) to set the name of a mission snapshot.
```ts
this.context.setMissionLabel('test').then(() => {
console.info('setMissionLabel succeeded.');
}).catch((err) => {
console.error(`setMissionLabel failed, code is ${err.code}, message is ${err.message}`);
});
```
The display effect is shown below.
Figure 3 Mission snapshot name
![](figures/mission-set-task-snapshot-label.png)
# Process Model (FA Model) # Process Model Overview (FA Model)
The OpenHarmony process model is shown below. The OpenHarmony process model is shown below.
......
# Process Model (Stage Model) # Process Model Overview (Stage Model)
The OpenHarmony process model is shown below. The OpenHarmony process model is shown below.
......
# Subscribing to System Environment Variable Changes
System environment variables are system settings (for example, the system language or screen direction) of a device that may change during the running of an application.
By subscribing to the changes of system environment variables, the application can detect the changes in a timely manner and process the changes accordingly, providing better user experience. For example, when the system language changes, the application can display the UI in the new language; when the user rotates the device to landscape or portrait mode, the application can re-arrange the UI to adapt to the new screen orientation and size.
The system environment variable changes are usually triggered by options in **Settings** or icons in **Control Panel**. For details about the system environment variables that support subscription, see [Configuration](../reference/apis/js-apis-app-ability-configuration.md).
In OpenHarmony, you can subscribe to system environment variable changes in the following ways:
- [Using ApplicationContext for Subscription](#using-applicationcontext-for-subscription)
- [Using AbilityStage for Subscription](#using-abilitystage-for-subscription)
- [Using UIAbility for Subscription](#using-uiability-for-subscription)
- [Using ExtensionAbility for Subscription](#using-extensionability-for-subscription)
## Using ApplicationContext for Subscription
[ApplicationContext](../reference/apis/js-apis-inner-application-applicationContext.md) provides an API for registering a callback function to subscribe to the system environment variable changes. It also provides an API for deregistration so you can release related resources when they are no longer needed.
1. Call **ApplicationContext.on(type: 'environment', callback: EnvironmentCallback)** to subscribe to changes in system environment variables. The code snippet below is used to subscribe to system language changes on a page.
```ts
import common from '@ohos.app.ability.common';
@Entry
@Component
struct Index {
private context = getContext(this) as common.UIAbilityContext;
private callbackId: number; // ID of the subscription for system environment variable changes.
subscribeConfigurationUpdate() {
let systemLanguage: string = this.context.config.language; // Obtain the system language in use.
// 1. Obtain an ApplicationContext object.
let applicationContext = this.context.getApplicationContext();
// 2. Subscribe to system environment variable changes through ApplicationContext.
let environmentCallback = {
onConfigurationUpdated(newConfig) {
console.info(`onConfigurationUpdated systemLanguage is ${systemLanguage}, newConfig: ${JSON.stringify(newConfig)}`);
if (this.systemLanguage !== newConfig.language) {
console.info(`systemLanguage from ${systemLanguage} changed to ${newConfig.language}`);
systemLanguage = newConfig.language; // Save the new system language as the system language in use, which will be used for comparison.
}
},
onMemoryLevel(level) {
console.info(`onMemoryLevel level: ${level}`);
}
}
this.callbackId = applicationContext.on('environment', environmentCallback);
}
// Page display.
build() {
// ...
}
}
```
2. Call **ApplicationContext.off(type: 'environment', callbackId: number)** to release the resources.
```ts
import common from '@ohos.app.ability.common';
@Entry
@Component
struct Index {
private context = getContext(this) as common.UIAbilityContext;
private callbackId: number; // ID of the subscription for system environment variable changes.
unsubscribeConfigurationUpdate() {
let applicationContext = this.context.getApplicationContext();
applicationContext.off('environment', this.callbackId);
}
// Page display.
build() {
// ...
}
}
```
## Using AbilityStage for Subscription
The AbilityStage component provides the [AbilityStage.onConfigurationUpdate()](../reference/apis/js-apis-app-ability-abilityStage.md#abilitystageonconfigurationupdate) callback for subscribing to system environment variable changes. This callback is invoked when a system environment variable changes. In this callback, the latest system environment configuration is obtained through the [Configuration](../reference/apis/js-apis-app-ability-configuration.md) object.
> **NOTE**
>
> - AbilityStage is not automatically generated in the default project of DevEco Studio. For details about how to create an AbilityStage file, see [AbilityStage Component Container](abilitystage.md).
> - The callback used to subscribe to system environment variable changes has the same lifecycle as the [AbilityStage](../reference/apis/js-apis-app-ability-abilityStage.md) instance and will be destroyed when the instance is destroyed.
The code snippet below uses the [AbilityStage.onConfigurationUpdate()](../reference/apis/js-apis-app-ability-abilityStage.md#abilitystageonconfigurationupdate) callback to subscribe to the system language changes.
```ts
import AbilityStage from '@ohos.app.ability.AbilityStage';
let systemLanguage: string; // System language in use.
export default class MyAbilityStage extends AbilityStage {
onCreate() {
systemLanguage = this.context.config.language; // Obtain the system language in use when the AbilityStage instance is loaded for the first time.
console.info(`systemLanguage is ${systemLanguage} `);
}
onConfigurationUpdate(newConfig) {
console.info(`onConfigurationUpdated systemLanguage is ${systemLanguage}, newConfig: ${JSON.stringify(newConfig)}`);
if (systemLanguage !== newConfig.language) {
console.info(`systemLanguage from ${systemLanguage} changed to ${newConfig.language}`);
systemLanguage = newConfig.language; // Save the new system language as the system language in use, which will be used for comparison.
}
}
}
```
## Using UIAbility for Subscription
The UIAbility component provides the **UIAbility.onConfigurationUpdate()** callback for subscribing to system environment variable changes. This callback is invoked when a system environment variable changes. In this callback, the latest system environment configuration is obtained through the [Configuration](../reference/apis/js-apis-app-ability-configuration.md) object, without restarting the UIAbility.
> **NOTE**
>
> The callback used to subscribe to system environment variable changes has the same lifecycle as the UIAbility instance and will be destroyed when the instance is destroyed.
The code snippet below uses the **onConfigurationUpdate()** callback to subscribe to the system language changes.
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
let systemLanguage: string; // System language in use.
export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) {
systemLanguage = this.context.config.language; // Obtain the system language in use when the UIAbility instance is loaded for the first time.
console.info(`systemLanguage is ${systemLanguage} `);
}
onConfigurationUpdate(newConfig) {
console.info(`onConfigurationUpdated systemLanguage is ${systemLanguage}, newConfig: ${JSON.stringify(newConfig)}`);
if (systemLanguage !== newConfig.language) {
console.info(`systemLanguage from ${systemLanguage} changed to ${newConfig.language}`);
systemLanguage = newConfig.language; // Save the new system language as the system language in use, which will be used for comparison.
}
}
// ...
}
```
## Using ExtensionAbility for Subscription
The ExtensionAbility component provides the **onConfigurationUpdate()** callback for subscribing system environment variable changes. This callback is invoked when a system environment variable changes. In this callback, the latest system environment configuration is obtained through the [Configuration](../reference/apis/js-apis-app-ability-configuration.md) object.
> **NOTE**
>
> The callback used to subscribe to system environment variable changes has the same lifecycle as the ExtensionAbility instance and will be destroyed when the instance is destroyed.
The code snippet below uses FormExtensionAbility as an example to describe how to use the **onConfigurationUpdate()** callback to subscribe to system environment variable changes.
```ts
import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility';
export default class EntryFormAbility extends FormExtensionAbility {
onConfigurationUpdate(newConfig) {
console.info(`newConfig is ${JSON.stringify(newConfig)}`);
}
// ...
}
```
# Thread Model (FA Model) # Thread Model Overview (FA Model)
There are three types of threads in the FA model: There are three types of threads in the FA model:
......
# Thread Model (Stage Model) # Thread Model Overview (Stage Model)
For an OpenHarmony application, each process has a main thread to provide the following functionalities: For an OpenHarmony application, each process has a main thread to provide the following functionalities:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册