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

!18703 翻译完成:18404+17717+18085+17884 移除DataShareExtensionAbility+17717 修改应用模型任务管理描述

Merge pull request !18703 from wusongqing/TR18404
...@@ -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)
...@@ -62,8 +61,8 @@ ...@@ -62,8 +61,8 @@
- [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)
- [Subscribing to System Environment Variable Changes](subscribe-system-environment-variable-changes.md) - [Subscribing to System Environment Variable Changes](subscribe-system-environment-variable-changes.md)
- IPC - Process Model
- [Process Model](process-model-stage.md) - [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
...@@ -74,13 +73,13 @@ ...@@ -74,13 +73,13 @@
- [Publishing Common Events](common-event-publish.md) - [Publishing Common Events](common-event-publish.md)
- [Removing Sticky Common Events](common-event-remove-sticky.md) - [Removing Sticky Common Events](common-event-remove-sticky.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 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) - [Setting the Icon and Name of a Mission Snapshot](mission-set-icon-name-for-task-snapshot.md)
- [Application Configuration File](config-file-stage.md) - [Application Configuration File](config-file-stage.md)
...@@ -120,12 +119,12 @@ ...@@ -120,12 +119,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)
- [Application Configuration File](config-file-fa.md) - [Application Configuration File](config-file-fa.md)
......
# DataShareExtensionAbility (for System Applications Only)
DataShareExtensionAbility provides the data sharing capability. System applications can implement a DataShareExtensionAbility or access an existing DataShareExtensionAbility in the system. Third-party applications can only access an existing DataShareExtensionAbility. For details, see [Cross-Application Data Sharing Overview](../database/share-device-data-across-apps-overview.md).
# Mission Management and Launch Type # Mission and Launch Type
One UIAbility instance corresponds to one mission. The number of UIAbility instances is related to the UIAbility launch type, specified by **launchType**, which is configured in the **config.json** file in the FA model and the [module.json5](../quick-start/module-configuration-file.md) file in the stage model. One UIAbility instance corresponds to one mission. The number of UIAbility instances is related to the UIAbility launch type, specified by **launchType**, which is configured in the **config.json** file in the FA model and the [module.json5](../quick-start/module-configuration-file.md) file in the stage model.
...@@ -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()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability) 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-multiton.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
......
...@@ -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.
...@@ -30,42 +30,42 @@ Missions are managed by system applications (such as home screen), rather than t ...@@ -30,42 +30,42 @@ Missions are managed by system applications (such as home screen), rather than t
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. 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. 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-------")
}, },
// Listen for mission destruction. // Listen for mission destruction.
onMissionDestroyed: function (mission) { onMissionDestroyed: function (mission) {
console.info("--------onMissionDestroyed-------") console.info("--------onMissionDestroyed-------")
}, },
// Listen for mission snapshot changes. // Listen for mission snapshot changes.
onMissionSnapshotChanged: function (mission) { onMissionSnapshotChanged: function (mission) {
console.info("--------onMissionSnapshotChanged-------") console.info("--------onMissionSnapshotChanged-------")
}, },
// Listen for switching the mission to the foreground. // Listen for switching the mission to the foreground.
onMissionMovedToFront: function (mission) { onMissionMovedToFront: function (mission) {
console.info("--------onMissionMovedToFront-------") console.info("--------onMissionMovedToFront-------")
}, },
// Listen for mission icon changes. // Listen for mission icon changes.
onMissionIconUpdated: function (mission, icon) { onMissionIconUpdated: function (mission, icon) {
console.info("--------onMissionIconUpdated-------") console.info("--------onMissionIconUpdated-------")
}, },
// Listen for mission name changes. // Listen for mission name changes.
onMissionLabelUpdated: function (mission) { onMissionLabelUpdated: function (mission) {
console.info("--------onMissionLabelUpdated-------") console.info("--------onMissionLabelUpdated-------")
}, },
// Listen for mission closure events. // Listen for mission closure events.
onMissionClosed: function (mission) { onMissionClosed: function (mission) {
console.info("--------onMissionClosed-------") console.info("--------onMissionClosed-------")
} }
}; };
// 1. Register a mission change listener. // 1. Register a mission change listener.
...@@ -73,56 +73,56 @@ You can use **missionManager** to manage missions, for example, listening for mi ...@@ -73,56 +73,56 @@ You can use **missionManager** to manage missions, for example, listening for mi
// 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");
}) })
``` ```
......
# 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.
......
# 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:
- Main thread - Main thread
Manages other threads. Manages other threads.
- Ability thread - Ability thread
- One ability thread for each ability. - One ability thread for each ability.
- Distributes input events. - Distributes input events.
...@@ -19,10 +17,8 @@ Manages other threads. ...@@ -19,10 +17,8 @@ Manages other threads.
Performs time-consuming operations Performs time-consuming operations
Based on the OpenHarmony thread model, different services run on different threads. Service interaction requires inter-thread communication. Threads can communicate with each other in Emitter or Worker mode. Emitter is mainly used for event synchronization between threads, and Worker is mainly used to execute time-consuming tasks. Based on the OpenHarmony thread model, different services run on different threads. Service interaction requires inter-thread communication. Threads can communicate with each other in Emitter or Worker mode. Emitter is mainly used for event synchronization between threads, and Worker is mainly used to execute time-consuming tasks.
> **NOTE** > **NOTE**
> >
> The FA model provides an independent thread for each ability. Emitter is mainly used for event synchronization within the ability thread, between a pair of ability threads, or between the ability thread and worker thread. > The FA model provides an independent thread for each ability. Emitter is mainly used for event synchronization within the ability thread, between a pair of ability threads, or between the ability thread and worker thread.
# 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.
先完成此消息的编辑!
想要评论请 注册