“969d0adce0c7e8fca5bfeca9d7f8c185ee57500a”上不存在“...native/sun/git@gitcode.net:openanolis/dragonwell8_jdk.git”
提交 54218d5c 编写于 作者: 田雨 提交者: Gitee

Merge branch 'master' of gitee.com:openharmony/docs into master

Signed-off-by: N田雨 <tianyu55@huawei.com>
...@@ -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:
......
...@@ -12,7 +12,7 @@ You can use the related APIs to [share a file with another application](#sharing ...@@ -12,7 +12,7 @@ You can use the related APIs to [share a file with another application](#sharing
The file URIs are in the following format: The file URIs are in the following format:
file://&lt;bundleName&gt;/&lt;path&gt;/\#networkid=&lt;networkid&gt; file://&lt;bundleName&gt;/&lt;path&gt;
- **file**: indicates a file URI. - **file**: indicates a file URI.
...@@ -20,8 +20,6 @@ The file URIs are in the following format: ...@@ -20,8 +20,6 @@ The file URIs are in the following format:
- *path*: specifies the application sandbox path of the file. - *path*: specifies the application sandbox path of the file.
- *networkid* (optional): specifies the device to which the file belongs in a distributed file system. Leave this parameter unspecified if the file location does not need to be set.
## Sharing a File with Another Application ## Sharing a File with Another Application
Before sharing application files, you need to [obtain the application file path](../application-models/application-context-stage.md#obtaining-the-application-development-path). Before sharing application files, you need to [obtain the application file path](../application-models/application-context-stage.md#obtaining-the-application-development-path).
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
- [@ohos.app.form.FormExtensionAbility (FormExtensionAbility)](js-apis-app-form-formExtensionAbility.md) - [@ohos.app.form.FormExtensionAbility (FormExtensionAbility)](js-apis-app-form-formExtensionAbility.md)
- [@ohos.application.DataShareExtensionAbility (DataShare Extension Ability)](js-apis-application-dataShareExtensionAbility.md) - [@ohos.application.DataShareExtensionAbility (DataShare Extension Ability)](js-apis-application-dataShareExtensionAbility.md)
- [@ohos.application.StaticSubscriberExtensionAbility (StaticSubscriberExtensionAbility)](js-apis-application-staticSubscriberExtensionAbility.md) - [@ohos.application.StaticSubscriberExtensionAbility (StaticSubscriberExtensionAbility)](js-apis-application-staticSubscriberExtensionAbility.md)
- Stage Model (To Be Deprecated Soon)
- [@ohos.application.EnvironmentCallback (EnvironmentCallback)](js-apis-application-environmentCallback.md)
- FA Model - FA Model
- [@ohos.ability.ability (Ability)](js-apis-ability-ability.md) - [@ohos.ability.ability (Ability)](js-apis-ability-ability.md)
- [@ohos.ability.featureAbility (FeatureAbility)](js-apis-ability-featureAbility.md) - [@ohos.ability.featureAbility (FeatureAbility)](js-apis-ability-featureAbility.md)
...@@ -39,10 +37,12 @@ ...@@ -39,10 +37,12 @@
- [@ohos.app.ability.Want (Want)](js-apis-app-ability-want.md) - [@ohos.app.ability.Want (Want)](js-apis-app-ability-want.md)
- [@ohos.app.ability.wantAgent (WantAgent)](js-apis-app-ability-wantAgent.md) - [@ohos.app.ability.wantAgent (WantAgent)](js-apis-app-ability-wantAgent.md)
- [@ohos.app.ability.wantConstant (wantConstant)](js-apis-app-ability-wantConstant.md) - [@ohos.app.ability.wantConstant (wantConstant)](js-apis-app-ability-wantConstant.md)
- [@ohos.app.businessAbilityRouter (Business Ability Router)](js-apis-businessAbilityRouter.md)
- [@ohos.app.form.formBindingData (formBindingData)](js-apis-app-form-formBindingData.md) - [@ohos.app.form.formBindingData (formBindingData)](js-apis-app-form-formBindingData.md)
- [@ohos.app.form.formHost (FormHost)](js-apis-app-form-formHost.md) - [@ohos.app.form.formHost (FormHost)](js-apis-app-form-formHost.md)
- [@ohos.app.form.formInfo (FormInfo)](js-apis-app-form-formInfo.md) - [@ohos.app.form.formInfo (FormInfo)](js-apis-app-form-formInfo.md)
- [@ohos.app.form.formProvider (FormProvider)](js-apis-app-form-formProvider.md) - [@ohos.app.form.formProvider (FormProvider)](js-apis-app-form-formProvider.md)
- [@ohos.application.uriPermissionManager (URI Permission Management)](js-apis-uripermissionmanager.md)
- Both Models (To Be Deprecated Soon) - Both Models (To Be Deprecated Soon)
- [@ohos.ability.dataUriUtils (DataUriUtils)](js-apis-ability-dataUriUtils.md) - [@ohos.ability.dataUriUtils (DataUriUtils)](js-apis-ability-dataUriUtils.md)
- [@ohos.ability.errorCode (ErrorCode)](js-apis-ability-errorCode.md) - [@ohos.ability.errorCode (ErrorCode)](js-apis-ability-errorCode.md)
...@@ -139,7 +139,11 @@ ...@@ -139,7 +139,11 @@
- [NotificationSlot](js-apis-inner-notification-notificationSlot.md) - [NotificationSlot](js-apis-inner-notification-notificationSlot.md)
- [NotificationTemplate](js-apis-inner-notification-notificationTemplate.md) - [NotificationTemplate](js-apis-inner-notification-notificationTemplate.md)
- [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md) - [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md)
- Bundle Management - Common Events
- [Common Events of the Bundle Management Subsystem](common_event/commonEvent-bundleManager.md)
- [Common Events of the Notification Service](common_event/commonEvent-ans.md)
- [Common Events of the Telephony Subsystem](common_event/commonEvent-telephony.md)
- Bundle Management
- [@ohos.bundle.appControl (appControl)](js-apis-appControl.md) - [@ohos.bundle.appControl (appControl)](js-apis-appControl.md)
- [@ohos.bundle.bundleManager (bundleManager)](js-apis-bundleManager.md) - [@ohos.bundle.bundleManager (bundleManager)](js-apis-bundleManager.md)
- [@ohos.bundle.bundleMonitor (bundleMonitor)](js-apis-bundleMonitor.md) - [@ohos.bundle.bundleMonitor (bundleMonitor)](js-apis-bundleMonitor.md)
...@@ -148,6 +152,7 @@ ...@@ -148,6 +152,7 @@
- [@ohos.bundle.freeInstall (freeInstall)](js-apis-freeInstall.md) - [@ohos.bundle.freeInstall (freeInstall)](js-apis-freeInstall.md)
- [@ohos.bundle.installer (installer)](js-apis-installer.md) - [@ohos.bundle.installer (installer)](js-apis-installer.md)
- [@ohos.bundle.launcherBundleManager (launcherBundleManager)](js-apis-launcherBundleManager.md) - [@ohos.bundle.launcherBundleManager (launcherBundleManager)](js-apis-launcherBundleManager.md)
- [@ohos.bundle.overlay (overlay)](js-apis-overlay.md)
- [@ohos.zlib (Zip)](js-apis-zlib.md) - [@ohos.zlib (Zip)](js-apis-zlib.md)
- bundleManager - bundleManager
- [abilityInfo](js-apis-bundleManager-abilityInfo.md) - [abilityInfo](js-apis-bundleManager-abilityInfo.md)
...@@ -155,18 +160,22 @@ ...@@ -155,18 +160,22 @@
- [AppProvisionInfo](js-apis-bundleManager-AppProvisionInfo.md) - [AppProvisionInfo](js-apis-bundleManager-AppProvisionInfo.md)
- [bundleInfo](js-apis-bundleManager-bundleInfo.md) - [bundleInfo](js-apis-bundleManager-bundleInfo.md)
- [BundlePackInfo](js-apis-bundleManager-BundlePackInfo.md) - [BundlePackInfo](js-apis-bundleManager-BundlePackInfo.md)
- [BusinessAbilityInfo](js-apis-bundleManager-businessAbilityInfo.md)
- [dispatchInfo](js-apis-bundleManager-dispatchInfo.md) - [dispatchInfo](js-apis-bundleManager-dispatchInfo.md)
- [elementName](js-apis-bundleManager-elementName.md) - [elementName](js-apis-bundleManager-elementName.md)
- [extensionAbilityInfo](js-apis-bundleManager-extensionAbilityInfo.md) - [extensionAbilityInfo](js-apis-bundleManager-extensionAbilityInfo.md)
- [hapModuleInfo](js-apis-bundleManager-hapModuleInfo.md) - [hapModuleInfo](js-apis-bundleManager-hapModuleInfo.md)
- [launcherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo.md) - [launcherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo.md)
- [metadata](js-apis-bundleManager-metadata.md) - [metadata](js-apis-bundleManager-metadata.md)
- [OverlayModuleInfo](js-apis-bundleManager-overlayModuleInfo.md)
- [permissionDef](js-apis-bundleManager-permissionDef.md) - [permissionDef](js-apis-bundleManager-permissionDef.md)
- [remoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md) - [remoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md)
- [SharedBundleInfo](js-apis-bundleManager-sharedBundleInfo.md)
- [shortcutInfo](js-apis-bundleManager-shortcutInfo.md) - [shortcutInfo](js-apis-bundleManager-shortcutInfo.md)
- UI Page - UI Page
- [@ohos.animator (Animator)](js-apis-animator.md) - [@ohos.animator (Animator)](js-apis-animator.md)
- [@ohos.arkui.componentSnapshot (Component Snapshot)](js-apis-arkui-componentSnapshot.md)
- [@ohos.arkui.drawableDescriptor (DrawableDescriptor)](js-apis-arkui-drawableDescriptor.md) - [@ohos.arkui.drawableDescriptor (DrawableDescriptor)](js-apis-arkui-drawableDescriptor.md)
- [@ohos.curves (Interpolation Calculation)](js-apis-curve.md) - [@ohos.curves (Interpolation Calculation)](js-apis-curve.md)
- [@ohos.matrix4 (Matrix Transformation)](js-apis-matrix4.md) - [@ohos.matrix4 (Matrix Transformation)](js-apis-matrix4.md)
...@@ -264,7 +273,7 @@ ...@@ -264,7 +273,7 @@
- [@ohos.net.connection (Network Connection Management)](js-apis-net-connection.md) - [@ohos.net.connection (Network Connection Management)](js-apis-net-connection.md)
- [@ohos.net.ethernet (Ethernet Connection Management)](js-apis-net-ethernet.md) - [@ohos.net.ethernet (Ethernet Connection Management)](js-apis-net-ethernet.md)
- [@ohos.net.http (Data Request)](js-apis-http.md) - [@ohos.net.http (Data Request)](js-apis-http.md)
- [@ohos.net.policy (Network Policy Management)](js-apis-net-policy.md) - [@ohos.net.mdns (mDNS Management)](js-apis-net-mdns.md)
- [@ohos.net.sharing (Network Sharing)](js-apis-net-sharing.md) - [@ohos.net.sharing (Network Sharing)](js-apis-net-sharing.md)
- [@ohos.net.socket (Socket Connection)](js-apis-socket.md) - [@ohos.net.socket (Socket Connection)](js-apis-socket.md)
- [@ohos.net.webSocket (WebSocket Connection)](js-apis-webSocket.md) - [@ohos.net.webSocket (WebSocket Connection)](js-apis-webSocket.md)
...@@ -449,4 +458,4 @@ ...@@ -449,4 +458,4 @@
- [remoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md) - [remoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)
- [shortcutInfo](js-apis-bundle-ShortcutInfo.md) - [shortcutInfo](js-apis-bundle-ShortcutInfo.md)
- data/rdb - data/rdb
- [resultSet (Result Set)](js-apis-data-resultset.md) - [resultSet](js-apis-data-resultset.md)
\ No newline at end of file \ No newline at end of file
...@@ -18,7 +18,7 @@ import ability from '@ohos.ability.ability'; ...@@ -18,7 +18,7 @@ import ability from '@ohos.ability.ability';
| Name | Type | Description | | Name | Type | Description |
| ----------- | -------------------- | ------------------------------------------------------------ | | ----------- | -------------------- | ------------------------------------------------------------ |
| DataAbilityHelper | [DataAbilityHelper](js-apis-inner-ability-dataAbilityHelper.md) | Level-2 module **DataAbilityHelper**. | | DataAbilityHelper | [DataAbilityHelper](js-apis-inner-ability-dataAbilityHelper.md) | Level-2 module **DataAbilityHelper**. |
| PacMap | [PacMap](js-apis-inner-application-pacMap.md) | Level-2 module **PacMap**.| | PacMap | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap) | Level-2 module **PacMap**.|
| DataAbilityOperation | [DataAbilityOperation](js-apis-inner-ability-dataAbilityOperation.md) | Level-2 module **DataAbilityOperation**.| | DataAbilityOperation | [DataAbilityOperation](js-apis-inner-ability-dataAbilityOperation.md) | Level-2 module **DataAbilityOperation**.|
| DataAbilityResult | [DataAbilityResult](js-apis-inner-ability-dataAbilityResult.md) | Level-2 module **DataAbilityResult**.| | DataAbilityResult | [DataAbilityResult](js-apis-inner-ability-dataAbilityResult.md) | Level-2 module **DataAbilityResult**.|
| AbilityResult | [AbilityResult](js-apis-inner-ability-abilityResult.md) | Level-2 module **AbilityResult**.| | AbilityResult | [AbilityResult](js-apis-inner-ability-abilityResult.md) | Level-2 module **AbilityResult**.|
......
# @ohos.app.ability.abilityDelegatorRegistry (AbilityDelegatorRegistry) # @ohos.app.ability.abilityDelegatorRegistry (AbilityDelegatorRegistry)
**AbilityDelegatorRegistry**, a module of the [Test Framework](../../ability-deprecated/ability-delegator.md), is used to obtain [AbilityDelegator](js-apis-inner-application-abilityDelegator.md) and [AbilityDelegatorArgs](js-apis-inner-application-abilityDelegatorArgs.md) objects. **AbilityDelegator** provides APIs for creating **AbilityMonitor** objects, which can be used to listen for ability lifecycle changes. **AbilityDelegatorArgs** provides APIs for obtaining test parameters. **AbilityDelegatorRegistry**, a module of the [arkXtest User Guide](../../application-test/arkxtest-guidelines.md), is used to obtain [AbilityDelegator](js-apis-inner-application-abilityDelegator.md) and [AbilityDelegatorArgs](js-apis-inner-application-abilityDelegatorArgs.md) objects. **AbilityDelegator** provides APIs for creating **AbilityMonitor** objects, which can be used to listen for ability lifecycle changes. **AbilityDelegatorArgs** provides APIs for obtaining test parameters.
> **NOTE** > **NOTE**
> >
......
...@@ -26,7 +26,7 @@ import common from '@ohos.app.ability.common'; ...@@ -26,7 +26,7 @@ import common from '@ohos.app.ability.common';
| FormExtensionContext | [FormExtensionContext](js-apis-inner-application-formExtensionContext.md) | Level-2 module **FormExtensionContext**.| | FormExtensionContext | [FormExtensionContext](js-apis-inner-application-formExtensionContext.md) | Level-2 module **FormExtensionContext**.|
| ServiceExtensionContext | [ServiceExtensionContext](js-apis-inner-application-serviceExtensionContext.md) | Level-2 module **ServiceExtensionContext**.| | ServiceExtensionContext | [ServiceExtensionContext](js-apis-inner-application-serviceExtensionContext.md) | Level-2 module **ServiceExtensionContext**.|
| EventHub | [EventHub](js-apis-inner-application-eventHub.md) | Level-2 module **EventHub**.| | EventHub | [EventHub](js-apis-inner-application-eventHub.md) | Level-2 module **EventHub**.|
| PacMap | [PacMap](js-apis-inner-application-pacMap.md) | Level-2 module **PacMap**.| | PacMap | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap) | Level-2 module **PacMap**.|
| AbilityResult | [AbilityResult](js-apis-inner-ability-abilityResult.md) | Level-2 module **AbilityResult**.| | AbilityResult | [AbilityResult](js-apis-inner-ability-abilityResult.md) | Level-2 module **AbilityResult**.|
| ConnectOptions | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | Level-2 module **ConnectOptions**.| | ConnectOptions | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | Level-2 module **ConnectOptions**.|
......
...@@ -130,6 +130,6 @@ import Want from '@ohos.application.Want'; ...@@ -130,6 +130,6 @@ import Want from '@ohos.application.Want';
}); });
``` ```
- For more details and examples, see [Want](../../application-models/want-overview.md). - For more details and examples, see [Application Model](../../application-models/application-model-composition.md).
<!--no_check--> <!--no_check-->
...@@ -81,7 +81,7 @@ Unsubscribes from bundle installation, uninstall, and update events. ...@@ -81,7 +81,7 @@ Unsubscribes from bundle installation, uninstall, and update events.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------------------------- | -------- | ---- | ---------------------------------------------------------- | | ---------------------------- | -------- | ---- | ---------------------------------------------------------- |
| type| BundleChangedEvent| Yes | Type of the event to unsubscribe from. | | type| BundleChangedEvent| Yes | Type of the event to unsubscribe from. |
| callback | callback\<BundleChangedInfo>| No | Callback used for the unsubscription. If this parameter is left empty, all callbacks of the current event are unsubscribed from.| | callback | callback\<BundleChangedInfo>| No | Callback used for the unsubscription. By default, no value is passed, and all callbacks of the current event are unsubscribed from.|
**Example** **Example**
......
...@@ -232,7 +232,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -232,7 +232,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------------- | | -------- | ----------------------------------------- |
| 17700004 | The specified user ID is not found. |
| 17700023 | The specified default app does not exist. | | 17700023 | The specified default app does not exist. |
| 17700025 | The specified type is invalid. | | 17700025 | The specified type is invalid. |
...@@ -415,7 +414,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -415,7 +414,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------------- | | -------- | ---------------------------------------------- |
| 17700004 | The specified user ID is not found. |
| 17700025 | The specified type is invalid. | | 17700025 | The specified type is invalid. |
| 17700028 | The specified ability does not match the type. | | 17700028 | The specified ability does not match the type. |
...@@ -574,7 +572,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -574,7 +572,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 17700004 | The specified user ID is not found. |
| 17700025 | The specified type is invalid. | | 17700025 | The specified type is invalid. |
**Example** **Example**
......
...@@ -3,10 +3,8 @@ ...@@ -3,10 +3,8 @@
The **cloudSyncManager** module provides APIs for changing the cloud and device service status and notifying the data changes. The **cloudSyncManager** module provides APIs for changing the cloud and device service status and notifying the data changes.
> **NOTE** > **NOTE**
>
> - The initial APIs of this module are supported since API version 10. 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 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module are system APIs and cannot be called by third-party applications. > - The APIs of this module are system APIs and cannot be called by third-party applications.
> - The APIs of this module support processing of error codes. For details, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
## Modules to Import ## Modules to Import
...@@ -36,6 +34,15 @@ Changes the device-cloud file synchronization switch for an application. This AP ...@@ -36,6 +34,15 @@ Changes the device-cloud file synchronization switch for an application. This AP
| --------------------- | ---------------- | | --------------------- | ---------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID | Error Message |
| ---------------------------- | ---------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
**Example** **Example**
```js ```js
...@@ -65,6 +72,15 @@ Changes the device-cloud file synchronization switch for an application. This AP ...@@ -65,6 +72,15 @@ Changes the device-cloud file synchronization switch for an application. This AP
| status | boolean | Yes | State of the cloud-device file synchronization switch to set. The value **true** means to enable this function; the value **false** means the opposite.| | status | boolean | Yes | State of the cloud-device file synchronization switch to set. The value **true** means to enable this function; the value **false** means the opposite.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID | Error Message |
| ---------------------------- | ---------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
**Example** **Example**
```js ```js
...@@ -78,6 +94,7 @@ Changes the device-cloud file synchronization switch for an application. This AP ...@@ -78,6 +94,7 @@ Changes the device-cloud file synchronization switch for an application. This AP
} }
}); });
``` ```
## cloudSyncManager.notifyDataChange ## cloudSyncManager.notifyDataChange
notifyDataChange(accountId: string, bundleName: string): Promise&lt;void&gt;; notifyDataChange(accountId: string, bundleName: string): Promise&lt;void&gt;;
...@@ -99,6 +116,15 @@ Notifies the cloud and device services of the application data change in the clo ...@@ -99,6 +116,15 @@ Notifies the cloud and device services of the application data change in the clo
| --------------------- | ---------------- | | --------------------- | ---------------- |
| Promise&lt;void&gt; | Promise used to return the application data change in the cloud.| | Promise&lt;void&gt; | Promise used to return the application data change in the cloud.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID | Error Message |
| ---------------------------- | ---------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
**Example** **Example**
```js ```js
...@@ -127,6 +153,15 @@ Notifies the cloud and device services of the application data change in the clo ...@@ -127,6 +153,15 @@ Notifies the cloud and device services of the application data change in the clo
| bundleName | string | Yes | Bundle name of the application.| | bundleName | string | Yes | Bundle name of the application.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the application data change in the cloud.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the application data change in the cloud.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID | Error Message |
| ---------------------------- | ---------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
**Example** **Example**
```js ```js
......
# @ohos.file.environment (Directory Environment Capability) # @ohos.file.environment (Directory Environment Capability)
The **Environment** module provides APIs for obtaining the root directories of the storage and public files. The **Environment** module provides APIs for obtaining the root directories of the storage and user files.
> **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.
> - The APIs of this module are system APIs and cannot be called by third-party applications. > - The APIs of this module are system APIs and cannot be called by third-party applications.
> - The APIs of this module support processing of error codes. For details, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
## Modules to Import ## Modules to Import
...@@ -28,6 +27,15 @@ Obtains the root directory of the storage. This API uses a promise to return the ...@@ -28,6 +27,15 @@ Obtains the root directory of the storage. This API uses a promise to return the
| --------------------- | ---------------- | | --------------------- | ---------------- |
| Promise&lt;string&gt; | Promise used to return the root directory of the storage.| | Promise&lt;string&gt; | Promise used to return the root directory of the storage.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID | Error Message |
| ---------------------------- | ---------- |
| 202 | The caller is not a system application |
| 13900020 | Invalid argument |
| 13900042 | Unknown error |
**Example** **Example**
```js ```js
...@@ -52,6 +60,15 @@ Obtains the root directory of the storage. This API uses an asynchronous callbac ...@@ -52,6 +60,15 @@ Obtains the root directory of the storage. This API uses an asynchronous callbac
| -------- | --------------------------- | ---- | -------------------------------- | | -------- | --------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback&lt;string&gt; | Yes | Asynchronous callback invoked to return the root directory of the storage.| | callback | AsyncCallback&lt;string&gt; | Yes | Asynchronous callback invoked to return the root directory of the storage.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID | Error Message |
| ---------------------------- | ---------- |
| 202 | The caller is not a system application |
| 13900020 | Invalid argument |
| 13900042 | Unknown error |
**Example** **Example**
```js ```js
...@@ -68,7 +85,7 @@ Obtains the root directory of the storage. This API uses an asynchronous callbac ...@@ -68,7 +85,7 @@ Obtains the root directory of the storage. This API uses an asynchronous callbac
getUserDataDir():Promise&lt;string&gt; getUserDataDir():Promise&lt;string&gt;
Obtains the root directory of public files. This API uses a promise to return the result. Obtains the root directory of user files. This API uses a promise to return the result.
**System capability**: SystemCapability.FileManagement.File.Environment **System capability**: SystemCapability.FileManagement.File.Environment
...@@ -76,7 +93,16 @@ Obtains the root directory of public files. This API uses a promise to return th ...@@ -76,7 +93,16 @@ Obtains the root directory of public files. This API uses a promise to return th
| Type | Description | | Type | Description |
| --------------------- | ------------------ | | --------------------- | ------------------ |
| Promise&lt;string&gt; | Promise returned with the root directory of public files.| | Promise&lt;string&gt; | Promise used to return the root directory of user files.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID | Error Message |
| ---------------------------- | ---------- |
| 202 | The caller is not a system application |
| 13900020 | Invalid argument |
| 13900042 | Unknown error |
**Example** **Example**
...@@ -92,7 +118,7 @@ Obtains the root directory of public files. This API uses a promise to return th ...@@ -92,7 +118,7 @@ Obtains the root directory of public files. This API uses a promise to return th
getUserDataDir(callback:AsyncCallback&lt;string&gt;): void getUserDataDir(callback:AsyncCallback&lt;string&gt;): void
Obtains the root directory of public files. This API uses an asynchronous callback to return the result. Obtains the root directory of user files. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.FileManagement.File.Environment **System capability**: SystemCapability.FileManagement.File.Environment
...@@ -100,7 +126,16 @@ Obtains the root directory of public files. This API uses an asynchronous callba ...@@ -100,7 +126,16 @@ Obtains the root directory of public files. This API uses an asynchronous callba
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | -------------------------------- | | -------- | --------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback&lt;string&gt; | Yes | Asynchronous callback used to return the root directory of public files.| | callback | AsyncCallback&lt;string&gt; | Yes | Asynchronous callback used to return the root directory of user files.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID | Error Message |
| ---------------------------- | ---------- |
| 202 | The caller is not a system application |
| 13900020 | Invalid argument |
| 13900042 | Unknown error |
**Example** **Example**
......
...@@ -41,9 +41,9 @@ Obtains the URI of a file in synchronous mode. ...@@ -41,9 +41,9 @@ Obtains the URI of a file in synchronous mode.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------- | ---------- | | ---------------------------- | ---------- |
| string | File URI obtained.| | string | File URI obtained.|
**Error codes** **Error codes**
...@@ -52,7 +52,6 @@ For details about the error codes, see [File Management Error Codes](../errorcod ...@@ -52,7 +52,6 @@ For details about the error codes, see [File Management Error Codes](../errorcod
| ---------------------------- | ---------- | | ---------------------------- | ---------- |
| 401 | The input parameter is invalid | | 401 | The input parameter is invalid |
**Example** **Example**
```js ```js
......
# @ohos.file.hash (File Hash Processing) # @ohos.file.hash (File Hash Processing)
The **fileHash** module implements hash processing on files. The **FileHash** module implements hash processing on files.
> **NOTE** > **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 support processing of error codes. For details, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
## Modules to Import ## Modules to Import
...@@ -17,7 +16,7 @@ import Hash from '@ohos.file.hash'; ...@@ -17,7 +16,7 @@ import Hash from '@ohos.file.hash';
Before using the APIs provided by this module to perform operations on a file or directory, obtain the path of the file or directory in the application sandbox as follows: Before using the APIs provided by this module to perform operations on a file or directory, obtain the path of the file or directory in the application sandbox as follows:
**Stage Model** Stage Model
```js ```js
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
...@@ -30,7 +29,7 @@ export default class EntryAbility extends UIAbility { ...@@ -30,7 +29,7 @@ export default class EntryAbility extends UIAbility {
} }
``` ```
**FA Model** FA Model
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
...@@ -64,6 +63,15 @@ Calculates a hash value for a file. This API uses a promise to return the result ...@@ -64,6 +63,15 @@ Calculates a hash value for a file. This API uses a promise to return the result
| --------------------- | -------------------------- | | --------------------- | -------------------------- |
| Promise&lt;string&gt; | Promise used to return the hash value. The hash value is a hexadecimal string consisting of digits and uppercase letters.| | Promise&lt;string&gt; | Promise used to return the hash value. The hash value is a hexadecimal string consisting of digits and uppercase letters.|
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
| ID| Error Message|
| -------- | -------- |
| 13900020 | Invalid argument |
| 13900042 | Unknown error |
**Example** **Example**
```js ```js
...@@ -89,9 +97,19 @@ Calculates a hash value for a file. This API uses an asynchronous callback to re ...@@ -89,9 +97,19 @@ Calculates a hash value for a file. This API uses an asynchronous callback to re
| --------- | --------------------------- | ---- | ------------------------------------------------------------ | | --------- | --------------------------- | ---- | ------------------------------------------------------------ |
| path | string | Yes | Path of the file in the application sandbox. | | path | string | Yes | Path of the file in the application sandbox. |
| algorithm | string | Yes | Algorithm used to calculate the hash value. The value can be **md5**, **sha1**, or **sha256**. **sha256** is recommended for security purposes.| | algorithm | string | Yes | Algorithm used to calculate the hash value. The value can be **md5**, **sha1**, or **sha256**. **sha256** is recommended for security purposes.|
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the hash value obtained. The hash value is a hexadecimal string consisting of digits and uppercase letters.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the hash value obtained. The hash value is a hexadecimal string consisting of digits and uppercase letters.|
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
| ID| Error Message|
| -------- | -------- |
| 13900020 | Invalid argument |
| 13900042 | Unknown error |
**Example** **Example**
```js ```js
let filePath = pathDir + "/test.txt"; let filePath = pathDir + "/test.txt";
Hash.hash(filePath, "sha256", (err, str) => { Hash.hash(filePath, "sha256", (err, str) => {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
> 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.
## Modules to Import ## Modules to Import
```js ```js
import picker from '@ohos.file.picker'; import picker from '@ohos.file.picker';
``` ```
......
...@@ -4,8 +4,7 @@ The **securityLabel** module provides APIs for managing data security levels of ...@@ -4,8 +4,7 @@ The **securityLabel** module provides APIs for managing data security levels of
> **NOTE** > **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 support processing of error codes. For details, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
## Modules to Import ## Modules to Import
...@@ -60,9 +59,24 @@ Sets a security label for a file in asynchronous mode. This API uses a promise t ...@@ -60,9 +59,24 @@ Sets a security label for a file in asynchronous mode. This API uses a promise t
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------- | ---------------- | | ------------------- | ---------------- |
| Promise&lt;void&gt; | Promise that returns no value.| | Promise&lt;void&gt; | Promise that returns no value.|
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
| ID| Error Message|
| -------- | -------- |
| 13900001 | Operation not permitted |
| 13900007 | Arg list too long |
| 13900015 | File exists |
| 13900020 | Invalid argument |
| 13900025 | No space left on device |
| 13900037 | No data available |
| 13900041 | Quota exceeded |
| 13900042 | Unknown error |
**Example** **Example**
...@@ -91,6 +105,21 @@ Sets a security label for a file in asynchronous mode. This API uses an asynchro ...@@ -91,6 +105,21 @@ Sets a security label for a file in asynchronous mode. This API uses an asynchro
| type | DataLevel | Yes | File security level to set, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| | type | DataLevel | Yes | File security level to set, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. |
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
| ID| Error Message|
| -------- | -------- |
| 13900001 | Operation not permitted |
| 13900007 | Arg list too long |
| 13900015 | File exists |
| 13900020 | Invalid argument |
| 13900025 | No space left on device |
| 13900037 | No data available |
| 13900041 | Quota exceeded |
| 13900042 | Unknown error |
**Example** **Example**
```js ```js
...@@ -119,6 +148,21 @@ Sets a security label for a file in synchronous mode. ...@@ -119,6 +148,21 @@ Sets a security label for a file in synchronous mode.
| path | string | Yes | Path of the target file. | | path | string | Yes | Path of the target file. |
| type | DataLevel | Yes | File security level to set, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| | type | DataLevel | Yes | File security level to set, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.|
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
| ID| Error Message|
| -------- | -------- |
| 13900001 | Operation not permitted |
| 13900007 | Arg list too long |
| 13900015 | File exists |
| 13900020 | Invalid argument |
| 13900025 | No space left on device |
| 13900037 | No data available |
| 13900041 | Quota exceeded |
| 13900042 | Unknown error |
**Example** **Example**
```js ```js
...@@ -136,15 +180,30 @@ Obtains the security label of a file in asynchronous mode. This API uses a promi ...@@ -136,15 +180,30 @@ Obtains the security label of a file in asynchronous mode. This API uses a promi
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------- | | ------ | ------ | ---- | -------- |
| path | string | Yes | Path of the target file.| | path | string | Yes | Path of the target file.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ------------ | | --------------------- | ------------ |
| Promise&lt;string&gt; | Security label obtained.| | Promise&lt;string&gt; | Security label obtained.|
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
| ID| Error Message|
| -------- | -------- |
| 13900001 | Operation not permitted |
| 13900007 | Arg list too long |
| 13900015 | File exists |
| 13900020 | Invalid argument |
| 13900025 | No space left on device |
| 13900037 | No data available |
| 13900041 | Quota exceeded |
| 13900042 | Unknown error |
**Example** **Example**
...@@ -167,10 +226,25 @@ Obtains the security label of a file in asynchronous mode. This API uses a callb ...@@ -167,10 +226,25 @@ Obtains the security label of a file in asynchronous mode. This API uses a callb
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | -------------------------- | | -------- | --------------------------- | ---- | -------------------------- |
| path | string | Yes | Path of the target file. | | path | string | Yes | Path of the target file. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the security label obtained.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the security label obtained.|
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
| ID| Error Message|
| -------- | -------- |
| 13900001 | Operation not permitted |
| 13900007 | Arg list too long |
| 13900015 | File exists |
| 13900020 | Invalid argument |
| 13900025 | No space left on device |
| 13900037 | No data available |
| 13900041 | Quota exceeded |
| 13900042 | Unknown error |
**Example** **Example**
...@@ -184,6 +258,7 @@ Obtains the security label of a file in asynchronous mode. This API uses a callb ...@@ -184,6 +258,7 @@ Obtains the security label of a file in asynchronous mode. This API uses a callb
} }
}); });
``` ```
## securityLabel.getSecurityLabelSync ## securityLabel.getSecurityLabelSync
getSecurityLabelSync(path:string):string getSecurityLabelSync(path:string):string
...@@ -204,6 +279,21 @@ Obtains the security label of a file in synchronous mode. ...@@ -204,6 +279,21 @@ Obtains the security label of a file in synchronous mode.
| ------ | ------------ | | ------ | ------------ |
| string | Security label obtained.| | string | Security label obtained.|
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
| ID| Error Message|
| -------- | -------- |
| 13900001 | Operation not permitted |
| 13900007 | Arg list too long |
| 13900015 | File exists |
| 13900020 | Invalid argument |
| 13900025 | No space left on device |
| 13900037 | No data available |
| 13900041 | Quota exceeded |
| 13900042 | Unknown error |
**Example** **Example**
```js ```js
......
...@@ -4,14 +4,14 @@ The **statfs** module provides APIs for obtaining file system information, inclu ...@@ -4,14 +4,14 @@ The **statfs** module provides APIs for obtaining file system information, inclu
> **NOTE** > **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 support processing of error codes. For details, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
## Modules to Import ## Modules to Import
```js ```js
import statvfs from '@ohos.file.statvfs'; import statvfs from '@ohos.file.statvfs';
``` ```
## statvfs.getFreeSize ## statvfs.getFreeSize
getFreeSize(path:string):Promise&lt;number&gt; getFreeSize(path:string):Promise&lt;number&gt;
...@@ -32,6 +32,10 @@ Obtains the number of free bytes of the specified file system in asynchronous mo ...@@ -32,6 +32,10 @@ Obtains the number of free bytes of the specified file system in asynchronous mo
| --------------------- | -------------- | | --------------------- | -------------- |
| Promise&lt;number&gt; | Promise used to return the number of free bytes obtained.| | Promise&lt;number&gt; | Promise used to return the number of free bytes obtained.|
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
**Example** **Example**
```js ```js
...@@ -58,6 +62,10 @@ Obtains the number of free bytes of the specified file system in asynchronous mo ...@@ -58,6 +62,10 @@ Obtains the number of free bytes of the specified file system in asynchronous mo
| path | string | Yes | File path of the file system.| | path | string | Yes | File path of the file system.|
| callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the number of free bytes obtained.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the number of free bytes obtained.|
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
**Example** **Example**
```js ```js
...@@ -91,6 +99,10 @@ Obtains the total number of bytes of the specified file system in asynchronous m ...@@ -91,6 +99,10 @@ Obtains the total number of bytes of the specified file system in asynchronous m
| --------------------- | ------------ | | --------------------- | ------------ |
| Promise&lt;number&gt; | Promise used to return the total number of bytes obtained.| | Promise&lt;number&gt; | Promise used to return the total number of bytes obtained.|
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
**Example** **Example**
```js ```js
...@@ -117,6 +129,10 @@ Obtains the total number of bytes of the specified file system in asynchronous m ...@@ -117,6 +129,10 @@ Obtains the total number of bytes of the specified file system in asynchronous m
| path | string | Yes | File path of the file system.| | path | string | Yes | File path of the file system.|
| callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the total number of bytes obtained. | | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the total number of bytes obtained. |
**Error codes**
For details about the error codes, see [Basic File IO Error Codes](../errorcodes/errorcode-filemanagement.md#basic-file-io-error-codes).
**Example** **Example**
```js ```js
......
...@@ -4,8 +4,8 @@ The **storageStatistics** module provides APIs for obtaining storage space infor ...@@ -4,8 +4,8 @@ The **storageStatistics** module provides APIs for obtaining storage space infor
> **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.
> - The APIs of this module support processing of error codes. For details, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
## Modules to Import ## Modules to Import
```js ```js
...@@ -24,7 +24,6 @@ Obtains the total size (in bytes) of the specified volume in an external storage ...@@ -24,7 +24,6 @@ Obtains the total size (in bytes) of the specified volume in an external storage
**System API**: This is a system API. **System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description| | Name | Type | Mandatory| Description|
...@@ -37,6 +36,19 @@ Obtains the total size (in bytes) of the specified volume in an external storage ...@@ -37,6 +36,19 @@ Obtains the total size (in bytes) of the specified volume in an external storage
| --------------------- | ---------------- | | --------------------- | ---------------- |
| Promise&lt;number&gt; | Promise used to return the total volume size obtained.| | Promise&lt;number&gt; | Promise used to return the total volume size obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13600008 | No such object. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -60,7 +72,6 @@ Obtains the total size (in bytes) of the specified volume in an external storage ...@@ -60,7 +72,6 @@ Obtains the total size (in bytes) of the specified volume in an external storage
**System API**: This is a system API. **System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -68,6 +79,19 @@ Obtains the total size (in bytes) of the specified volume in an external storage ...@@ -68,6 +79,19 @@ Obtains the total size (in bytes) of the specified volume in an external storage
| volumeUuid | string | Yes | UUID of the volume. | | volumeUuid | string | Yes | UUID of the volume. |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the total volume size obtained.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the total volume size obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13600008 | No such object. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -90,7 +114,6 @@ Obtains the available space (in bytes) of the specified volume in an external st ...@@ -90,7 +114,6 @@ Obtains the available space (in bytes) of the specified volume in an external st
**System API**: This is a system API. **System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description| | Name | Type | Mandatory| Description|
...@@ -103,6 +126,19 @@ Obtains the available space (in bytes) of the specified volume in an external st ...@@ -103,6 +126,19 @@ Obtains the available space (in bytes) of the specified volume in an external st
| --------------------- | ------------------ | | --------------------- | ------------------ |
| Promise&lt;number&gt; | Promise used to return the available volume space obtained.| | Promise&lt;number&gt; | Promise used to return the available volume space obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13600008 | No such object. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -127,7 +163,6 @@ Obtains the available space (in bytes) of the specified volume in an external st ...@@ -127,7 +163,6 @@ Obtains the available space (in bytes) of the specified volume in an external st
**System API**: This is a system API. **System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -135,6 +170,19 @@ Obtains the available space (in bytes) of the specified volume in an external st ...@@ -135,6 +170,19 @@ Obtains the available space (in bytes) of the specified volume in an external st
| volumeUuid | string | Yes | UUID of the volume. | | volumeUuid | string | Yes | UUID of the volume. |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the available volume space obtained.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the available volume space obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13600008 | No such object. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -157,7 +205,6 @@ Obtains the space (in bytes) of an application. This API uses a promise to retur ...@@ -157,7 +205,6 @@ Obtains the space (in bytes) of an application. This API uses a promise to retur
**System API**: This is a system API. **System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -170,6 +217,19 @@ Obtains the space (in bytes) of an application. This API uses a promise to retur ...@@ -170,6 +217,19 @@ Obtains the space (in bytes) of an application. This API uses a promise to retur
| ------------------------------------------ | -------------------------- | | ------------------------------------------ | -------------------------- |
| Promise&lt;[Bundlestats](#bundlestats9)&gt; | Promise used to return the application space obtained.| | Promise&lt;[Bundlestats](#bundlestats9)&gt; | Promise used to return the application space obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13600008 | No such object. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -193,7 +253,6 @@ Obtains the space (in bytes) of an application. This API uses an asynchronous ca ...@@ -193,7 +253,6 @@ Obtains the space (in bytes) of an application. This API uses an asynchronous ca
**System API**: This is a system API. **System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -201,6 +260,19 @@ Obtains the space (in bytes) of an application. This API uses an asynchronous ca ...@@ -201,6 +260,19 @@ Obtains the space (in bytes) of an application. This API uses an asynchronous ca
| packageName | string | Yes | Bundle name of the application.| | packageName | string | Yes | Bundle name of the application.|
| callback | AsyncCallback&lt;[Bundlestats](#bundlestats9)&gt; | Yes | Callback invoked to return the application space obtained.| | callback | AsyncCallback&lt;[Bundlestats](#bundlestats9)&gt; | Yes | Callback invoked to return the application space obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13600008 | No such object. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -225,6 +297,16 @@ Obtains the space (in bytes) of this third-party application. This API uses a pr ...@@ -225,6 +297,16 @@ Obtains the space (in bytes) of this third-party application. This API uses a pr
| ------------------------------------------ | -------------------------- | | ------------------------------------------ | -------------------------- |
| Promise&lt;[Bundlestats](#bundlestats9)&gt; | Promise used to return the application space obtained. | | Promise&lt;[Bundlestats](#bundlestats9)&gt; | Promise used to return the application space obtained. |
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -246,6 +328,16 @@ Obtains the space (in bytes) of this third-party application. This API uses an a ...@@ -246,6 +328,16 @@ Obtains the space (in bytes) of this third-party application. This API uses an a
| -------- | --------------------------------------------------------- | ---- | ------------------------------------ | | -------- | --------------------------------------------------------- | ---- | ------------------------------------ |
| callback | AsyncCallback&lt;[BundleStats](#bundlestats9)&gt; | Yes | Callback invoked to return the application space obtained. | | callback | AsyncCallback&lt;[BundleStats](#bundlestats9)&gt; | Yes | Callback invoked to return the application space obtained. |
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -265,7 +357,6 @@ Obtains the space (in bytes) of this third-party application. This API uses an a ...@@ -265,7 +357,6 @@ Obtains the space (in bytes) of this third-party application. This API uses an a
| cacheSize | number | Yes| No| Cache size of the application, in bytes. | | cacheSize | number | Yes| No| Cache size of the application, in bytes. |
| dataSize | number | Yes| No| Total data size of the application, in bytes.| | dataSize | number | Yes| No| Total data size of the application, in bytes.|
## storageStatistics.getTotalSize<sup>9+</sup> ## storageStatistics.getTotalSize<sup>9+</sup>
getTotalSize(): Promise&lt;number&gt; getTotalSize(): Promise&lt;number&gt;
...@@ -284,6 +375,18 @@ Obtains the total size (in bytes) of the built-in storage. This API uses a promi ...@@ -284,6 +375,18 @@ Obtains the total size (in bytes) of the built-in storage. This API uses a promi
| --------------------- | ------------------ | | --------------------- | ------------------ |
| Promise&lt;number&gt; | Promise used to return the built-in storage size obtained. | | Promise&lt;number&gt; | Promise used to return the built-in storage size obtained. |
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -309,6 +412,18 @@ Obtains the total size (in bytes) of the built-in storage. This API uses an asyn ...@@ -309,6 +412,18 @@ Obtains the total size (in bytes) of the built-in storage. This API uses an asyn
| -------- | ------------------------------------ | ---- | ------------------------ | | -------- | ------------------------------------ | ---- | ------------------------ |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the built-in storage size obtained.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the built-in storage size obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -318,7 +433,6 @@ Obtains the total size (in bytes) of the built-in storage. This API uses an asyn ...@@ -318,7 +433,6 @@ Obtains the total size (in bytes) of the built-in storage. This API uses an asyn
}); });
``` ```
## storageStatistics.getFreeSize<sup>9+</sup> ## storageStatistics.getFreeSize<sup>9+</sup>
getFreeSize(): Promise&lt;number&gt; getFreeSize(): Promise&lt;number&gt;
...@@ -337,6 +451,18 @@ Obtains the available space (in bytes) of the built-in storage. This API uses a ...@@ -337,6 +451,18 @@ Obtains the available space (in bytes) of the built-in storage. This API uses a
| --------------------- | ------------------ | | --------------------- | ------------------ |
| Promise&lt;number&gt; | Promise used to return the available space of the built-in storage obtained.| | Promise&lt;number&gt; | Promise used to return the available space of the built-in storage obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -344,7 +470,6 @@ Obtains the available space (in bytes) of the built-in storage. This API uses a ...@@ -344,7 +470,6 @@ Obtains the available space (in bytes) of the built-in storage. This API uses a
console.info("getFreeSize successfully:"+ JSON.stringify(number)); console.info("getFreeSize successfully:"+ JSON.stringify(number));
``` ```
## storageStatistics.getFreeSize<sup>9+</sup> ## storageStatistics.getFreeSize<sup>9+</sup>
getFreeSize(callback: AsyncCallback&lt;number&gt;): void getFreeSize(callback: AsyncCallback&lt;number&gt;): void
...@@ -363,6 +488,18 @@ Obtains the available space (in bytes) of the built-in storage. This API uses an ...@@ -363,6 +488,18 @@ Obtains the available space (in bytes) of the built-in storage. This API uses an
| -------- | ------------------------------------ | ---- | ------------------------- | | -------- | ------------------------------------ | ---- | ------------------------- |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the available space of the built-in storage obtained.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the available space of the built-in storage obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -384,13 +521,24 @@ Obtains the system data space, in bytes. This API uses a promise to return the r ...@@ -384,13 +521,24 @@ Obtains the system data space, in bytes. This API uses a promise to return the r
**System API**: This is a system API. **System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ---------------- | | --------------------- | ---------------- |
| Promise&lt;number&gt; | Promise used to return the system data space obtained.| | Promise&lt;number&gt; | Promise used to return the system data space obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -419,6 +567,18 @@ Obtains the system data space, in bytes. This API uses an asynchronous callback ...@@ -419,6 +567,18 @@ Obtains the system data space, in bytes. This API uses an asynchronous callback
| ---------- | ------------------------------------ | ---- | -------------------------- | | ---------- | ------------------------------------ | ---- | -------------------------- |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the system data space obtained.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the system data space obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -446,6 +606,18 @@ Obtains the storage statistics (in bytes) of this user. This API uses a promise ...@@ -446,6 +606,18 @@ Obtains the storage statistics (in bytes) of this user. This API uses a promise
| --------------------- | ---------------- | | --------------------- | ---------------- |
| Promise&lt;[StorageStats](#storagestats9)&gt; | Promise used to return the information obtained.| | Promise&lt;[StorageStats](#storagestats9)&gt; | Promise used to return the information obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -474,6 +646,18 @@ Obtains the storage statistics (in bytes) of this user. This API uses an asynchr ...@@ -474,6 +646,18 @@ Obtains the storage statistics (in bytes) of this user. This API uses an asynchr
| ---------- | ------------------------------------ | ---- | -------------------------- | | ---------- | ------------------------------------ | ---- | -------------------------- |
| callback | AsyncCallback&lt;[StorageStats](#storagestats9)&gt; | Yes | Callback invoked to return the information obtained.| | callback | AsyncCallback&lt;[StorageStats](#storagestats9)&gt; | Yes | Callback invoked to return the information obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -482,6 +666,9 @@ Obtains the storage statistics (in bytes) of this user. This API uses an asynchr ...@@ -482,6 +666,9 @@ Obtains the storage statistics (in bytes) of this user. This API uses an asynchr
console.info("getUserStorageStats successfully:"+ JSON.stringify(StorageStats)); console.info("getUserStorageStats successfully:"+ JSON.stringify(StorageStats));
}); });
``` ```
## storageStatistics.getUserStorageStats<sup>9+</sup>
getUserStorageStats(userId: number): Promise&lt;StorageStats&gt; getUserStorageStats(userId: number): Promise&lt;StorageStats&gt;
Obtains the storage statistics (in bytes) of the specified user. This API uses a promise to return the result. Obtains the storage statistics (in bytes) of the specified user. This API uses a promise to return the result.
...@@ -504,6 +691,19 @@ Obtains the storage statistics (in bytes) of the specified user. This API uses a ...@@ -504,6 +691,19 @@ Obtains the storage statistics (in bytes) of the specified user. This API uses a
| --------------------- | ---------------- | | --------------------- | ---------------- |
| Promise&lt;[StorageStats](#storagestats9)&gt; | Promise used to return the information obtained.| | Promise&lt;[StorageStats](#storagestats9)&gt; | Promise used to return the information obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13600009 | User if out of range. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -534,6 +734,19 @@ Obtains the storage statistics (in bytes) of the specified user. This API uses a ...@@ -534,6 +734,19 @@ Obtains the storage statistics (in bytes) of the specified user. This API uses a
| userId | number | Yes | User ID.| | userId | number | Yes | User ID.|
| callback | AsyncCallback&lt;[StorageStats](#storagestats9)&gt; | Yes | Callback invoked to return the information obtained.| | callback | AsyncCallback&lt;[StorageStats](#storagestats9)&gt; | Yes | Callback invoked to return the information obtained.|
**Error codes**
For details about the error codes, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md).
| ID| Error Message|
| -------- | -------- |
| 201 | Permission verification failed. |
| 202 | The caller is not a system application. |
| 401 | The input parameter is invalid. |
| 13600001 | IPC error. |
| 13600009 | User if out of range. |
| 13900032 | Unknown error. |
**Example** **Example**
```js ```js
...@@ -544,7 +757,6 @@ Obtains the storage statistics (in bytes) of the specified user. This API uses a ...@@ -544,7 +757,6 @@ Obtains the storage statistics (in bytes) of the specified user. This API uses a
}); });
``` ```
## StorageStats<sup>9+</sup> ## StorageStats<sup>9+</sup>
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
......
# @ohos.fileshare (File Sharing) # @ohos.fileshare (File Sharing)
The **fileShare** module provides APIs for granting the access permissions on a user file to another application by the Uniform Resource Identifier (URI). Then, the authorized application can access the file by using the APIs provided by [@ohos.file.fs](js-apis-file-fs.md). The **fileshare** module provides APIs for granting the access permissions on a user file to another application by the Uniform Resource Identifier (URI). Then, the authorized application can access the file by using the APIs provided by [@ohos.file.fs](js-apis-file-fs.md).
> **NOTE** > **NOTE**
> >
...@@ -31,7 +31,7 @@ Grants permissions on a user file by the URI to an application. This API uses an ...@@ -31,7 +31,7 @@ Grants permissions on a user file by the URI to an application. This API uses an
| uri | string | Yes | URI of a user file.| | uri | string | Yes | URI of a user file.|
| bundleName | string | Yes | Bundle name of the application to be grated with the permissions.| | bundleName | string | Yes | Bundle name of the application to be grated with the permissions.|
| mode | number | Yes | Permissions to grant. For details, see [wantConstant.Flags](js-apis-app-ability-wantConstant.md#wantconstantflags).<br>**wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION**: permission to read the file. <br>**wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION**: permission to write the file.| | mode | number | Yes | Permissions to grant. For details, see [wantConstant.Flags](js-apis-app-ability-wantConstant.md#wantconstantflags).<br>**wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION**: permission to read the file. <br>**wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION**: permission to write the file.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. |
**Error codes** **Error codes**
...@@ -44,7 +44,6 @@ For details about the error codes, see [File Management Error Codes](../errorcod ...@@ -44,7 +44,6 @@ For details about the error codes, see [File Management Error Codes](../errorcod
| 401 | The input parameter is invalid | | 401 | The input parameter is invalid |
| 143000001 | IPC error | | 143000001 | IPC error |
**Example** **Example**
```js ```js
...@@ -66,7 +65,6 @@ try { ...@@ -66,7 +65,6 @@ try {
} }
``` ```
## fileShare.grantUriPermission ## fileShare.grantUriPermission
grantUriPermission(uri: string, bundleName: string, mode: number): Promise&lt;void&gt; grantUriPermission(uri: string, bundleName: string, mode: number): Promise&lt;void&gt;
...@@ -89,10 +87,9 @@ Grants permissions on a user file by the URI to an application. This API uses a ...@@ -89,10 +87,9 @@ Grants permissions on a user file by the URI to an application. This API uses a
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------- | ---------- | | ---------------------------- | ---------- |
| Promise&lt;void&gt; | Promise that returns no value.| | Promise&lt;void&gt; | Promise that returns no value.|
**Error codes** **Error codes**
...@@ -105,7 +102,6 @@ For details about the error codes, see [File Management Error Codes](../errorcod ...@@ -105,7 +102,6 @@ For details about the error codes, see [File Management Error Codes](../errorcod
| 401 | The input parameter is invalid | | 401 | The input parameter is invalid |
| 143000001 | IPC error | | 143000001 | IPC error |
**Example** **Example**
```js ```js
......
...@@ -865,8 +865,8 @@ Calls an extended API of the DataAbility. This API uses an asynchronous callback ...@@ -865,8 +865,8 @@ Calls an extended API of the DataAbility. This API uses an asynchronous callback
| uri | string | Yes | URI of the DataAbility. Example: 'dataability:///com.example.xxx.xxxx'. | | uri | string | Yes | URI of the DataAbility. Example: 'dataability:///com.example.xxx.xxxx'. |
| method | string | Yes | Name of the API to call. | | method | string | Yes | Name of the API to call. |
| arg | string | Yes | Parameter to pass in. | | arg | string | Yes | Parameter to pass in. |
| extras | [PacMap](js-apis-inner-application-pacMap.md) | Yes | Key-value pair parameter. | | extras | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap) | Yes | Key-value pair parameter. |
| callback | AsyncCallback\<[PacMap](js-apis-inner-application-pacMap.md)> | Yes| Callback used to return the result. | | callback | AsyncCallback\<[PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap)> | Yes| Callback used to return the result. |
**Example** **Example**
...@@ -901,13 +901,13 @@ Calls an extended API of the DataAbility. This API uses a promise to return the ...@@ -901,13 +901,13 @@ Calls an extended API of the DataAbility. This API uses a promise to return the
| uri | string | Yes | URI of the DataAbility. Example: 'dataability:///com.example.xxx.xxxx'. | | uri | string | Yes | URI of the DataAbility. Example: 'dataability:///com.example.xxx.xxxx'. |
| method | string | Yes | Name of the API to call. | | method | string | Yes | Name of the API to call. |
| arg | string | Yes | Parameter to pass in. | | arg | string | Yes | Parameter to pass in. |
| extras | [PacMap](js-apis-inner-application-pacMap.md) | Yes | Key-value pair parameter. | | extras | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap) | Yes | Key-value pair parameter. |
**Return value** **Return value**
| Type| Description| | Type| Description|
|------ | ------- | |------ | ------- |
|Promise\<[PacMap](js-apis-inner-application-pacMap.md)> | Promise used to return the result.| |Promise\<[PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap)> | Promise used to return the result.|
**Example** **Example**
...@@ -998,3 +998,13 @@ dataAbilityHelper.executeBatch('dataability:///com.example.jsapidemo.UserDataAbi ...@@ -998,3 +998,13 @@ dataAbilityHelper.executeBatch('dataability:///com.example.jsapidemo.UserDataAbi
}); });
``` ```
## PacMap
[key: string]: number | string | boolean | Array\<string | number | boolean> | null;
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
| Name| Type| Mandatory| Description|
| ------ | ------ | ------ | ------ |
| [key: string] | number \| string \| boolean \| Array\<string \| number \| boolean\> \| null | Yes| Data stored in key-value pairs.|
\ No newline at end of file
...@@ -72,6 +72,6 @@ import Want from '@ohos.app.ability.Want'; ...@@ -72,6 +72,6 @@ import Want from '@ohos.app.ability.Want';
// ... // ...
``` ```
- For more details and examples, see [Want](../../application-models/want-overview.md). - For more details and examples, see [Application Model](../../application-models/application-model-composition.md).
<!--no_check--> <!--no_check-->
...@@ -122,6 +122,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -122,6 +122,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700036 | Failed to install the HSP because lacks appropriate permissions. | | 17700036 | Failed to install the HSP because lacks appropriate permissions. |
| 17700039 | Failed to install because disallow install a shared bundle by hapFilePaths. | | 17700039 | Failed to install because disallow install a shared bundle by hapFilePaths. |
| 17700041 | Failed to install because enterprise device management disallow install. | | 17700041 | Failed to install because enterprise device management disallow install. |
| 17700042 | Failed to install the HAP because of incorrect URI in the data proxy. |
| 17700043 | Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core). |
| 17700044 | Failed to install the HAP because the isolationMode configured is not supported. |
| 17700047 | Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. |
**Example** **Example**
...@@ -185,6 +189,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -185,6 +189,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700036 | Failed to install the HSP because lacks appropriate permissions. | | 17700036 | Failed to install the HSP because lacks appropriate permissions. |
| 17700039 | Failed to install because disallow install a shared bundle by hapFilePaths. | | 17700039 | Failed to install because disallow install a shared bundle by hapFilePaths. |
| 17700041 | Failed to install because enterprise device management disallow install. | | 17700041 | Failed to install because enterprise device management disallow install. |
| 17700042 | Failed to install the HAP because of incorrect URI in the data proxy. |
| 17700043 | Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core). |
| 17700044 | Failed to install the HAP because the isolationMode configured is not supported. |
| 17700047 | Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. |
**Example** **Example**
...@@ -226,7 +234,7 @@ Installs a bundle. This API uses a promise to return the result. ...@@ -226,7 +234,7 @@ Installs a bundle. This API uses a promise to return the result.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------ | ----------------------------- | ---- | ------------------------------------------------------------ | | ------------ | ----------------------------- | ---- | ------------------------------------------------------------ |
| hapFilePaths | Array\<string\> | Yes | Paths where the HAP files of the bundle are stored, which are the data directories. If only one directory is passed, the HAP files in the directory must belong to the same bundle and have the same signature.| | hapFilePaths | Array\<string\> | Yes | Paths where the HAP files of the bundle are stored, which are the data directories. If only one directory is passed, the HAP files in the directory must belong to the same bundle and have the same signature.|
| installParam | [InstallParam](#installparam) | No | Parameters required for the installation. | | installParam | [InstallParam](#installparam) | No | Parameters required for the installation. For details about their default values, see [InstallParam](#installparam). |
**Return value** **Return value**
...@@ -252,6 +260,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -252,6 +260,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700036 | Failed to install the HSP because lacks appropriate permissions. | | 17700036 | Failed to install the HSP because lacks appropriate permissions. |
| 17700039 | Failed to install because disallow install a shared bundle by hapFilePaths. | | 17700039 | Failed to install because disallow install a shared bundle by hapFilePaths. |
| 17700041 | Failed to install because enterprise device management disallow install. | | 17700041 | Failed to install because enterprise device management disallow install. |
| 17700042 | Failed to install the HAP because of incorrect URI in the data proxy. |
| 17700043 | Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core). |
| 17700044 | Failed to install the HAP because the isolationMode configured is not supported. |
| 17700047 | Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. |
**Example** **Example**
...@@ -310,6 +322,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -310,6 +322,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700004 | The specified user ID is not found. | | 17700004 | The specified user ID is not found. |
| 17700020 | The specified bundle is pre-installed bundle which cannot be uninstalled. | | 17700020 | The specified bundle is pre-installed bundle which cannot be uninstalled. |
| 17700040 | The specified bundle is a shared bundle which cannot be uninstalled. | | 17700040 | The specified bundle is a shared bundle which cannot be uninstalled. |
| 17700045 | Failed to uninstall because enterprise device management disallow uninstall. |
**Example** **Example**
...@@ -367,6 +380,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -367,6 +380,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700001 | The specified bundle name is not found. | | 17700001 | The specified bundle name is not found. |
| 17700020 | The specified bundle is pre-installed bundle which cannot be uninstalled. | | 17700020 | The specified bundle is pre-installed bundle which cannot be uninstalled. |
| 17700040 | The specified bundle is a shared bundle which cannot be uninstalled. | | 17700040 | The specified bundle is a shared bundle which cannot be uninstalled. |
| 17700045 | Failed to uninstall because enterprise device management disallow uninstall. |
**Example** **Example**
...@@ -407,7 +421,7 @@ Uninstalls a bundle. This API uses a promise to return the result. ...@@ -407,7 +421,7 @@ Uninstalls a bundle. This API uses a promise to return the result.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------ | ----------------------------- | ---- | ------------------------------------------------------------ | | ------------ | ----------------------------- | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Name of the target bundle. | | bundleName | string | Yes | Name of the target bundle. |
| installParam | [InstallParam](#installparam) | No | Parameters required for the uninstall. | | installParam | [InstallParam](#installparam) | No | Parameters required for the uninstall. For details about their default values, see [InstallParam](#installparam). |
**Return value** **Return value**
...@@ -422,9 +436,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -422,9 +436,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| -------- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ |
| 17700001 | The specified bundle name is not found. | | 17700001 | The specified bundle name is not found. |
| 17700004 | The specified userId is not existed. | | 17700004 | The specified user ID is not found. |
| 17700020 | The specified bundle is pre-installed bundle which cannot be uninstalled. | | 17700020 | The specified bundle is pre-installed bundle which cannot be uninstalled. |
| 17700040 | The specified bundle is a shared bundle which cannot be uninstalled. | | 17700040 | The specified bundle is a shared bundle which cannot be uninstalled. |
| 17700045 | Failed to uninstall because enterprise device management disallow uninstall. |
**Example** **Example**
```ts ```ts
...@@ -577,7 +592,7 @@ Rolls back a bundle to the initial installation state. This API uses a promise t ...@@ -577,7 +592,7 @@ Rolls back a bundle to the initial installation state. This API uses a promise t
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------ | ----------------------------- | ---- | ------------------------------------------------------------ | | ------------ | ----------------------------- | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Name of the target bundle. | | bundleName | string | Yes | Name of the target bundle. |
| installParam | [InstallParam](#installparam) | No | Parameters required for the recovery. | | installParam | [InstallParam](#installparam) | No | Parameters required for the recovery. For details about their default values, see [InstallParam](#installparam). |
**Return value** **Return value**
...@@ -755,12 +770,12 @@ Defines the parameters that need to be specified for bundle installation, uninst ...@@ -755,12 +770,12 @@ Defines the parameters that need to be specified for bundle installation, uninst
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------------------ | ------------------------------ | ------------------ | ------------------ | | ------------------------------ | ------------------------------ | ------------------ | ------------------ |
| userId | number | No | User ID. You can use [queryOsAccountLocalIdFromProcess](js-apis-osAccount.md#getOsAccountLocalId) to obtain the user of the current process.| | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. You can call [queryOsAccountLocalIdFromProcess](js-apis-osAccount.md#getOsAccountLocalId) to obtain the user ID of the current process.|
| installFlag | number | No | Installation flag. The value **0** means initial installation and **1** means overwrite installation.| | installFlag | number | No | Installation flag. The value **0** means initial installation and **1** means overwrite installation. The default value is **0**.|
| isKeepData | boolean | No | Whether to retain the data directory during bundle uninstall.| | isKeepData | boolean | No | Whether to retain the data directory during bundle uninstall. The default value is **false**.|
| hashParams | Array<[HashParam](#hashparam)> | No| Hash parameters. | | hashParams | Array<[HashParam](#hashparam)> | No| Hash parameters. By default, no value is passed. |
| crowdtestDeadline| number | No |End date of crowdtesting.| | crowdtestDeadline| number | No |End date of crowdtesting. The default value is **-1**.|
| sharedBundleDirPaths<sup>10+</sup> | Array\<String> | No|Paths of the shared bundle files.| | sharedBundleDirPaths<sup>10+</sup> | Array\<String> | No|Paths of the shared bundle files. By default, no value is passed.|
## UninstallParam<sup>10+</sup> ## UninstallParam<sup>10+</sup>
...@@ -773,4 +788,4 @@ Defines the parameters required for the uninstallation of a shared bundle. ...@@ -773,4 +788,4 @@ Defines the parameters required for the uninstallation of a shared bundle.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ------------------------------------------------------------ | | ----------- | ------ | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Name of the shared bundle. | | bundleName | string | Yes | Name of the shared bundle. |
| versionCode | number | No | Version number of the shared bundle. If this parameter is not set, all shared bundles of the specified name are uninstalled.| | versionCode | number | No | Version number of the shared bundle. By default, no value is passed, and all shared bundles of the specified name are uninstalled.|
...@@ -767,7 +767,7 @@ Defines the **TagInfo** object, which provides information about the tag technol ...@@ -767,7 +767,7 @@ Defines the **TagInfo** object, which provides information about the tag technol
| uid<sup>9+</sup> | number[] | Yes| No| Tag unique identifier (UID), which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.| | uid<sup>9+</sup> | number[] | Yes| No| Tag unique identifier (UID), which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
| technology<sup>9+</sup> | number[] | Yes| No| Supported technologies. Each number is a constant indicating the supported technology.| | technology<sup>9+</sup> | number[] | Yes| No| Supported technologies. Each number is a constant indicating the supported technology.|
| supportedProfiles | number[] | Yes| No| Supported profiles. This parameter is not supported since API version 9. Use [technology](#taginfo).| | supportedProfiles | number[] | Yes| No| Supported profiles. This parameter is not supported since API version 9. Use [technology](#taginfo).|
| extrasData<sup>9+</sup> | [PacMap](js-apis-inner-application-pacMap.md)[] | Yes| No| Extended attribute value of the tag technology.<br>**System API**: This is a system API.| | extrasData<sup>9+</sup> | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap)[] | Yes| No| Extended attribute value of the tag technology.<br>**System API**: This is a system API.|
| tagRfDiscId<sup>9+</sup> | number | Yes| No| ID allocated when the tag is discovered.<br>**System API**: This is a system API.| | tagRfDiscId<sup>9+</sup> | number | Yes| No| ID allocated when the tag is discovered.<br>**System API**: This is a system API.|
| remoteTagService<sup>9+</sup> | [rpc.RemoteObject](js-apis-rpc.md#remoteobject) | Yes| No| Remote object of the NFC service process used for interface communication between the client and the service.<br>**System API**: This is a system API.| | remoteTagService<sup>9+</sup> | [rpc.RemoteObject](js-apis-rpc.md#remoteobject) | Yes| No| Remote object of the NFC service process used for interface communication between the client and the service.<br>**System API**: This is a system API.|
......
...@@ -52,11 +52,11 @@ try { ...@@ -52,11 +52,11 @@ try {
overlay.setOverlayEnabled(moduleName, isEnabled) overlay.setOverlayEnabled(moduleName, isEnabled)
.then(() => { .then(() => {
console.info('setOverlayEnabled success'); console.info('setOverlayEnabled success');
}).catch((error) => { }).catch((err) => {
console.info('setOverlayEnabled failed due to error code: ' + err.code + ' ' + 'message:' + err.message); console.info('setOverlayEnabled failed due to err code: ' + err.code + ' ' + 'message:' + err.message);
}); });
} catch (error) { } catch (err) {
console.info('setOverlayEnabled failed due to error code: ' + err.code + ' ' + 'message:' + err.message); console.info('setOverlayEnabled failed due to err code: ' + err.code + ' ' + 'message:' + err.message);
} }
``` ```
...@@ -92,15 +92,15 @@ var moduleName = "feature"; ...@@ -92,15 +92,15 @@ var moduleName = "feature";
var isEnabled = false; var isEnabled = false;
try { try {
overlay.setOverlayEnabled(moduleName, isEnabled, (error, data) => { overlay.setOverlayEnabled(moduleName, isEnabled, (err, data) => {
if (error) { if (err) {
console.info('setOverlayEnabled failed due to error code: ' + err.code + ' ' + 'message:' + err.message); console.info('setOverlayEnabled failed due to err code: ' + err.code + ' ' + 'message:' + err.message);
return; return;
} }
console.info('setOverlayEnabled success'); console.info('setOverlayEnabled success');
}); });
} catch (error) { } catch (err) {
console.info('setOverlayEnabled failed due to error code: ' + err.code + ' ' + 'message:' + err.message); console.info('setOverlayEnabled failed due to err code: ' + err.code + ' ' + 'message:' + err.message);
} }
``` ```
...@@ -145,18 +145,18 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -145,18 +145,18 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
```ts ```ts
var bundleName = "com.example.myapplication_xxxxx"; var bundleName = "com.example.myapplication_xxxxx";
var moduleName = "feature" var moduleName = "feature";
var isEnabled = false; var isEnabled = false;
try { try {
overlay.setOverlayEnabledByBundleName(bundleName, moduleName, isEnabled) overlay.setOverlayEnabledByBundleName(bundleName, moduleName, isEnabled)
.then((data) => { .then((data) => {
console.info('setOverlayEnabledByBundleName successfully'); console.info('setOverlayEnabledByBundleName successfully');
}).catch((error) => { }).catch((err) => {
console.info('setOverlayEnabledByBundleName failed due to error code: ' + err.code + ' ' + 'message:' + err.message); console.info('setOverlayEnabledByBundleName failed due to err code: ' + err.code + ' ' + 'message:' + err.message);
}); });
} catch (error) { } catch (err) {
console.info('setOverlayEnabledByBundleName failed due to error code: ' + err.code + ' ' + 'message:' + err.message); console.info('setOverlayEnabledByBundleName failed due to err code: ' + err.code + ' ' + 'message:' + err.message);
} }
``` ```
...@@ -196,19 +196,19 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -196,19 +196,19 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
```ts ```ts
var bundleName = "com.example.myapplication_xxxxx"; var bundleName = "com.example.myapplication_xxxxx";
var moduleName = "feature" var moduleName = "feature";
var isEnabled = false; var isEnabled = false;
try { try {
overlay.setOverlayEnabledByBundleName(bundleName, moduleName, isEnabled, (error, data) => { overlay.setOverlayEnabledByBundleName(bundleName, moduleName, isEnabled, (err, data) => {
if (error) { if (err) {
console.info('setOverlayEnabledByBundleName failed due to error code: ' + err.code + ' ' + 'message:' + err.message); console.info('setOverlayEnabledByBundleName failed due to err code: ' + err.code + ' ' + 'message:' + err.message);
return; return;
} }
console.info('setOverlayEnabledByBundleName successfully'); console.info('setOverlayEnabledByBundleName successfully');
}); });
} catch (error) { } catch (err) {
console.info('setOverlayEnabledByBundleName failed due to error code: ' + err.code + ' ' + 'message:' + err.message); console.info('setOverlayEnabledByBundleName failed due to err code: ' + err.code + ' ' + 'message:' + err.message);
} }
``` ```
...@@ -245,14 +245,14 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -245,14 +245,14 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
var moduleName = "feature" var moduleName = "feature";
(async() => { (async() => {
try { try {
let overlayModuleInfo = await overlay.getOverlayModuleInfo(moduleName); let overlayModuleInfo = await overlay.getOverlayModuleInfo(moduleName);
console.log('overlayModuleInfo is ' + JSON.stringify(overlayModuleInfo)); console.log('overlayModuleInfo is ' + JSON.stringify(overlayModuleInfo));
} catch(err) { } catch(err) {
console.log('getOverlayModuleInfo failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getOverlayModuleInfo failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
} }
})(); })();
``` ```
...@@ -279,23 +279,23 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -279,23 +279,23 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700002 | The specified module name is not found. | | 17700002 | The specified module name is not found. |
| 17700032 | he specified bundle does not contain any overlay module. | | 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. | | 17700033 | The specified module is not an overlay module. |
**Example** **Example**
```ts ```ts
var moduleName = "feature" var moduleName = "feature";
try { try {
overlay.getOverlayModuleInfo(moduleName, (error, data) => { overlay.getOverlayModuleInfo(moduleName, (err, data) => {
if (error) { if (err) {
console.log('getOverlayModuleInfo failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getOverlayModuleInfo failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
return; return;
} }
console.log('overlayModuleInfo is ' + JSON.stringify(data)); console.log('overlayModuleInfo is ' + JSON.stringify(data));
}); });
} catch (error) { } catch (err) {
console.log('getOverlayModuleInfo failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getOverlayModuleInfo failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
} }
``` ```
...@@ -331,14 +331,14 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -331,14 +331,14 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
var targetModuleName = "feature" var targetModuleName = "feature";
(async() => { (async() => {
try { try {
let overlayModuleInfos = await overlay.getTargetOverlayModuleInfos(targetModuleName); let overlayModuleInfos = await overlay.getTargetOverlayModuleInfos(targetModuleName);
console.log('overlayModuleInfos are ' + JSON.stringify(overlayModuleInfos)); console.log('overlayModuleInfos are ' + JSON.stringify(overlayModuleInfos));
} catch(err) { } catch(err) {
console.log('getTargetOverlayModuleInfos failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getTargetOverlayModuleInfos failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
} }
})(); })();
``` ```
...@@ -370,17 +370,17 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -370,17 +370,17 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
**Example** **Example**
```ts ```ts
var targetModuleName = "feature" var targetModuleName = "feature";
try { try {
overlay.getTargetOverlayModuleInfos(targetModuleName, (error, data) => { overlay.getTargetOverlayModuleInfos(targetModuleName, (err, data) => {
if (error) { if (err) {
console.log('getTargetOverlayModuleInfos failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getTargetOverlayModuleInfos failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
return; return;
} }
console.log('overlayModuleInfo is ' + JSON.stringify(data)); console.log('overlayModuleInfo is ' + JSON.stringify(data));
}); });
} catch (error) { } catch (err) {
console.log('getTargetOverlayModuleInfos failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getTargetOverlayModuleInfos failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
} }
``` ```
...@@ -401,7 +401,7 @@ Obtains the information about a module with the overlay feature in another appli ...@@ -401,7 +401,7 @@ Obtains the information about a module with the overlay feature in another appli
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- | | ----------- | ------ | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of the application. |
| moduleName | string | No | HAP name of the module with the overlay feature. If this parameter is not specified, the API obtains the information of all modules with the overlay feature in that application. | | moduleName | string | No | HAP name of the module with the overlay feature. By default, no value is passed, and the API obtains the information of all modules with the overlay feature in that application. |
**Return value** **Return value**
...@@ -424,14 +424,14 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -424,14 +424,14 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
```ts ```ts
var bundleName = "com.example.myapplication_xxxxx"; var bundleName = "com.example.myapplication_xxxxx";
var moduleName = "feature" var moduleName = "feature";
(async() => { (async() => {
try { try {
let overlayModuleInfos = await overlay.getOverlayModuleInfoByBundleName(bundleName, moduleName); let overlayModuleInfos = await overlay.getOverlayModuleInfoByBundleName(bundleName, moduleName);
console.log('overlayModuleInfos are ' + JSON.stringify(overlayModuleInfos)); console.log('overlayModuleInfos are ' + JSON.stringify(overlayModuleInfos));
} catch(err) { } catch(err) {
console.log('getTargetOverlayModuleInfos failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getTargetOverlayModuleInfos failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
} }
})(); })();
``` ```
...@@ -471,18 +471,18 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -471,18 +471,18 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
```ts ```ts
var bundleName = "com.example.myapplication_xxxxx"; var bundleName = "com.example.myapplication_xxxxx";
var moduleName = "feature" var moduleName = "feature";
try { try {
overlay.getOverlayModuleInfoByBundleName(bundleName, moduleName, (error, data) => { overlay.getOverlayModuleInfoByBundleName(bundleName, moduleName, (err, data) => {
if (error) { if (err) {
console.log('getOverlayModuleInfoByBundleName failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getOverlayModuleInfoByBundleName failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
return; return;
} }
console.log('overlayModuleInfo is ' + JSON.stringify(data)); console.log('overlayModuleInfo is ' + JSON.stringify(data));
}); });
} catch (error) { } catch (err) {
console.log('getOverlayModuleInfoByBundleName failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getOverlayModuleInfoByBundleName failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
} }
``` ```
...@@ -512,9 +512,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -512,9 +512,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found. | | 17700001 | The specified bundleName is not found. |
| 17700002 | The specified module name is not found. |
| 17700032 | The specified bundle does not contain any overlay module. | | 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
**Example** **Example**
...@@ -522,15 +520,15 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -522,15 +520,15 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
var bundleName = "com.example.myapplication_xxxxx"; var bundleName = "com.example.myapplication_xxxxx";
try { try {
overlay.getOverlayModuleInfoByBundleName(bundleName, (error, data) => { overlay.getOverlayModuleInfoByBundleName(bundleName, (err, data) => {
if (error) { if (err) {
console.log('getOverlayModuleInfoByBundleName failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getOverlayModuleInfoByBundleName failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
return; return;
} }
console.log('overlayModuleInfo is ' + JSON.stringify(data)); console.log('overlayModuleInfo is ' + JSON.stringify(data));
}); });
} catch (error) { } catch (err) {
console.log('getOverlayModuleInfoByBundleName failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getOverlayModuleInfoByBundleName failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
} }
``` ```
...@@ -551,7 +549,7 @@ Obtains the information about modules with the overlay feature in another applic ...@@ -551,7 +549,7 @@ Obtains the information about modules with the overlay feature in another applic
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- | | ----------- | ------ | ---- | --------------------------------------- |
| targetBundleName | string | Yes | Bundle name of the application. | | targetBundleName | string | Yes | Bundle name of the application. |
| moduleName | string | No | HAP name of the target module, which is **targetModuleName** specified by modules with the overlay feature. If this parameter is not specified, the API obtains the information associated with all modules in that application. | | moduleName | string | No | HAP name of the target module, which is **targetModuleName** specified by modules with the overlay feature. By default, no value is passed, and the API obtains the information associated with all modules in that application. |
**Return value** **Return value**
...@@ -574,21 +572,21 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -574,21 +572,21 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
```ts ```ts
var targetBundleName = "com.example.myapplication_xxxxx"; var targetBundleName = "com.example.myapplication_xxxxx";
var moduleName = "feature" var moduleName = "feature";
(async() => { (async() => {
try { try {
let overlayModuleInfos = await overlay.getTargetOverlayModuleInfosByBundleName(targetBundleName, moduleName); let overlayModuleInfos = await overlay.getTargetOverlayModuleInfosByBundleName(targetBundleName, moduleName);
console.log('overlayModuleInfos are ' + JSON.stringify(overlayModuleInfos)); console.log('overlayModuleInfos are ' + JSON.stringify(overlayModuleInfos));
} catch(err) { } catch(err) {
console.log('getTargetOverlayModuleInfosByBundleName failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getTargetOverlayModuleInfosByBundleName failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
} }
})(); })();
``` ```
## overlay.getTargetOverlayModuleInfosByBundleName ## overlay.getTargetOverlayModuleInfosByBundleName
getTargetOverlayModuleInfosByBundleName(targetBundleName: string, moduleName: string, callback: AsyncCallback\<Array<OverlayModuleInfo>>): void; getTargetOverlayModuleInfosByBundleName(targetBundleName: string, moduleName: string, callback: AsyncCallback&lt;Array&lt;OverlayModuleInfo&gt;&gt;): void;
Obtains the information about modules with the overlay feature in another application based on the target module name. This API uses an asynchronous callback to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned. Obtains the information about modules with the overlay feature in another application based on the target module name. This API uses an asynchronous callback to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned.
...@@ -621,24 +619,24 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -621,24 +619,24 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
```ts ```ts
var targetBundleName = "com.example.myapplication_xxxxx"; var targetBundleName = "com.example.myapplication_xxxxx";
var moduleName = "feature" var moduleName = "feature";
try { try {
overlay.getTargetOverlayModuleInfosByBundleName(targetBundleName, moduleName, (error, data) => { overlay.getTargetOverlayModuleInfosByBundleName(targetBundleName, moduleName, (err, data) => {
if (error) { if (err) {
console.log('getTargetOverlayModuleInfosByBundleName failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getTargetOverlayModuleInfosByBundleName failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
return; return;
} }
console.log('overlayModuleInfo is ' + JSON.stringify(data)); console.log('overlayModuleInfo is ' + JSON.stringify(data));
}); });
} catch (error) { } catch (err) {
console.log('getTargetOverlayModuleInfosByBundleName failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getTargetOverlayModuleInfosByBundleName failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
} }
``` ```
## overlay.getTargetOverlayModuleInfosByBundleName ## overlay.getTargetOverlayModuleInfosByBundleName
getTargetOverlayModuleInfosByBundleName(targetBundleName: string, callback: AsyncCallback\<Array<OverlayModuleInfo>>): void; getTargetOverlayModuleInfosByBundleName(targetBundleName: string, callback: AsyncCallback&lt;Array&lt;OverlayModuleInfo&gt;&gt;): void;
Obtains the information about all modules with the overlay feature in another application. This API uses an asynchronous callback to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned. Obtains the information about all modules with the overlay feature in another application. This API uses an asynchronous callback to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned.
...@@ -662,8 +660,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -662,8 +660,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found. | | 17700001 | The specified bundleName is not found. |
| 17700002 | The specified module name is not found. |
| 17700034 | The specified module is an overlay module. |
| 17700035 | The specified bundle is an overlay bundle. | | 17700035 | The specified bundle is an overlay bundle. |
**Example** **Example**
...@@ -672,15 +668,15 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -672,15 +668,15 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
var targetBundleName = "com.example.myapplication_xxxxx"; var targetBundleName = "com.example.myapplication_xxxxx";
try { try {
overlay.getTargetOverlayModuleInfosByBundleName(targetBundleName, (error, data) => { overlay.getTargetOverlayModuleInfosByBundleName(targetBundleName, (err, data) => {
if (error) { if (err) {
console.log('getTargetOverlayModuleInfosByBundleName failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getTargetOverlayModuleInfosByBundleName failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
return; return;
} }
console.log('overlayModuleInfo is ' + JSON.stringify(data)); console.log('overlayModuleInfo is ' + JSON.stringify(data));
}); });
} catch (error) { } catch (err) {
console.log('getTargetOverlayModuleInfosByBundleName failed due to error code : ' + err.code + ' ' + 'message :' + err.message); console.log('getTargetOverlayModuleInfosByBundleName failed due to err code : ' + err.code + ' ' + 'message :' + err.message);
} }
``` ```
......
...@@ -51,10 +51,10 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -51,10 +51,10 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
| ---- | --------------------- | | ---- | --------------------- |
| 9800001 | Memory operation failed. | | 9800001 | Memory operation failed. |
| 9800002 | Parcel operation failed. | | 9800002 | Parcel operation failed. |
| 9800003 | IPC failed. | | | 9800003 | Inner transact failed. | |
| 9800004 | System service operation failed. | | 9800004 | System service operation failed. |
| 9900001 | Caller information verification failed for a transient task. | | 9900001 | Caller information verification failed. |
| 9900002 | Transient task verification failed. | | 9900002 | Background task verification failed. |
**Example** **Example**
...@@ -76,7 +76,7 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -76,7 +76,7 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
``` ```
## backgroundTaskManager.getRemainingDelayTime:callback ## backgroundTaskManager.getRemainingDelayTime
getRemainingDelayTime(requestId: number, callback: AsyncCallback&lt;number&gt;): void getRemainingDelayTime(requestId: number, callback: AsyncCallback&lt;number&gt;): void
...@@ -99,10 +99,10 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -99,10 +99,10 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
| ---- | --------------------- | | ---- | --------------------- |
| 9800001 | Memory operation failed. | | 9800001 | Memory operation failed. |
| 9800002 | Parcel operation failed. | | 9800002 | Parcel operation failed. |
| 9800003 | IPC failed. | | | 9800003 | Inner transact failed. |
| 9800004 | System service operation failed. | | 9800004 | System service operation failed. |
| 9900001 | Caller information verification failed for a transient task. | | 9900001 | Caller information verification failed. |
| 9900002 | Transient task verification failed. | | 9900002 | Background task verification failed. |
**Example** **Example**
...@@ -125,7 +125,7 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -125,7 +125,7 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
``` ```
## backgroundTaskManager.getRemainingDelayTime:promise ## backgroundTaskManager.getRemainingDelayTime
getRemainingDelayTime(requestId: number): Promise&lt;number&gt; getRemainingDelayTime(requestId: number): Promise&lt;number&gt;
...@@ -155,10 +155,10 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -155,10 +155,10 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
| ---- | --------------------- | | ---- | --------------------- |
| 9800001 | Memory operation failed. | | 9800001 | Memory operation failed. |
| 9800002 | Parcel operation failed. | | 9800002 | Parcel operation failed. |
| 9800003 | IPC failed. | | | 9800003 | Inner transact failed. | |
| 9800004 | System service operation failed. | | 9800004 | System service operation failed. |
| 9900001 | Caller information verification failed for a transient task. | | 9900001 | Caller information verification failed. |
| 9900002 | Transient task verification failed. | | 9900002 | Background task verification failed. |
**Example** **Example**
...@@ -200,10 +200,10 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -200,10 +200,10 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
| ---- | --------------------- | | ---- | --------------------- |
| 9800001 | Memory operation failed. | | 9800001 | Memory operation failed. |
| 9800002 | Parcel operation failed. | | 9800002 | Parcel operation failed. |
| 9800003 | IPC failed. | | | 9800003 | Inner transact failed. | |
| 9800004 | System service operation failed. | | 9800004 | System service operation failed. |
| 9900001 | Caller information verification failed for a transient task. | | 9900001 | Caller information verification failed. |
| 9900002 | Transient task verification failed. | | 9900002 | Background task verification failed. |
**Example** **Example**
...@@ -219,7 +219,7 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -219,7 +219,7 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
``` ```
## backgroundTaskManager.startBackgroundRunning:callback ## backgroundTaskManager.startBackgroundRunning
startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback&lt;void&gt;): void startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback&lt;void&gt;): void
...@@ -246,9 +246,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -246,9 +246,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
| ---- | --------------------- | | ---- | --------------------- |
| 9800001 | Memory operation failed. | | 9800001 | Memory operation failed. |
| 9800002 | Parcel operation failed. | | 9800002 | Parcel operation failed. |
| 9800003 | IPC failed. | | | 9800003 | Inner transact failed. | |
| 9800004 | System service operation failed. | | 9800004 | System service operation failed. |
| 9800005 | Continuous task verification failed. | | 9800005 | Background task verification failed. |
| 9800006 | Notification verification failed. | | 9800006 | Notification verification failed. |
| 9800007 | Task storage failed. | | 9800007 | Task storage failed. |
...@@ -297,7 +297,7 @@ export default class EntryAbility extends UIAbility { ...@@ -297,7 +297,7 @@ export default class EntryAbility extends UIAbility {
}; };
``` ```
## backgroundTaskManager.startBackgroundRunning:promise ## backgroundTaskManager.startBackgroundRunning
startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise&lt;void&gt; startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise&lt;void&gt;
...@@ -329,9 +329,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -329,9 +329,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
| ---- | --------------------- | | ---- | --------------------- |
| 9800001 | Memory operation failed. | | 9800001 | Memory operation failed. |
| 9800002 | Parcel operation failed. | | 9800002 | Parcel operation failed. |
| 9800003 | IPC failed. | | | 9800003 | Inner transact failed. | |
| 9800004 | System service operation failed. | | 9800004 | System service operation failed. |
| 9800005 | Continuous task verification failed. | | 9800005 | Background task verification failed. |
| 9800006 | Notification verification failed. | | 9800006 | Notification verification failed. |
| 9800007 | Task storage failed. | | 9800007 | Task storage failed. |
...@@ -376,7 +376,7 @@ export default class EntryAbility extends UIAbility { ...@@ -376,7 +376,7 @@ export default class EntryAbility extends UIAbility {
}; };
``` ```
## backgroundTaskManager.stopBackgroundRunning:callback ## backgroundTaskManager.stopBackgroundRunning
stopBackgroundRunning(context: Context, callback: AsyncCallback&lt;void&gt;): void stopBackgroundRunning(context: Context, callback: AsyncCallback&lt;void&gt;): void
...@@ -399,9 +399,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -399,9 +399,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
| ---- | --------------------- | | ---- | --------------------- |
| 9800001 | Memory operation failed. | | 9800001 | Memory operation failed. |
| 9800002 | Parcel operation failed. | | 9800002 | Parcel operation failed. |
| 9800003 | IPC failed. | | | 9800003 | Inner transact failed. | |
| 9800004 | System service operation failed. | | 9800004 | System service operation failed. |
| 9800005 | Continuous task verification failed. | | 9800005 | Background task verification failed. |
| 9800006 | Notification verification failed. | | 9800006 | Notification verification failed. |
| 9800007 | Task storage failed. | | 9800007 | Task storage failed. |
...@@ -430,7 +430,7 @@ export default class EntryAbility extends UIAbility { ...@@ -430,7 +430,7 @@ export default class EntryAbility extends UIAbility {
}; };
``` ```
## backgroundTaskManager.stopBackgroundRunning:promise ## backgroundTaskManager.stopBackgroundRunning
stopBackgroundRunning(context: Context): Promise&lt;void&gt; stopBackgroundRunning(context: Context): Promise&lt;void&gt;
...@@ -460,9 +460,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -460,9 +460,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
| ---- | --------------------- | | ---- | --------------------- |
| 9800001 | Memory operation failed. | | 9800001 | Memory operation failed. |
| 9800002 | Parcel operation failed. | | 9800002 | Parcel operation failed. |
| 9800003 | IPC failed. | | | 9800003 | Inner transact failed. | |
| 9800004 | System service operation failed. | | 9800004 | System service operation failed. |
| 9800005 | Continuous task verification failed. | | 9800005 | Background task verification failed. |
| 9800006 | Notification verification failed. | | 9800006 | Notification verification failed. |
| 9800007 | Task storage failed. | | 9800007 | Task storage failed. |
...@@ -513,9 +513,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -513,9 +513,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
| ---- | --------------------- | | ---- | --------------------- |
| 9800001 | Memory operation failed. | | 9800001 | Memory operation failed. |
| 9800002 | Parcel operation failed. | | 9800002 | Parcel operation failed. |
| 9800003 | IPC failed. | | | 9800003 | Inner transact failed. | |
| 9800004 | System service operation failed. | | 9800004 | System service operation failed. |
| 18700001 | Caller information verification failed when applying for efficiency resources. | | 18700001 | Caller information verification failed. |
**Example** **Example**
...@@ -556,9 +556,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er ...@@ -556,9 +556,9 @@ For details about the error codes, see [backgroundTaskManager Error Codes](../er
| ---- | --------------------- | | ---- | --------------------- |
| 9800001 | Memory operation failed. | | 9800001 | Memory operation failed. |
| 9800002 | Parcel operation failed. | | 9800002 | Parcel operation failed. |
| 9800003 | IPC failed. | | | 9800003 | Inner transact failed. | |
| 9800004 | System service operation failed. | | 9800004 | System service operation failed. |
| 18700001 | Caller information verification failed when applying for efficiency resources. | | 18700001 | Caller information verification failed. |
**Example** **Example**
......
...@@ -1549,10 +1549,10 @@ Provides the usage duration information of an application. ...@@ -1549,10 +1549,10 @@ Provides the usage duration information of an application.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------------ | ------ | ---- | ---------------------------------------- | | ------------------------ | ------ | ---- | ---------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | No | Bundle name of the application. |
| abilityPrevAccessTime | number | Yes | Last time when the application was used. | | abilityPrevAccessTime | number | No | Last time when the application was used. |
| abilityInFgTotalTime | number | Yes | Total time that the application runs in the foreground. | | abilityInFgTotalTime | number | No | Total time that the application runs in the foreground. |
| id | number | No | User ID.| | id | number | Yes | User ID.|
| abilityPrevSeenTime | number | No | Last time when the application was visible in the foreground.| | abilityPrevSeenTime | number | No | Last time when the application was visible in the foreground.|
| abilitySeenTotalTime | number | No | Total time that the application is visible in the foreground.| | abilitySeenTotalTime | number | No | Total time that the application is visible in the foreground.|
| fgAbilityAccessTotalTime | number | No | Total time that the application accesses the foreground.| | fgAbilityAccessTotalTime | number | No | Total time that the application accesses the foreground.|
...@@ -1570,9 +1570,9 @@ Provides information about an application event. ...@@ -1570,9 +1570,9 @@ Provides information about an application event.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| --------------------- | ------ | ---- | ---------------------------------------- | | --------------------- | ------ | ---- | ---------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | No | Bundle name of the application. |
| eventId | number | Yes | Application event type. | | eventId | number | No | Application event type. |
| eventOccurredTime | number | Yes | Timestamp when the application event occurs. | | eventOccurredTime | number | No | Timestamp when the application event occurs. |
| appGroup | number | No | Usage priority group of the application.| | appGroup | number | No | Usage priority group of the application.|
| indexOfLink | string | No | Shortcut ID.| | indexOfLink | string | No | Shortcut ID.|
| nameOfClass | string | No | Class name.| | nameOfClass | string | No | Class name.|
...@@ -1587,7 +1587,7 @@ Provides the usage duration information of an application. ...@@ -1587,7 +1587,7 @@ Provides the usage duration information of an application.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------------------ | ---------------------------------------- | ---- | -------------- | | ------------------------------ | ---------------------------------------- | ---- | -------------- |
| [key: string]: BundleStatsInfo | [key: string]: [BundleStatsInfo](#bundlestatsinfo) | Yes | Usage duration information by application.| | [key: string] | [BundleStatsInfo](#bundlestatsinfo) | Yes | Usage duration information by application.|
## DeviceEventStats ## DeviceEventStats
......
...@@ -89,7 +89,7 @@ Subscribes to data changes of the compass sensor. If this API is called multiple ...@@ -89,7 +89,7 @@ Subscribes to data changes of the compass sensor. If this API is called multiple
```js ```js
sensor.subscribeCompass({ sensor.subscribeCompass({
success: function(ret) { success: function(ret) {
console.log('get data direction:' + ret.direction); console.log('Get data direction:' + ret.direction);
}, },
fail: function(data, code) { fail: function(data, code) {
console.error('Subscription failed. Code: ' + code + '; Data: ' + data); console.error('Subscription failed. Code: ' + code + '; Data: ' + data);
...@@ -133,7 +133,7 @@ Subscribes to data changes of the proximity sensor. If this API is called multip ...@@ -133,7 +133,7 @@ Subscribes to data changes of the proximity sensor. If this API is called multip
```js ```js
sensor.subscribeProximity({ sensor.subscribeProximity({
success: function(ret) { success: function(ret) {
console.log('get data distance:' + ret.distance); console.log('Get data distance:' + ret.distance);
}, },
fail: function(data, code) { fail: function(data, code) {
console.error('Subscription failed. Code: ' + code + '; Data: ' + data); console.error('Subscription failed. Code: ' + code + '; Data: ' + data);
...@@ -177,7 +177,7 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu ...@@ -177,7 +177,7 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu
```js ```js
sensor.subscribeLight({ sensor.subscribeLight({
success: function(ret) { success: function(ret) {
console.log('get data intensity:' + ret.intensity); console.log('Get data intensity:' + ret.intensity);
}, },
fail: function(data, code) { fail: function(data, code) {
console.error('Subscription failed. Code: ' + code + '; Data: ' + data); console.error('Subscription failed. Code: ' + code + '; Data: ' + data);
...@@ -223,7 +223,7 @@ Subscribes to data changes of the step counter sensor. If this API is called mul ...@@ -223,7 +223,7 @@ Subscribes to data changes of the step counter sensor. If this API is called mul
```js ```js
sensor.subscribeStepCounter({ sensor.subscribeStepCounter({
success: function(ret) { success: function(ret) {
console.log('get step value:' + ret.steps); console.log('Get step value:' + ret.steps);
}, },
fail: function(data, code) { fail: function(data, code) {
console.log('Subscription failed. Code: ' + code + '; Data: ' + data); console.log('Subscription failed. Code: ' + code + '; Data: ' + data);
...@@ -270,7 +270,7 @@ Subscribes to data changes of the barometer sensor. If this API is called multip ...@@ -270,7 +270,7 @@ Subscribes to data changes of the barometer sensor. If this API is called multip
```js ```js
sensor.subscribeBarometer({ sensor.subscribeBarometer({
success: function(ret) { success: function(ret) {
console.log('get data value:' + ret.pressure); console.log('Get data value:' + ret.pressure);
}, },
fail: function(data, code) { fail: function(data, code) {
console.log('Subscription failed. Code: ' + code + '; Data: ' + data); console.log('Subscription failed. Code: ' + code + '; Data: ' + data);
...@@ -318,7 +318,7 @@ Subscribes to data changes of the heart rate sensor. If this API is called multi ...@@ -318,7 +318,7 @@ Subscribes to data changes of the heart rate sensor. If this API is called multi
```js ```js
sensor.subscribeHeartRate({ sensor.subscribeHeartRate({
success: function(ret) { success: function(ret) {
console.log('get heartrate value:' + ret.heartRate); console.log('Get heartrate value:' + ret.heartRate);
}, },
fail: function(data, code) { fail: function(data, code) {
console.log('Subscription failed. Code: ' + code + '; Data: ' + data); console.log('Subscription failed. Code: ' + code + '; Data: ' + data);
...@@ -365,7 +365,7 @@ Subscribes to changes of the wearing state of a wearable device. If this API is ...@@ -365,7 +365,7 @@ Subscribes to changes of the wearing state of a wearable device. If this API is
```js ```js
sensor.subscribeOnBodyState({ sensor.subscribeOnBodyState({
success: function(ret) { success: function(ret) {
console.log('get on-body state value:' + ret.value); console.log('Get on-body state value:' + ret.value);
}, },
fail: function(data, code) { fail: function(data, code) {
console.log('Subscription failed. Code: ' + code + '; Data: ' + data); console.log('Subscription failed. Code: ' + code + '; Data: ' + data);
...@@ -409,7 +409,7 @@ Obtains the wearing state of a wearable device. ...@@ -409,7 +409,7 @@ Obtains the wearing state of a wearable device.
```js ```js
sensor.getOnBodyState({ sensor.getOnBodyState({
success: function(ret) { success: function(ret) {
console.log('on body state: ' + ret.value); console.log('On body state: ' + ret.value);
}, },
fail: function(data, code) { fail: function(data, code) {
console.log('Subscription failed. Code: ' + code + '; Data: ' + data); console.log('Subscription failed. Code: ' + code + '; Data: ' + data);
...@@ -710,7 +710,7 @@ Defines the wearing state. ...@@ -710,7 +710,7 @@ Defines the wearing state.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------- | ---- | ------------------------ | | -------- | ------------------------------------------- | ---- | ------------------------ |
| success | [OnBodyStateResponse](#onbodystateresponse) | No | Callback upon a successful API call.| | success | [OnBodyStateResponse](#onbodystateresponse) | Yes | Callback upon a successful API call.|
| fail | Function | No | Callback upon an API call failure.| | fail | Function | No | Callback upon an API call failure.|
| complete | Function | No | Called when the API call is complete.| | complete | Function | No | Called when the API call is complete.|
......
...@@ -4,8 +4,8 @@ The **userFileManager** module provides user data management capabilities, inclu ...@@ -4,8 +4,8 @@ The **userFileManager** module provides user data management capabilities, inclu
> **NOTE** > **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 provided by this module are system APIs. > - The APIs provided by this module are system APIs.
## Modules to Import ## Modules to Import
...@@ -49,11 +49,8 @@ let mgr = userFileManager.getUserFileMgr(context); ...@@ -49,11 +49,8 @@ let mgr = userFileManager.getUserFileMgr(context);
getPhotoAssets(options: FetchOptions, callback: AsyncCallback&lt;FetchResult&lt;FileAsset&gt;&gt;): void; getPhotoAssets(options: FetchOptions, callback: AsyncCallback&lt;FetchResult&lt;FileAsset&gt;&gt;): void;
Obtains image and video assets. This API uses an asynchronous callback to return the result. Obtains image and video assets. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.FileManagement.UserFileManager.Core **System capability**: SystemCapability.FileManagement.UserFileManager.Core
**Required permissions**: ohos.permission.READ_IMAGEVIDEO **Required permissions**: ohos.permission.READ_IMAGEVIDEO
...@@ -92,7 +89,6 @@ async function example() { ...@@ -92,7 +89,6 @@ async function example() {
} }
``` ```
### getPhotoAssets ### getPhotoAssets
getPhotoAssets(options: FetchOptions): Promise&lt;FetchResult&lt;FileAsset&gt;&gt;; getPhotoAssets(options: FetchOptions): Promise&lt;FetchResult&lt;FileAsset&gt;&gt;;
...@@ -141,6 +137,7 @@ async function example() { ...@@ -141,6 +137,7 @@ async function example() {
} }
} }
``` ```
### createPhotoAsset ### createPhotoAsset
createPhotoAsset(displayName: string, albumUri: string, callback: AsyncCallback&lt;FileAsset&gt;): void; createPhotoAsset(displayName: string, albumUri: string, callback: AsyncCallback&lt;FileAsset&gt;): void;
...@@ -261,7 +258,6 @@ async function example() { ...@@ -261,7 +258,6 @@ async function example() {
getPhotoAlbums(options: AlbumFetchOptions, callback: AsyncCallback&lt;FetchResult&lt;Album&gt;&gt;): void; getPhotoAlbums(options: AlbumFetchOptions, callback: AsyncCallback&lt;FetchResult&lt;Album&gt;&gt;): void;
Obtains image and video albums. This API uses an asynchronous callback to return the result. Obtains image and video albums. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.FileManagement.UserFileManager.Core **System capability**: SystemCapability.FileManagement.UserFileManager.Core
...@@ -352,7 +348,6 @@ async function example() { ...@@ -352,7 +348,6 @@ async function example() {
getPrivateAlbum(type: PrivateAlbumType, callback: AsyncCallback&lt;FetchResult&lt;PrivateAlbum&gt;&gt;): void; getPrivateAlbum(type: PrivateAlbumType, callback: AsyncCallback&lt;FetchResult&lt;PrivateAlbum&gt;&gt;): void;
Obtains the system album. This API uses an asynchronous callback to return the result. Obtains the system album. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.FileManagement.UserFileManager.Core **System capability**: SystemCapability.FileManagement.UserFileManager.Core
...@@ -424,7 +419,6 @@ async function example() { ...@@ -424,7 +419,6 @@ async function example() {
getAudioAssets(options: FetchOptions, callback: AsyncCallback&lt;FetchResult&lt;FileAsset&gt;&gt;): void; getAudioAssets(options: FetchOptions, callback: AsyncCallback&lt;FetchResult&lt;FileAsset&gt;&gt;): void;
Obtains audio assets. This API uses an asynchronous callback to return the result. Obtains audio assets. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.FileManagement.UserFileManager.Core **System capability**: SystemCapability.FileManagement.UserFileManager.Core
...@@ -469,7 +463,6 @@ async function example() { ...@@ -469,7 +463,6 @@ async function example() {
getAudioAssets(options: FetchOptions): Promise&lt;FetchResult&lt;FileAsset&gt;&gt;; getAudioAssets(options: FetchOptions): Promise&lt;FetchResult&lt;FileAsset&gt;&gt;;
Obtains audio assets. This API uses a promise to return the result. Obtains audio assets. This API uses a promise to return the result.
**System capability**: SystemCapability.FileManagement.UserFileManager.Core **System capability**: SystemCapability.FileManagement.UserFileManager.Core
...@@ -515,6 +508,7 @@ async function example() { ...@@ -515,6 +508,7 @@ async function example() {
} }
} }
``` ```
### delete ### delete
delete(uri: string, callback: AsyncCallback&lt;void&gt;): void; delete(uri: string, callback: AsyncCallback&lt;void&gt;): void;
...@@ -564,6 +558,7 @@ async function example() { ...@@ -564,6 +558,7 @@ async function example() {
}); });
} }
``` ```
### delete ### delete
delete(uri: string): Promise&lt;void&gt;; delete(uri: string): Promise&lt;void&gt;;
...@@ -1093,7 +1088,6 @@ Opens this file asset. This API uses an asynchronous callback to return the resu ...@@ -1093,7 +1088,6 @@ Opens this file asset. This API uses an asynchronous callback to return the resu
**Required permissions**: ohos.permission.READ_IMAGEVIDEO, ohos.permission.READ_AUDIO, ohos.permission.WRITE_IMAGEVIDEO, or ohos.permission.WRITE_AUDIO **Required permissions**: ohos.permission.READ_IMAGEVIDEO, ohos.permission.READ_AUDIO, ohos.permission.WRITE_IMAGEVIDEO, or ohos.permission.WRITE_AUDIO
**System capability**: SystemCapability.FileManagement.UserFileManager.Core **System capability**: SystemCapability.FileManagement.UserFileManager.Core
**Parameters** **Parameters**
...@@ -1923,6 +1917,7 @@ async function example() { ...@@ -1923,6 +1917,7 @@ async function example() {
}); });
} }
``` ```
### getPhotoAssets ### getPhotoAssets
getPhotoAssets(options: FetchOptions): Promise&lt;FetchResult&lt;FileAsset&gt;&gt;; getPhotoAssets(options: FetchOptions): Promise&lt;FetchResult&lt;FileAsset&gt;&gt;;
...@@ -2106,6 +2101,7 @@ async function example() { ...@@ -2106,6 +2101,7 @@ async function example() {
} }
``` ```
### getPhotoAssets ### getPhotoAssets
getPhotoAssets(options: FetchOptions): Promise&lt;FetchResult&lt;FileAsset&gt;&gt;; getPhotoAssets(options: FetchOptions): Promise&lt;FetchResult&lt;FileAsset&gt;&gt;;
...@@ -2147,6 +2143,7 @@ async function example() { ...@@ -2147,6 +2143,7 @@ async function example() {
console.info('fetchResult.count = ', count); console.info('fetchResult.count = ', count);
} }
``` ```
### delete ### delete
delete(uri: string, callback: AsyncCallback&lt;void&gt;): void; delete(uri: string, callback: AsyncCallback&lt;void&gt;): void;
...@@ -2190,6 +2187,7 @@ async function example() { ...@@ -2190,6 +2187,7 @@ async function example() {
}); });
} }
``` ```
### delete ### delete
delete(uri: string): Promise&lt;void&gt;; delete(uri: string): Promise&lt;void&gt;;
...@@ -2280,6 +2278,7 @@ async function example() { ...@@ -2280,6 +2278,7 @@ async function example() {
}); });
} }
``` ```
### recover ### recover
recover(uri: string): Promise&lt;void&gt;; recover(uri: string): Promise&lt;void&gt;;
...@@ -2335,9 +2334,9 @@ Enumerates the member types. ...@@ -2335,9 +2334,9 @@ Enumerates the member types.
| Name | Type| Readable | Writable | Description | | Name | Type| Readable | Writable | Description |
| ----- | ---- | ---- | ---- | ---- | | ----- | ---- | ---- | ---- | ---- |
| number | number | Yes| Yes| The member is a number.| | number | number | Yes| Yes| The member is a number.|
| string | string | Yes| Yes| The member is a string.| | string | string | Yes| Yes| The member is a string.|
| boolean | boolean | Yes| Yes| The member is a Boolean value.| | boolean | boolean | Yes| Yes| The member is a Boolean value.|
## ChangeEvent ## ChangeEvent
...@@ -2366,7 +2365,6 @@ Defines information about a registered device. ...@@ -2366,7 +2365,6 @@ Defines information about a registered device.
| networkId | string | Yes | No | Network ID of the registered device.| | networkId | string | Yes | No | Network ID of the registered device.|
| isOnline | boolean | Yes | No | Whether the registered device is online. | | isOnline | boolean | Yes | No | Whether the registered device is online. |
## FileType ## FileType
Enumerates media file types. Enumerates media file types.
...@@ -2390,8 +2388,6 @@ Enumerates the system album types. ...@@ -2390,8 +2388,6 @@ Enumerates the system album types.
| TYPE_FAVORITE | 0 | Favorites.| | TYPE_FAVORITE | 0 | Favorites.|
| TYPE_TRASH | 1 | Recycle bin.| | TYPE_TRASH | 1 | Recycle bin.|
## AudioKey ## AudioKey
Defines the key information about an audio file. Defines the key information about an audio file.
...@@ -2445,7 +2441,6 @@ Defines the key album information. ...@@ -2445,7 +2441,6 @@ Defines the key album information.
| DATE_ADDED | date_added | Date when the file was added. The value is the number of seconds elapsed since the Epoch time. | | DATE_ADDED | date_added | Date when the file was added. The value is the number of seconds elapsed since the Epoch time. |
| DATE_MODIFIED | date_modified | Date when the file content (not the file name) was last modified. The value is the number of seconds elapsed since the Epoch time.| | DATE_MODIFIED | date_modified | Date when the file content (not the file name) was last modified. The value is the number of seconds elapsed since the Epoch time.|
## FetchOptions ## FetchOptions
Defines the options for fetching media files. Defines the options for fetching media files.
......
...@@ -586,11 +586,11 @@ The version of shared bundle is dependent on other applications. ...@@ -586,11 +586,11 @@ The version of shared bundle is dependent on other applications.
**Description** **Description**
Other applications depend on the shared library, causing the uninstallation to fail. Other applications depend on the shared library, causing the uninstall to fail.
**Possible Causes** **Possible Causes**
1. The version specified during the uninstallation is the latest version of the shared library, and the shared library is depended on by other applications. 1. The version specified during the uninstall is the latest version of the shared library, and the shared library is depended on by other applications.
2. No version is not specified during the uninstallation, meaning that all versions of the shared library will be uninstalled, and the shared library is depended on by other applications. 2. No version is not specified during the uninstall, meaning that all versions of the shared library will be uninstalled, and the shared library is depended on by other applications.
**Solution** **Solution**
1. Check whether the shared library to uninstall is depended on by other applications. 1. Check whether the shared library to uninstall is depended on by other applications.
...@@ -607,7 +607,7 @@ The specified shared bundle does not exist. ...@@ -607,7 +607,7 @@ The specified shared bundle does not exist.
The shared library to uninstall does not exist. The shared library to uninstall does not exist.
**Possible Causes** **Possible Causes**
1. The version specified during the uninstallation is different from the version of the shared library installed. 1. The version specified during the uninstall is different from the version of the shared library installed.
2. The shared library to uninstall is not installed. 2. The shared library to uninstall is not installed.
**Solution** **Solution**
...@@ -649,3 +649,118 @@ During application uninstall, the bundle name of an inter-application shared lib ...@@ -649,3 +649,118 @@ During application uninstall, the bundle name of an inter-application shared lib
**Solution** **Solution**
1. Use the **-s** parameter to specify the application to be uninstalled as a shared library application. 1. Use the **-s** parameter to specify the application to be uninstalled as a shared library application.
2. Use the **bundleName** and **versionCode** parameters in **UninstallParam** to specify the bundle name and version of the shared library to be uninstalled. 2. Use the **bundleName** and **versionCode** parameters in **UninstallParam** to specify the bundle name and version of the shared library to be uninstalled.
## 17700041 Application Installation Is Not Allowed by Enterprise Device Management
**Error Message**
Failed to install because enterprise device management disallow install.
**Description**
The installation of this application is prohibited by enterprise device management.
**Possible Causes**
The enterprise device management does not allow the installation of this application.
**Solution**
Check whether the application installation is prohibited by the enterprise device management.
## 17700042 Incorrect URI in the Data Proxy
**Error Message**
Failed to install the HAP because of incorrect URI in the data proxy.
**Description**
During application installation, the URI of the data proxy is incorrectly configured.
**Possible Causes**
1. The bundle name in the URI is different from that of the current application.
2. The URI is duplicate.
**Solution**
1. Change the bundle name in the URI to that of the current application.
2. Change duplicate URIs. Ensure that the URI of each data proxy is unique.
## 17700043 Incorrect Permission Configuration in the Data Proxy
**Error Message**
Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core).
**Description**
During application installation, the permission level of the data proxy of a non-system application is too low. The permission level should be **system_basic** or **system_core**.
**Possible Causes**
1. No permission is configured for the data proxy of a non-system application.
1. The permission level of the data proxy of a non-system application is too low.
**Solution**
1. Configure the read and write permissions in the data proxy.
2. Change the read and write permissions in the data proxy and ensure that the permission level is **system_basic** or **system_core**.
## 17700044 Field isolationMode in the HAP Conflicts with the Device Isolation Mode
**Error Message**
Failed to install the HAP because the isolationMode configured is not supported.
**Description**
During application installation, the value of **isolationMode** in the HAP conflicts with the isolation mode of the device.
**Possible Causes**
1. The device supports the isolation mode (the value of **supportIsolationMode** is **true**), whereas the value of **isolationMode** in the HAP is **nonisolationOnly**.
2. The device does not support the isolation mode (the value of **supportIsolationMode** is **false**), whereas the value of **isolationMode** in the HAP is **isolationOnly**.
**Solution**
Set the **isolationMode** field in the HAP based on the isolation mode of the device.
## 17700045 Application Uninstall Is Not Allowed by Enterprise Device Management
**Error Message**
Failed to uninstall because enterprise device management disallow uninstall.
**Description**
The uninstall of this application is prohibited by enterprise device management.
**Possible Causes**
The enterprise device management does not allow the uninstall of this application.
**Solution**
Check whether the application uninstall is prohibited by the enterprise device management.
## 17700047 Application Version To Be Updated Is Not Later Than the Current Version
**Error Message**
Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode.
**Description**
The version of the application to be updated is not later than the current version.
**Possible Causes**
1. The version number of the application to be updated is earlier than or equal to that of the current version number.
2. When **installFlag** is set to **NORMAL**, the version number of the application to be updated must be later than the installed version number.
**Solution**
1. Set the version number of the application to be later than the current version number.
2. If you want to update the application without changing the version number, set **installFlag** to **REPLACE_EXISTING**.
此差异已折叠。
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
- [Configuring Parameters for Accelerating Local Build](subsys-build-reference.md) - [Configuring Parameters for Accelerating Local Build](subsys-build-reference.md)
- [Viewing Ninja Build Information](subsys-build-reference.md) - [Viewing Ninja Build Information](subsys-build-reference.md)
- [HAP Build Guide](subsys-build-gn-hap-compilation-guide.md) - [HAP Build Guide](subsys-build-gn-hap-compilation-guide.md)
- Rust Build Guide
- [Rust Module Configuration Rules and Guide](subsys-build-rust-compilation.md)
- [Using Interactive Tools](subsys-build-bindgen-cxx-guide.md)
- [Using Cargo2gn](subsys-build-cargo2gn-guide.md)
- [FAQs](subsys-build-FAQ.md) - [FAQs](subsys-build-FAQ.md)
- [ArkCompiler Development](subsys-arkcompiler-guide.md) - [ArkCompiler Development](subsys-arkcompiler-guide.md)
- [Distributed Remote Startup](subsys-remote-start.md) - [Distributed Remote Startup](subsys-remote-start.md)
......
此差异已折叠。
# Ability Framework Changelog
Compared with OpenHarmony 3.2 Release, OpenHarmony 3.2.12.2 provides more detailed error code information for the APIs of the ability framework.
## cl.ability.1 Added and Optimized API Error Code Description
The error code description and all error codes that may be returned by the APIs are commented out. This helps developers control the error process more accurately.
**Change Impact**
The external declaration of the JS APIs of API version 9 is affected, but the API functionalities are not affected. You can determine whether to adapt to the JS APIs.
**Key API/Component Changes**
The comments of the following modules are updated. For details, see the corresponding external API declaration and API development guide.
| Module | Description of Major Changes |
| ----------------------------------- | ------------------------------------------------------------ |
| @ohos.app.ability.UIAbility | Added the description of error codes 16200001, 16200002, 16200004, 16200005, 16000050.|
| @ohos.app.ability.abilityManager | Added the description of error codes 201, 202, and 16000050, and adjusted the description of error code 401.|
| @ohos.app.ability.appManager | Added the description of error codes 201, 202, and 16000050, and adjusted the description of error code 401.|
| @ohos.app.ability.dataUriUtils | Added the description of error code 401. |
| @ohos.app.ability.errorManager | Added the description of error code 16000003. |
| @ohos.app.ability.missionManager | Added the description of error codes 201, 202, 16300001, 16300002, and 16000009, and adjusted the description of error code 401.|
| @ohos.app.ability.quickFixManager | Added the description of error codes 201, 202, 18500001, 18500002, and 18500008. |
| @ohos.app.ability.wantAgent | Added the description of error codes 16000007, 16000015, and 16000151. |
| application/AbilityDelegator | Added the description of error codes 16000001, 16000002, 16000004, 16000005, 16000006, 16000008, 16000009, 16000010, 16000011, 16000050, 16000053, 16000055, 16200001, and 16000100.|
| application/ApplicationContext | Added the description of error codes 16000011 and 16000050. |
| application/Context | Added the description of error codes 201, 202, and 401. |
| application/ServiceExtensionContext | Added the description of error codes 201, 202, 16000001, 16000002, 16000004, 16000005, 16000006, 16000008, 16000009, 16000010, 16000011, 16000050, 16000053, 16000055, and 16200001.|
| application/UIAbilityContext | Added the description of error codes 201, 16000001, 16000002, 16000004, 16000005, 16000006, 16000008, 16000009, 16000010, 16000011, 16000050, 16000053, 16000055, 16200001, and 16000100.|
| @ohos.app.form.formHost | Added the description of error codes 201, 202, 16500050, 16500060, 16501000, 16501001, and 16501003, and adjusted the description of error code 401.|
| @ohos.app.form.formProvider | Added the error codes 202, 16500050, 16500060, 16500100, 16501000, 16501001, 16501002, and 16501003, and adjusted the description of error code 401.|
| application/FormExtensionContext | Added the description of error codes 202, 401, 16500050, 16500100, 16500101, and 16501000.|
# Bundle Management Subsystem Changelog
## cl.bundlemanager.1 Changed Underlying Capability by Not Decompressing the HAP During HAP Installation
The HAP will no longer be decompressed during installation. After the installation is complete, only the HAP file exists in the installation directory. As a result, the application must use the standard resource management interface, rather than a combined path, to access a resource file.
**Change Impact**<br>
If the application uses a combined path to access a resource file, the access fails. It must use the resource management interface.
**Key API/Component Changes**<br>
No API or component change is involved.
**Adaptation Guide**<br>
The resource management subsystem provides the JS interface for accessing resource files. Reference: [Accessing Resource Files](../../../application-dev/reference/apis/js-apis-resource-manager.md#getrawfilecontent9)
...@@ -18,7 +18,7 @@ import ability from '@ohos.ability.ability'; ...@@ -18,7 +18,7 @@ import ability from '@ohos.ability.ability';
| 名称 | 类型 | 描述 | | 名称 | 类型 | 描述 |
| ----------- | -------------------- | ------------------------------------------------------------ | | ----------- | -------------------- | ------------------------------------------------------------ |
| DataAbilityHelper | [DataAbilityHelper](js-apis-inner-ability-dataAbilityHelper.md) | DataAbilityHelper二级模块。 | | DataAbilityHelper | [DataAbilityHelper](js-apis-inner-ability-dataAbilityHelper.md) | DataAbilityHelper二级模块。 |
| PacMap | [PacMap](js-apis-inner-application-pacMap.md) | PacMap二级模块。 | | PacMap | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap) | PacMap二级模块。 |
| DataAbilityOperation | [DataAbilityOperation](js-apis-inner-ability-dataAbilityOperation.md) | DataAbilityOperation二级模块。 | | DataAbilityOperation | [DataAbilityOperation](js-apis-inner-ability-dataAbilityOperation.md) | DataAbilityOperation二级模块。 |
| DataAbilityResult | [DataAbilityResult](js-apis-inner-ability-dataAbilityResult.md) | DataAbilityResult二级模块。 | | DataAbilityResult | [DataAbilityResult](js-apis-inner-ability-dataAbilityResult.md) | DataAbilityResult二级模块。 |
| AbilityResult | [AbilityResult](js-apis-inner-ability-abilityResult.md) | AbilityResult二级模块。 | | AbilityResult | [AbilityResult](js-apis-inner-ability-abilityResult.md) | AbilityResult二级模块。 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册