diff --git a/README.md b/README.md index 602a868e0c5966d52b77eff891a6f32232c7d579..9351f7f58964229343c0dbfc3c9875e212a4a54f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This repository stores device and application development documents provided by - master: the latest version. - - OpenHarmony 3.2 Beta3. [Learn more](en/release-notes/OpenHarmony-v3.2-beta3.md) + - OpenHarmony 3.2 Beta5. [Learn more](en/release-notes/OpenHarmony-v3.2-beta5.md) - OpenHarmony 3.1 Release. [Learn more](en/release-notes/OpenHarmony-v3.1-release.md) @@ -34,7 +34,7 @@ This repository stores device and application development documents provided by ### Historical Stable Versions -OpenHarmony_v1.x_release: OpenHarmony v1.1.5 LTS. [Learn more](en/release-notes/OpenHarmony-v1.1.5-LTS.md) +OpenHarmony_v1.x_release: OpenHarmony 1.1.5 LTS. [Learn more](en/release-notes/OpenHarmony-v1.1.5-LTS.md) [More versions](en/release-notes/) @@ -51,6 +51,6 @@ You can evaluate available documents, make simple modifications, provide feedbac Excellent contributors will be awarded and the contributions will be publicized in the developer community. -- Mail list: docs@openharmony.io +- Mailing list: docs@openharmony.io - Zulip group: documentation_sig \ No newline at end of file diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md index 6945d995cd7ce04f6cfc86fd94a6cd6094845f81..beda646d6607e1fe890c64a226950a17759f1831 100644 --- a/en/application-dev/reference/apis/Readme-EN.md +++ b/en/application-dev/reference/apis/Readme-EN.md @@ -19,8 +19,6 @@ - [@ohos.application.DataShareExtensionAbility (DataShare Extension Ability)](js-apis-application-dataShareExtensionAbility.md) - [@ohos.application.StaticSubscriberExtensionAbility (StaticSubscriberExtensionAbility)](js-apis-application-staticSubscriberExtensionAbility.md) - Stage Model (To Be Deprecated Soon) - - [@ohos.application.Ability (Ability)](js-apis-application-ability.md) - - [@ohos.application.AbilityLifecycleCallback (AbilityLifecycleCallback)](js-apis-application-abilityLifecycleCallback.md) - [@ohos.application.EnvironmentCallback (EnvironmentCallback)](js-apis-application-environmentCallback.md) - FA Model - [@ohos.ability.ability (Ability)](js-apis-ability-ability.md) @@ -34,6 +32,7 @@ - [@ohos.app.ability.Configuration (Configuration)](js-apis-app-ability-configuration.md) - [@ohos.app.ability.ConfigurationConstant (ConfigurationConstant)](js-apis-app-ability-configurationConstant.md) - [@ohos.app.ability.dataUriUtils (DataUriUtils)](js-apis-app-ability-dataUriUtils.md) + - [@ohos.app.ability.dialogRequest (dialogRequest)](js-apis-app-ability-dialogRequest.md) - [@ohos.app.ability.errorManager (ErrorManager)](js-apis-app-ability-errorManager.md) - [@ohos.app.ability.missionManager (missionManager)](js-apis-app-ability-missionManager.md) - [@ohos.app.ability.quickFixManager (quickFixManager)](js-apis-app-ability-quickFixManager.md) @@ -53,7 +52,6 @@ - [@ohos.application.appManager (appManager)](js-apis-application-appManager.md) - [@ohos.application.Configuration (Configuration)](js-apis-application-configuration.md) - [@ohos.application.ConfigurationConstant (ConfigurationConstant)](js-apis-application-configurationConstant.md) - - [@ohos.application.errorManager (ErrorManager)](js-apis-application-errorManager.md) - [@ohos.application.formBindingData (formBindingData)](js-apis-application-formBindingData.md) - [@ohos.application.formError (FormError)](js-apis-application-formError.md) - [@ohos.application.formHost (FormHost)](js-apis-application-formHost.md) @@ -76,7 +74,6 @@ - [context](js-apis-inner-app-context.md) - [processInfo](js-apis-inner-app-processInfo.md) - application - - [AbilityContext](js-apis-ability-context.md) - [abilityDelegator](js-apis-inner-application-abilityDelegator.md) - [abilityDelegatorArgs](js-apis-inner-application-abilityDelegatorArgs.md) - [abilityMonitor](js-apis-inner-application-abilityMonitor.md) @@ -107,6 +104,7 @@ - [ServiceExtensionContext](js-apis-inner-application-serviceExtensionContext.md) - [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md) - [shellCmdResult](js-apis-inner-application-shellCmdResult.md) + - [WindowExtensionContext](js-apis-inner-application-windowExtensionContext.md) - wantAgent - [triggerInfo](js-apis-inner-wantAgent-triggerInfo.md) - [wantAgentInfo](js-apis-inner-wantAgent-wantAgentInfo.md) @@ -117,10 +115,12 @@ - [continuationResult](js-apis-continuation-continuationResult.md) - Common Event and Notification + - [System Common Events](commonEventManager-definitions.md) - [@ohos.commonEventManager (Common Event) (Recommended)](js-apis-commonEventManager.md) - [@ohos.events.emitter (Emitter)](js-apis-emitter.md) - [@ohos.notificationManager (NotificationManager) (Recommended)](js-apis-notificationManager.md) - [@ohos.notificationSubscribe (NotificationSubscribe) (Recommended)](js-apis-notificationSubscribe.md) + - [System Common Events (To Be Deprecated Soon)](commonEvent-definitions.md) - [@ohos.commonEvent (Common Event) (To Be Deprecated Soon)](js-apis-commonEvent.md) - [@ohos.notification (Notification) (To Be Deprecated Soon)](js-apis-notification.md) - application @@ -145,7 +145,6 @@ - [hapModuleInfo](js-apis-bundleManager-hapModuleInfo.md) - [launcherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo.md) - [metadata](js-apis-bundleManager-metadata.md) - - [packInfo](js-apis-bundleManager-packInfo.md) - [permissionDef](js-apis-bundleManager-permissionDef.md) - [remoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md) - [shortcutInfo](js-apis-bundleManager-shortcutInfo.md) @@ -185,6 +184,7 @@ - [@ohos.resourceschedule.workScheduler (Work Scheduler)](js-apis-resourceschedule-workScheduler.md) - [@ohos.resourceschedule.usageStatistics (Device Usage Statistics)](js-apis-resourceschedule-deviceUsageStatistics.md) - [@ohos.WorkSchedulerExtensionAbility (Work Scheduler Callbacks)](js-apis-WorkSchedulerExtensionAbility.md) + - Security - [@ohos.abilityAccessCtrl (Ability Access Control)](js-apis-abilityAccessCtrl.md) - [@ohos.privacyManager (Privacy Management)](js-apis-privacyManager.md) @@ -216,10 +216,11 @@ - [@ohos.file.hash (File Hash Processing)](js-apis-file-hash.md) - [@ohos.file.securityLabel (Data Label)](js-apis-file-securityLabel.md) - [@ohos.file.statvfs (File System Space Statistics)](js-apis-file-statvfs.md) - - [@ohos.filemanagement.userFileManager (User Data Management)](js-apis-userFileManager.md) - - [@ohos.multimedia.medialibrary (Media Library Management)](js-apis-medialibrary.md) - [@ohos.file.storageStatistics (Application Storage Statistics)](js-apis-file-storage-statistics.md) - [@ohos.file.volumeManager (Volume Management)](js-apis-file-volumemanager.md) + - [@ohos.filemanagement.userFileManager (User Data Management)](js-apis-userFileManager.md) + - [@ohos.multimedia.medialibrary (Media Library Management)](js-apis-medialibrary.md) + - Telephony Service - [@ohos.contact (Contacts)](js-apis-contact.md) - [@ohos.telephony.call (Call)](js-apis-call.md) @@ -271,7 +272,7 @@ - [@ohos.InputMethodSubtype (Input Method Subtype)](js-apis-inputmethod-subtype.md) - [@ohos.pasteboard (Pasteboard)](js-apis-pasteboard.md) - [@ohos.screenLock (Screenlock)](js-apis-screen-lock.md) - - [@ohos.systemTime (System Time and Time Zone)](js-apis-system-time.md) + - [@ohos.systemDateTime (System Time and Time Zone)](js-apis-system-date-time.md) - [@ohos.systemTimer (System Timer)](js-apis-system-timer.md) - [@ohos.wallpaper (Wallpaper)](js-apis-wallpaper.md) - [@ohos.web.webview (Webview)](js-apis-webview.md) @@ -279,6 +280,9 @@ - [Timer](js-apis-timer.md) - application - [AccessibilityExtensionContext](js-apis-inner-application-accessibilityExtensionContext.md) + - imf + - [InputMethodCommon](js-apis-inputmethod-InputMethodCommon.md) + - Device Management - [@ohos.batteryInfo (Battery Information)](js-apis-battery-info.md) - [@ohos.batteryStatistics (Battery Statistics)](js-apis-batteryStatistics.md) @@ -314,10 +318,11 @@ - [@ohos.account.osAccount (OS Account Management)](js-apis-osAccount.md) - Custom Management - [@ohos.configPolicy (Configuration Policy)](js-apis-configPolicy.md) - - [@ohos.enterprise.deviceInfo (Device Information Management)](js-apis-enterprise-deviceInfo.md) - - [@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)](js-apis-EnterpriseAdminExtensionAbility.md) - [@ohos.enterprise.adminManager (Enterprise Device Management)](js-apis-enterprise-adminManager.md) - [@ohos.enterprise.dateTimeManager (System Time Management)](js-apis-enterprise-dateTimeManager.md) + - [@ohos.enterprise.deviceControl (Device Control Management)](js-apis-enterprise-deviceControl.md) + - [@ohos.enterprise.deviceInfo (Device Information Management)](js-apis-enterprise-deviceInfo.md) + - [@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)](js-apis-EnterpriseAdminExtensionAbility.md) - Language Base Class Library - [@ohos.buffer (Buffer)](js-apis-buffer.md) @@ -364,6 +369,7 @@ - [@ohos.reminderAgent (Reminder Agent)](js-apis-reminderAgent.md) - [@ohos.statfs (statfs)](js-apis-statfs.md) - [@ohos.systemParameter (System Parameter)](js-apis-system-parameter.md) + - [@ohos.systemTime (System Time and Time Zone)](js-apis-system-time.md) - [@ohos.usb (USB Management)](js-apis-usb-deprecated.md) - [@ohos.usbV9 (USB Management)](js-apis-usb.md) - [@system.app (Application Context)](js-apis-system-app.md) diff --git a/en/application-dev/reference/apis/js-apis-ability-context.md b/en/application-dev/reference/apis/js-apis-ability-context.md deleted file mode 100644 index d345bbb9db0739da16156ecfc0bd4fe344989149..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-ability-context.md +++ /dev/null @@ -1,1921 +0,0 @@ -# AbilityContext - -The **AbilityContext** module, inherited from **Context**, implements the context for abilities. - -This module provides APIs for accessing ability-specific resources. You can use the APIs to start and terminate an ability, obtain the caller interface, and request permissions from users by displaying a dialog box. - -> **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 APIs of this module can be used only in the stage model. - -## Usage - -Before using the **AbilityContext** module, you must define a child class that inherits from **Ability**. - -```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - -let context = undefined; -class EntryAbility extends UIAbility { - onWindowStageCreate(windowStage) { - context = this.context; - } -} -``` - -## Attributes - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -| Name| Type| Readable| Writable| Description| -| -------- | -------- | -------- | -------- | -------- | -| abilityInfo | [AbilityInfo](js-apis-bundleManager-abilityInfo.md) | Yes| No| Ability information.| -| currentHapModuleInfo | [HapModuleInfo](js-apis-bundleManager-hapModuleInfo.md) | Yes| No| Information about the current HAP.| -| config | [Configuration](js-apis-application-configuration.md) | Yes| No| Configuration information.| - -## AbilityContext.startAbility - -startAbility(want: Want, callback: AsyncCallback<void>): void; - -Starts an ability. This API uses an asynchronous callback to return the result. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| callback | AsyncCallback<void> | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - bundleName: "com.example.myapplication", - abilityName: "MyAbility" - }; - - try { - this.context.startAbility(want, (error) => { - if (error.code) { - // Process service logic errors. - console.log('startAbility failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('startAbility succeed'); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - - -## AbilityContext.startAbility - -startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void; - -Starts an ability with the start options specified. This API uses an asynchronous callback to return the result. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| options | [StartOptions](js-apis-application-startOptions.md) | Yes| Parameters used for starting the ability.| -| callback | AsyncCallback<void> | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var options = { - windowMode: 0 - }; - - try { - this.context.startAbility(want, options, (error) => { - if (error.code) { - // Process service logic errors. - console.log('startAbility failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('startAbility succeed'); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.startAbility - -startAbility(want: Want, options?: StartOptions): Promise<void>; - -Starts an ability. This API uses a promise to return the result. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| options | [StartOptions](js-apis-application-startOptions.md) | No| Parameters used for starting the ability.| - -**Return value** - -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - bundleName: "com.example.myapplication", - abilityName: "MyAbility" - }; - var options = { - windowMode: 0, - }; - - try { - this.context.startAbility(want, options) - .then((data) => { - // Carry out normal service processing. - console.log('startAbility succeed'); - }) - .catch((error) => { - // Process service logic errors. - console.log('startAbility failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - - -## AbilityContext.startAbilityForResult - -startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void; - -Starts an ability. After the ability is started, you can call [terminateSelfWithResult](#abilitycontextterminateselfwithresult) to terminate the ability and return the result to the caller. If an exception occurs, for example, the ability is killed, exception information is returned to the caller. This API uses an asynchronous callback to return the result. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want |[Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| callback | AsyncCallback<[AbilityResult](js-apis-inner-ability-abilityResult.md)> | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - - try { - this.context.startAbilityForResult(want, (error, result) => { - if (error.code) { - // Process service logic errors. - console.log('startAbilityForResult failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log("startAbilityForResult succeed, result.resultCode = " + - result.resultCode) - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.startAbilityForResult - -startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void; - -Starts an ability with the start options specified. After the ability is started, you can call [terminateSelfWithResult](#abilitycontextterminateselfwithresult) to terminate the ability and return the result to the caller. If an exception occurs, for example, the ability is killed, exception information is returned to the caller. This API uses an asynchronous callback to return the result. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want |[Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| options | [StartOptions](js-apis-application-startOptions.md) | Yes| Parameters used for starting the ability.| -| callback | AsyncCallback<[AbilityResult](js-apis-inner-ability-abilityResult.md)> | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var options = { - windowMode: 0, - }; - - try { - this.context.startAbilityForResult(want, options, (error, result) => { - if (error.code) { - // Process service logic errors. - console.log('startAbilityForResult failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log("startAbilityForResult succeed, result.resultCode = " + - result.resultCode) - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - - -## AbilityContext.startAbilityForResult - -startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>; - -Starts an ability. After the ability is started, you can call [terminateSelfWithResult](#abilitycontextterminateselfwithresult) to terminate the ability and return the result to the caller. If an exception occurs, for example, the ability is killed, exception information is returned to the caller. This API uses a promise to return the result. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| options | [StartOptions](js-apis-application-startOptions.md) | No| Parameters used for starting the ability.| - - -**Return value** - -| Type| Description| -| -------- | -------- | -| Promise<[AbilityResult](js-apis-inner-ability-abilityResult.md)> | Promise used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - bundleName: "com.example.myapplication", - abilityName: "MyAbility" - }; - var options = { - windowMode: 0, - }; - - try { - this.context.startAbilityForResult(want, options) - .then((result) => { - // Carry out normal service processing. - console.log("startAbilityForResult succeed, result.resultCode = " + result.resultCode); - }) - .catch((error) => { - // Process service logic errors. - console.log('startAbilityForResult failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.startAbilityForResultWithAccount - -startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void; - -Starts an ability with the account ID specified. This API uses an asynchronous callback to return the result when the ability is terminated. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| -| callback | AsyncCallback\<[AbilityResult](js-apis-inner-ability-abilityResult.md)\> | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - - try { - this.context.startAbilityForResultWithAccount(want, accountId, (error, result) => { - if (error.code) { - // Process service logic errors. - console.log('startAbilityForResultWithAccount failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log("startAbilityForResultWithAccount succeed, result.resultCode = " + - result.resultCode) - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - - -## AbilityContext.startAbilityForResultWithAccount - -startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void; - -Starts an ability with the start options and account ID specified. This API uses an asynchronous callback to return the result when the ability is terminated. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| -| options | [StartOptions](js-apis-application-startOptions.md) | Yes| Parameters used for starting the ability.| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - var options = { - windowMode: 0 - }; - - try { - this.context.startAbilityForResultWithAccount(want, accountId, options, (error, result) => { - if (error.code) { - // Process service logic errors. - console.log('startAbilityForResultWithAccount failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log("startAbilityForResultWithAccount succeed, result.resultCode = " + - result.resultCode) - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - - -## AbilityContext.startAbilityForResultWithAccount - -startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\; - -Starts an ability with the account ID specified. This API uses a promise to return the result when the ability is terminated. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| -| options | [StartOptions](js-apis-application-startOptions.md) | No| Parameters used for starting the ability.| - -**Return value** - -| Type| Description| -| -------- | -------- | -| Promise<[AbilityResult](js-apis-inner-ability-abilityResult.md)> | Promise used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - var options = { - windowMode: 0 - }; - - try { - this.context.startAbilityForResultWithAccount(want, accountId, options) - .then((result) => { - // Carry out normal service processing. - console.log("startAbilityForResultWithAccount succeed, result.resultCode = " + - result.resultCode) - }) - .catch((error) => { - // Process service logic errors. - console.log('startAbilityForResultWithAccount failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` -## AbilityContext.startServiceExtensionAbility - -startServiceExtensionAbility(want: Want, callback: AsyncCallback\): void; - -Starts a ServiceExtensionAbility. This API uses an asynchronous callback to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - - try { - this.context.startServiceExtensionAbility(want, (error) => { - if (error.code) { - // Process service logic errors. - console.log('startServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('startServiceExtensionAbility succeed'); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.startServiceExtensionAbility - -startServiceExtensionAbility(want: Want): Promise\; - -Starts a ServiceExtensionAbility. This API uses a promise to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - - try { - this.context.startServiceExtensionAbility(want) - .then((data) => { - // Carry out normal service processing. - console.log('startServiceExtensionAbility succeed'); - }) - .catch((error) => { - // Process service logic errors. - console.log('startServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.startServiceExtensionAbilityWithAccount - -startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void; - -Starts a ServiceExtensionAbility with the account ID specified. This API uses an asynchronous callback to return the result. - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - - try { - this.context.startServiceExtensionAbilityWithAccount(want, accountId, (error) => { - if (error.code) { - // Process service logic errors. - console.log('startServiceExtensionAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('startServiceExtensionAbilityWithAccount succeed'); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.startServiceExtensionAbilityWithAccount - -startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\; - -Starts a ServiceExtensionAbility with the account ID specified. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - - try { - this.context.startServiceExtensionAbilityWithAccount(want, accountId) - .then((data) => { - // Carry out normal service processing. - console.log('startServiceExtensionAbilityWithAccount succeed'); - }) - .catch((error) => { - // Process service logic errors. - console.log('startServiceExtensionAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` -## AbilityContext.stopServiceExtensionAbility - -stopServiceExtensionAbility(want: Want, callback: AsyncCallback\): void; - -Stops a ServiceExtensionAbility in the same application. This API uses an asynchronous callback to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - - try { - this.context.startAbility(want, (error) => { - if (error.code != 0) { - console.log("start ability fail, err: " + JSON.stringify(err)); - } - }) - - this.context.stopServiceExtensionAbility(want, (error) => { - if (error.code != 0) { - // Process service logic errors. - console.log('stopServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('stopServiceExtensionAbility succeed'); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.stopServiceExtensionAbility - -stopServiceExtensionAbility(want: Want): Promise\; - -Stops a ServiceExtensionAbility in the same application. This API uses a promise to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - - try { - this.context.startAbility(want, (error) => { - if (error.code != 0) { - console.log("start ability fail, err: " + JSON.stringify(err)); - } - }) - - this.context.stopServiceExtensionAbility(want) - .then((data) => { - // Carry out normal service processing. - console.log('stopServiceExtensionAbility succeed'); - }) - .catch((error) => { - // Process service logic errors. - console.log('stopServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.stopServiceExtensionAbilityWithAccount - -stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void; - -Stops a ServiceExtensionAbility in the same application with the account ID specified. This API uses an asynchronous callback to return the result. - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - - try { - this.context.startAbilityWithAccount(want, accountId, (error) => { - if (error.code != 0) { - console.log("start ability fail, err: " + JSON.stringify(err)); - } - }) - - this.context.stopServiceExtensionAbilityWithAccount(want, accountId, (error) => { - if (error.code) { - // Process service logic errors. - console.log('stopServiceExtensionAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('stopServiceExtensionAbilityWithAccount succeed'); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.stopServiceExtensionAbilityWithAccount - -stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\; - -Stops a ServiceExtensionAbility in the same application with the account ID specified. This API uses a promise to return the result. - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - - try { - this.context.startAbilityWithAccount(want, accountId, (error) => { - if (error.code != 0) { - console.log("start ability fail, err: " + JSON.stringify(err)); - } - }) - - this.context.stopServiceExtensionAbilityWithAccount(want, accountId) - .then((data) => { - // Carry out normal service processing. - console.log('stopServiceExtensionAbilityWithAccount succeed'); - }) - .catch((error) => { - // Process service logic errors. - console.log('stopServiceExtensionAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.terminateSelf - -terminateSelf(callback: AsyncCallback<void>): void; - -Terminates this ability. This API uses an asynchronous callback to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| callback | AsyncCallback<void> | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - this.context.terminateSelf((error) => { - if (error.code) { - // Process service logic errors. - console.log('terminateSelf failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('terminateSelf succeed'); - }); - ``` - - -## AbilityContext.terminateSelf - -terminateSelf(): Promise<void>; - -Terminates this ability. This API uses a promise to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Return value** - -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - this.context.terminateSelf().then((data) => { - // Carry out normal service processing. - console.log('terminateSelf succeed'); - }).catch((error) => { - // Process service logic errors. - console.log('terminateSelf failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - ``` - - -## AbilityContext.terminateSelfWithResult - -terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void; - -Terminates this ability. If the ability is started by calling [startAbilityForResult](#abilitycontextstartabilityforresult), the result is returned to the caller in the form of a callback when **terminateSelfWithResult** is called. Otherwise, no result is returned to the caller when **terminateSelfWithResult** is called. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| parameter | [AbilityResult](js-apis-inner-ability-abilityResult.md) | Yes| Information returned to the caller.| -| callback | AsyncCallback<void> | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - bundleName: "com.extreme.myapplication", - abilityName: "SecondAbility" - } - var resultCode = 100; - // AbilityResult information returned to the caller. - var abilityResult = { - want, - resultCode - } - - try { - this.context.terminateSelfWithResult(abilityResult, (error) => { - if (error.code) { - // Process service logic errors. - console.log('terminateSelfWithResult failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('terminateSelfWithResult succeed'); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - - -## AbilityContext.terminateSelfWithResult - -terminateSelfWithResult(parameter: AbilityResult): Promise<void>; -Terminates this ability. If the ability is started by calling [startAbilityForResult](#abilitycontextstartabilityforresult), the result is returned to the caller in the form of a promise when **terminateSelfWithResult** is called. Otherwise, no result is returned to the caller when **terminateSelfWithResult** is called. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| parameter | [AbilityResult](js-apis-inner-ability-abilityResult.md) | Yes| Information returned to the caller.| - -**Return value** - -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - - -**Example** - - ```ts - var want = { - bundleName: "com.extreme.myapplication", - abilityName: "SecondAbility" - } - var resultCode = 100; - // AbilityResult information returned to the caller. - var abilityResult = { - want, - resultCode - } - - try { - this.context.terminateSelfWithResult(abilityResult) - .then((data) => { - // Carry out normal service processing. - console.log('terminateSelfWithResult succeed'); - }) - .catch((error) => { - // Process service logic errors. - console.log('terminateSelfWithResult failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.connectServiceExtensionAbility - -connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; - -Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to another ability. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| options | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | Yes| Parameters for the connection.| - -**Return value** - -| Type| Description| -| -------- | -------- | -| number | Result code of the ability connection.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var options = { - onConnect(elementName, remote) { console.log('----------- onConnect -----------') }, - onDisconnect(elementName) { console.log('----------- onDisconnect -----------') }, - onFailed(code) { console.log('----------- onFailed -----------') } - } - - var connection = null; - try { - connection = this.context.connectServiceExtensionAbility(want, options); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - - -## AbilityContext.connectServiceExtensionAbilityWithAccount - -connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; - -Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to another ability with the account ID specified. - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| -| options | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | Yes| Parameters for the connection.| - -**Return value** - -| Type| Description| -| -------- | -------- | -| number | Result code of the ability connection.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - var options = { - onConnect(elementName, remote) { console.log('----------- onConnect -----------') }, - onDisconnect(elementName) { console.log('----------- onDisconnect -----------') }, - onFailed(code) { console.log('----------- onFailed -----------') } - } - - var connection = null; - try { - connection = this.context.connectServiceExtensionAbilityWithAccount(want, accountId, options); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.disconnectServiceExtensionAbility - -disconnectServiceExtensionAbility(connection: number): Promise\; - -Disconnects a connection. This API uses a promise to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| connection | number | Yes| Result code of the ability connection.| - -**Return value** - -| Type| Description| -| -------- | -------- | -| Promise\ | Promise used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - // connection is the return value of connectServiceExtensionAbility. - var connection = 1; - - try { - this.context.disconnectServiceExtensionAbility(connection) - .then((data) => { - // Carry out normal service processing. - console.log('disconnectServiceExtensionAbility succeed'); - }) - .catch((error) => { - // Process service logic errors. - console.log('disconnectServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.disconnectServiceExtensionAbility - -disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback\): void; - -Disconnects a connection. This API uses an asynchronous callback to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| connection | number | Yes| Result code of the ability connection.| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - // connection is the return value of connectServiceExtensionAbility. - var connection = 1; - - try { - this.context.disconnectServiceExtensionAbility(connection, (error) => { - if (error.code) { - // Process service logic errors. - console.log('disconnectServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('disconnectServiceExtensionAbility succeed'); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.startAbilityByCall - -startAbilityByCall(want: Want): Promise<Caller>; - -Starts an ability in the foreground or background and obtains the caller object for communicating with the ability. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - The rules for using this API in the same-device and cross-device scenarios are different. For details, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Information about the ability to start, including **abilityName**, **moduleName**, **bundleName**, **deviceId** (optional), and **parameters** (optional). If **deviceId** is left blank or null, the local ability is started. If **parameters** is left blank or null, the ability is started in the background.| - -**Return value** - -| Type| Description| -| -------- | -------- | -| Promise<Caller> | Promise used to return the caller object to communicate with.| - -**Example** - - Start an ability in the background. - - ```ts - var caller = undefined; - - // Start an ability in the background by not passing parameters. - var wantBackground = { - bundleName: "com.example.myservice", - moduleName: "entry", - abilityName: "EntryAbility", - deviceId: "" - }; - - try { - this.context.startAbilityByCall(wantBackground) - .then((obj) => { - // Carry out normal service processing. - caller = obj; - console.log('startAbilityByCall succeed'); - }).catch((error) => { - // Process service logic errors. - console.log('startAbilityByCall failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - - Start an ability in the foreground. - - ```ts - var caller = undefined; - - // Start an ability in the foreground with ohos.aafwk.param.callAbilityToForeground in parameters set to true. - var wantForeground = { - bundleName: "com.example.myservice", - moduleName: "entry", - abilityName: "EntryAbility", - deviceId: "", - parameters: { - "ohos.aafwk.param.callAbilityToForeground": true - } - }; - - try { - this.context.startAbilityByCall(wantForeground) - .then((obj) => { - // Carry out normal service processing. - caller = obj; - console.log('startAbilityByCall succeed'); - }).catch((error) => { - // Process service logic errors. - console.log('startAbilityByCall failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.startAbilityWithAccount - -startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void; - -Starts an ability with the account ID specified. This API uses an asynchronous callback to return the result. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - - try { - this.context.startAbilityWithAccount(want, accountId, (error) => { - if (error.code) { - // Process service logic errors. - console.log('startAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('startAbilityWithAccount succeed'); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - - -## AbilityContext.startAbilityWithAccount - -startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void; - -Starts an ability with the account ID and start options specified. This API uses an asynchronous callback to return the result. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| -| options | [StartOptions](js-apis-application-startOptions.md) | Yes| Parameters used for starting the ability.| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - var options = { - windowMode: 0 - }; - - try { - this.context.startAbilityWithAccount(want, accountId, options, (error) => { - if (error.code) { - // Process service logic errors. - console.log('startAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - return; - } - // Carry out normal service processing. - console.log('startAbilityWithAccount succeed'); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - - -## AbilityContext.startAbilityWithAccount - -startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\; - -Starts an ability with the account ID specified. This API uses a promise to return the result. - -Observe the following when using this API: - - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - -**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| -| options | [StartOptions](js-apis-application-startOptions.md) | No| Parameters used for starting the ability.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | If the input parameter is not valid parameter. | - -For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). - -**Example** - - ```ts - var want = { - deviceId: "", - bundleName: "com.example.myapplication", - abilityName: "EntryAbility" - }; - var accountId = 100; - var options = { - windowMode: 0 - }; - - try { - this.context.startAbilityWithAccount(want, accountId, options) - .then((data) => { - // Carry out normal service processing. - console.log('startAbilityWithAccount succeed'); - }) - .catch((error) => { - // Process service logic errors. - console.log('startAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - }); - } catch (paramError) { - // Process input parameter errors. - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); - } - ``` - -## AbilityContext.setMissionLabel - -setMissionLabel(label: string, callback:AsyncCallback<void>): void; - -Sets a label for this ability in the mission. This API uses an asynchronous callback to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| label | string | Yes| Label of the ability to set.| -| callback | AsyncCallback<void> | Yes| Callback used to return the result.| - -**Example** - - ```ts - this.context.setMissionLabel("test",(result) => { - console.log('setMissionLabel result:' + JSON.stringify(result)); - }); - ``` - - -## AbilityContext.setMissionLabel - -setMissionLabel(label: string): Promise<void>; - -Sets a label for this ability in the mission. This API uses a promise to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| label | string | Yes| Label of the ability to set.| - -**Return value** - -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result.| - -**Example** - - ```ts - this.context.setMissionLabel("test").then(() => { - console.log('success'); - }).catch((error) => { - console.log('failed:' + JSON.stringify(error)); - }); - ``` -## AbilityContext.setMissionIcon - -setMissionIcon(icon: image.PixelMap, callback:AsyncCallback\): void; - -Sets an icon for this ability in the mission. This API uses an asynchronous callback to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| icon | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes| Icon of the ability to set.| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Example** - - ```ts - import image from '@ohos.multimedia.image'; - var imagePixelMap; - var color = new ArrayBuffer(0); - var initializationOptions = { - size: { - height: 100, - width: 100 - } - }; - image.createPixelMap(color, initializationOptions) - .then((data) => { - imagePixelMap = data; - }) - .catch((err) => { - console.log('--------- createPixelMap fail, err: ---------', err) - }); - this.context.setMissionIcon(imagePixelMap, (err) => { - console.log('---------- setMissionIcon fail, err: -----------', err); - }) - ``` - - -## AbilityContext.setMissionIcon - -setMissionIcon(icon: image.PixelMap): Promise\; - -Sets an icon for this ability in the mission. This API uses a promise to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| icon | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes| Icon of the ability to set.| - -**Return value** - -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result.| - -**Example** - - ```ts - import image from '@ohos.multimedia.image'; - var imagePixelMap; - var color = new ArrayBuffer(0); - var initializationOptions = { - size: { - height: 100, - width: 100 - } - }; - image.createPixelMap(color, initializationOptions) - .then((data) => { - imagePixelMap = data; - }) - .catch((err) => { - console.log('--------- createPixelMap fail, err: ---------', err) - }); - this.context.setMissionIcon(imagePixelMap) - .then(() => { - console.log('-------------- setMissionIcon success -------------'); - }) - .catch((err) => { - console.log('-------------- setMissionIcon fail, err: -------------', err); - }); - ``` -## AbilityContext.restoreWindowStage - -restoreWindowStage(localStorage: LocalStorage) : void; - -Restores the window stage data for this ability. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| localStorage | LocalStorage | Yes| Storage used to store the restored window stage.| - -**Example** - - ```ts - var storage = new LocalStorage(); - this.context.restoreWindowStage(storage); - ``` - -## AbilityContext.isTerminating - -isTerminating(): boolean; - -Checks whether this ability is in the terminating state. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Return value** - -| Type| Description| -| -------- | -------- | -| boolean| The value **true** means that the ability is in the terminating state, and **false** means the opposite.| - -**Example** - - ```ts - var isTerminating = this.context.isTerminating(); - console.log('ability state :' + isTerminating); - ``` diff --git a/en/application-dev/reference/apis/js-apis-application-ability.md b/en/application-dev/reference/apis/js-apis-application-ability.md deleted file mode 100644 index 6e96d0194a712340cd63a5510a190ea971d04e01..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-application-ability.md +++ /dev/null @@ -1,756 +0,0 @@ -# @ohos.application.Ability (Ability) - -The **Ability** module manages the ability lifecycle and context, such as creating and destroying an ability, and dumping client information. - -This module provides the following common ability-related functions: - -- [Caller](#caller): implements sending of sequenceable data to the target ability when an ability (caller ability) invokes the target ability (callee ability). -- [Callee](#callee): implements callbacks for registration and deregistration of caller notifications. - -> **NOTE** -> -> The APIs of this module are deprecated since API version 9. You are advised to use [@ohos.app.ability.UIAbility (UIAbility)](js-apis-app-ability-uiAbility.md) instead. -> -> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. -> -> The APIs of this module can be used only in the stage model. - -## Modules to Import - -```ts -import UIAbility from '@ohos.application.Ability'; -``` - -## Attributes - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -| Name| Type| Readable| Writable| Description| -| -------- | -------- | -------- | -------- | -------- | -| context | [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md) | Yes| No| Context of an ability.| -| launchWant | [Want](js-apis-app-ability-want.md) | Yes| No| Parameters for starting the ability.| -| lastRequestWant | [Want](js-apis-app-ability-want.md) | Yes| No| Parameters used when the ability was started last time.| -| callee | [Callee](#callee) | Yes| No| Object that invokes the stub service.| - -## Ability.onCreate - -onCreate(want: Want, param: AbilityConstant.LaunchParam): void; - -Called to initialize the service logic when an ability is created. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-app-ability-want.md) | Yes| Information related to this ability, including the ability name and bundle name.| - | param | AbilityConstant.LaunchParam | Yes| Parameters for starting the ability, and the reason for the last abnormal exit.| - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - onCreate(want, param) { - console.log('onCreate, want:' + want.abilityName); - } - } - ``` - - -## Ability.onWindowStageCreate - -onWindowStageCreate(windowStage: window.WindowStage): void - -Called when a **WindowStage** is created for this ability. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** information.| - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - onWindowStageCreate(windowStage) { - console.log('onWindowStageCreate'); - } - } - ``` - - -## Ability.onWindowStageDestroy - -onWindowStageDestroy(): void - -Called when the **WindowStage** is destroyed for this ability. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - onWindowStageDestroy() { - console.log('onWindowStageDestroy'); - } - } - ``` - - -## Ability.onWindowStageRestore - -onWindowStageRestore(windowStage: window.WindowStage): void - -Called when the **WindowStage** is restored during the migration of this ability, which is a multi-instance ability. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** information.| - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - onWindowStageRestore(windowStage) { - console.log('onWindowStageRestore'); - } - } - ``` - - -## Ability.onDestroy - -onDestroy(): void; - -Called when this ability is destroyed to clear resources. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - onDestroy() { - console.log('onDestroy'); - } - } - ``` - - -## Ability.onForeground - -onForeground(): void; - -Called when this ability is switched from the background to the foreground. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - onForeground() { - console.log('onForeground'); - } - } - ``` - - -## Ability.onBackground - -onBackground(): void; - -Called when this ability is switched from the foreground to the background. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - onBackground() { - console.log('onBackground'); - } - } - ``` - - -## Ability.onContinue - -onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult; - -Called to save data during the ability migration preparation process. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | wantParam | {[key: string]: any} | Yes| **want** parameter.| - -**Return value** - - | Type| Description| - | -------- | -------- | - | AbilityConstant.OnContinueResult | Continuation result.| - -**Example** - - ```ts - import AbilityConstant from "@ohos.app.ability.AbilityConstant"; - - export default class EntryAbility extends UIAbility { - onContinue(wantParams) { - console.log('onContinue'); - wantParams["myData"] = "my1234567"; - return AbilityConstant.OnContinueResult.AGREE; - } - } - ``` - - -## Ability.onNewWant - -onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; - -Called when a new Want is passed in and this UIAbility is started again. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | Yes| Want information, such as the ability name and bundle name.| -| launchParams | AbilityConstant.LaunchParam | Yes| Reason for the ability startup and the last abnormal exit.| - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - onNewWant(want, launchParams) { - console.log('onNewWant, want:' + want.abilityName); - console.log('onNewWant, launchParams:' + JSON.stringify(launchParams)); - } - } - ``` - -## Ability.onConfigurationUpdated - -onConfigurationUpdated(config: Configuration): void; - -Called when the global configuration is updated. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | config | [Configuration](js-apis-application-configuration.md) | Yes| Callback invoked when the global configuration is updated. The global configuration indicates the configuration of the environment where the application is running and includes the language and color mode.| - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - onConfigurationUpdated(config) { - console.log('onConfigurationUpdated, language:' + config.language); - } - } - ``` - -## Ability.dump - -dump(params: Array\): Array\; - -Dumps client information. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | params | Array\ | Yes| Parameters in the form of a command.| - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - dump(params) { - console.log('dump, params:' + JSON.stringify(params)); - return ["params"] - } - } - ``` - -## Ability.onMemoryLevel - -onMemoryLevel(level: AbilityConstant.MemoryLevel): void; - -Called when the system has decided to adjust the memory level. For example, this API can be used when there is not enough memory to run as many background processes as possible. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | level | [AbilityConstant.MemoryLevel](js-apis-application-abilityConstant.md#abilityconstantmemorylevel) | Yes| Memory level that indicates the memory usage status. When the specified memory level is reached, a callback will be invoked and the system will start adjustment.| - -**Example** - - ```ts - export default class EntryAbility extends UIAbility { - onMemoryLevel(level) { - console.log('onMemoryLevel, level:' + JSON.stringify(level)); - } - } - ``` - -## Ability.onSaveState - -onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}): AbilityConstant.OnSaveResult; - -Called when the framework automatically saves the ability state in the case of an application fault. This API is used together with [appRecovery](js-apis-app-ability-appRecovery.md). - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | reason | [AbilityConstant.StateType](js-apis-application-abilityConstant.md#abilityconstantstatetype) | Yes| Reason for triggering the callback to save the ability state.| - | wantParam | {[key: string]: any} | Yes| **want** parameter.| - -**Return value** - - | Type| Description| - | -------- | -------- | - | AbilityConstant.OnSaveResult | Whether the ability state is saved.| - -**Example** - - ```ts -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; - -export default class EntryAbility extends UIAbility { - onSaveState(reason, wantParam) { - console.log('onSaveState'); - wantParam["myData"] = "my1234567"; - return AbilityConstant.OnSaveResult.RECOVERY_AGREE; - } -} - ``` - -## Caller - -Implements sending of sequenceable data to the target ability when an ability (caller ability) invokes the target ability (callee ability). - -## Caller.call - -call(method: string, data: rpc.Sequenceable): Promise<void>; - -Sends sequenceable data to the target ability. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | method | string | Yes| Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data.| - | data | rpc.Sequenceable | Yes| Sequenceable data. You need to customize the data.| - -**Return value** - - | Type| Description| - | -------- | -------- | - | Promise<void> | Promise used to return a response.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 201 | The application does not have permission to call the interface. | -| 401 | Invalid input parameter. | -| 16200001 | Caller released. The caller has been released. | -| 16200002 | Callee invalid. The callee does not exist. | -| 16000050 | Internal Error. | - -**Example** - - ```ts - import UIAbility from '@ohos.app.ability.UIAbility'; - - class MyMessageAble{ // Custom sequenceable data structure. - name:"" - str:"" - num: 1 - constructor(name, str) { - this.name = name; - this.str = str; - } - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']'); - return true; - } - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']'); - return true; - } - }; - var method = 'call_Function'; // Notification message string negotiated by the two abilities - var caller; - export default class EntryAbility extends UIAbility { - onWindowStageCreate(windowStage) { - this.context.startAbilityByCall({ - bundleName: "com.example.myservice", - abilityName: "EntryAbility", - deviceId: "" - }).then((obj) => { - caller = obj; - let msg = new MyMessageAble("msg", "world"); // See the definition of Sequenceable. - caller.call(method, msg) - .then(() => { - console.log('Caller call() called'); - }) - .catch((callErr) => { - console.log('Caller.call catch error, error.code: ' + JSON.stringify(callErr.code) + - ' error.message: ' + JSON.stringify(callErr.message)); - }); - }).catch((err) => { - console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) + - ' error.message: ' + JSON.stringify(err.message)); - }); - } - } - ``` - - -## Caller.callWithResult - -callWithResult(method: string, data: rpc.Sequenceable): Promise<rpc.MessageParcel>; - -Sends sequenceable data to the target ability and obtains the sequenceable data returned by the target ability. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | method | string | Yes| Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data.| - | data | rpc.Sequenceable | Yes| Sequenceable data. You need to customize the data.| - -**Return value** - - | Type| Description| - | -------- | -------- | - | Promise<rpc.MessageParcel> | Promise used to return the sequenceable data from the target ability.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 201 | The application does not have permission to call the interface. | -| 401 | Invalid input parameter. | -| 16200001 | Caller released. The caller has been released. | -| 16200002 | Callee invalid. The callee does not exist. | -| 16000050 | Internal Error. | - -**Example** - - ```ts - import UIAbility from '@ohos.app.ability.UIAbility'; - - class MyMessageAble{ - name:"" - str:"" - num: 1 - constructor(name, str) { - this.name = name; - this.str = str; - } - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']'); - return true; - } - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']'); - return true; - } - }; - var method = 'call_Function'; - var caller; - export default class EntryAbility extends UIAbility { - onWindowStageCreate(windowStage) { - this.context.startAbilityByCall({ - bundleName: "com.example.myservice", - abilityName: "EntryAbility", - deviceId: "" - }).then((obj) => { - caller = obj; - let msg = new MyMessageAble(1, "world"); - caller.callWithResult(method, msg) - .then((data) => { - console.log('Caller callWithResult() called'); - let retmsg = new MyMessageAble(0, ""); - data.readSequenceable(retmsg); - }) - .catch((callErr) => { - console.log('Caller.callWithResult catch error, error.code: ' + JSON.stringify(callErr.code) + - ' error.message: ' + JSON.stringify(callErr.message)); - }); - }).catch((err) => { - console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) + - ' error.message: ' + JSON.stringify(err.message)); - }); - } - } - ``` - - -## Caller.release - -release(): void; - -Releases the caller interface of the target ability. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | Invalid input parameter. | -| 16200001 | Caller released. The caller has been released. | -| 16200002 | Callee invalid. The callee does not exist. | -| 16000050 | Internal Error. | - -**Example** - - ```ts - import UIAbility from '@ohos.app.ability.UIAbility'; - - var caller; - - export default class EntryAbility extends UIAbility { - onWindowStageCreate(windowStage) { - this.context.startAbilityByCall({ - bundleName: "com.example.myservice", - abilityName: "EntryAbility", - deviceId: "" - }).then((obj) => { - caller = obj; - try { - caller.release(); - } catch (releaseErr) { - console.log('Caller.release catch error, error.code: ' + JSON.stringify(releaseErr.code) + - ' error.message: ' + JSON.stringify(releaseErr.message)); - } - }).catch((err) => { - console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) + - ' error.message: ' + JSON.stringify(err.message)); - }); - } - } - ``` - -## Caller.onRelease - - onRelease(callback: OnReleaseCallBack): void; - -Registers a callback that is invoked when the stub on the target ability is disconnected. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | callback | OnReleaseCallBack | Yes| Callback used for the **onRelease** API.| - -**Example** - - ```ts - import UIAbility from '@ohos.app.ability.UIAbility'; - - var caller; - - export default class EntryAbility extends UIAbility { - onWindowStageCreate(windowStage) { - this.context.startAbilityByCall({ - bundleName: "com.example.myservice", - abilityName: "EntryAbility", - deviceId: "" - }).then((obj) => { - caller = obj; - try { - caller.onRelease((str) => { - console.log(' Caller OnRelease CallBack is called ' + str); - }); - } catch (error) { - console.log('Caller.on catch error, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - } - }).catch((err) => { - console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) + - ' error.message: ' + JSON.stringify(err.message)); - }); - } - } - ``` - - -## Callee - -Implements callbacks for caller notification registration and deregistration. - -## Callee.on - -on(method: string, callback: CalleeCallBack): void; - -Registers a caller notification callback, which is invoked when the target ability registers a function. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | method | string | Yes| Notification message string negotiated between the two abilities.| - | callback | CalleeCallBack | Yes| JS notification synchronization callback of the **rpc.MessageParcel** type. The callback must return at least one empty **rpc.Sequenceable** object. Otherwise, the function execution fails.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | Invalid input parameter. | -| 16200004 | Method registered. The method has registered. | -| 16000050 | Internal Error. | - -**Example** - - ```ts - import UIAbility from '@ohos.app.ability.UIAbility'; - class MyMessageAble{ - name:"" - str:"" - num: 1 - constructor(name, str) { - this.name = name; - this.str = str; - } - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']'); - return true; - } - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']'); - return true; - } - }; - var method = 'call_Function'; - function funcCallBack(pdata) { - console.log('Callee funcCallBack is called ' + pdata); - let msg = new MyMessageAble("test", ""); - pdata.readSequenceable(msg); - return new MyMessageAble("test1", "Callee test"); - } - export default class EntryAbility extends UIAbility { - onCreate(want, launchParam) { - console.log('Callee onCreate is called'); - try { - this.callee.on(method, funcCallBack); - } catch (error) { - console.log('Callee.on catch error, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - } - } - } - ``` - -## Callee.off - -off(method: string): void; - -Deregisters a caller notification callback, which is invoked when the target ability registers a function. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | method | string | Yes| Registered notification message string.| - -**Error codes** - -| ID| Error Message| -| ------- | -------------------------------- | -| 401 | Invalid input parameter. | -| 16200005 | Method not registered. The method has not registered. | -| 16000050 | Internal Error. | - - -**Example** - ```ts - import UIAbility from '@ohos.app.ability.UIAbility'; - - var method = 'call_Function'; - - export default class EntryAbility extends UIAbility { - onCreate(want, launchParam) { - console.log('Callee onCreate is called'); - try { - this.callee.off(method); - } catch (error) { - console.log('Callee.off catch error, error.code: ' + JSON.stringify(error.code) + - ' error.message: ' + JSON.stringify(error.message)); - } - } - } - ``` - -## OnReleaseCallBack - -(msg: string): void; - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -| Name| Type| Readable| Writable| Description| -| -------- | -------- | -------- | -------- | -------- | -| (msg: string) | function | Yes| No| Prototype of the listener function registered by the caller.| - -## CalleeCallBack - -(indata: rpc.MessageParcel): rpc.Sequenceable; - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -| Name| Type| Readable| Writable| Description| -| -------- | -------- | -------- | -------- | -------- | -| (indata: rpc.MessageParcel) | rpc.Sequenceable | Yes| No| Prototype of the listener function registered by the callee.| diff --git a/en/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md b/en/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md deleted file mode 100644 index 5e29491014719ab9e5cf09dd976ed71f2b449c6e..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md +++ /dev/null @@ -1,213 +0,0 @@ -# @ohos.application.AbilityLifecycleCallback (AbilityLifecycleCallback) - -The **AbilityLifecycleCallback** module provides callbacks, such as **onAbilityCreate**, **onWindowStageCreate**, and **onWindowStageDestroy**, to receive lifecycle state changes in the application context. These callbacks can be used as an input parameter of [registerAbilityLifecycleCallback](js-apis-inner-application-applicationContext.md#applicationcontextregisterabilitylifecyclecallback). - -> **NOTE** -> -> The APIs of this module are supported since API version 9 and are deprecated in versions later than API version 9. You are advised to use [@ohos.app.ability.AbilityLifecycleCallback](js-apis-app-ability-abilityLifecycleCallback.md) instead. Newly added APIs will be marked with a superscript to indicate their earliest API version. -> The APIs of this module can be used only in the stage model. - - -## Modules to Import - -```ts -import AbilityLifecycleCallback from "@ohos.application.AbilityLifecycleCallback"; -``` - - -## AbilityLifecycleCallback.onAbilityCreate - -onAbilityCreate(ability: Ability): void; - -Called when an ability is created. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| - - -## AbilityLifecycleCallback.onWindowStageCreate - -onWindowStageCreate(ability: Ability, windowStage: window.WindowStage): void; - -Called when the window stage of an ability is created. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| -| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** object.| - - -## AbilityLifecycleCallback.onWindowStageActive - -onWindowStageActive(ability: Ability, windowStage: window.WindowStage): void; - -Called when the window stage of an ability gains focus. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| -| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** object.| - - -## AbilityLifecycleCallback.onWindowStageInactive - -onWindowStageInactive(ability: Ability, windowStage: window.WindowStage): void; - -Called when the window stage of an ability loses focus. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| -| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** object.| - - -## AbilityLifecycleCallback.onWindowStageDestroy - -onWindowStageDestroy(ability: Ability, windowStage: window.WindowStage): void; - -Called when the window stage of an ability is destroyed. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| -| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** object.| - - -## AbilityLifecycleCallback.onAbilityDestroy - -onAbilityDestroy(ability: Ability): void; - -Called when an ability is destroyed. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| - - -## AbilityLifecycleCallback.onAbilityForeground - -onAbilityForeground(ability: Ability): void; - -Called when an ability is switched from the background to the foreground. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| - - -## AbilityLifecycleCallback.onAbilityBackground - -onAbilityBackground(ability: Ability): void; - -Called when an ability is switched from the foreground to the background. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| - - -## AbilityLifecycleCallback.onAbilityContinue - -onAbilityContinue(ability: Ability): void; - -Called when an ability is continued on another device. - -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| - -**Example** - -```ts -import AbilityStage from "@ohos.app.ability.AbilityStage"; - -var lifecycleId; - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - console.log("onAbilityCreate ability:" + JSON.stringify(ability)); - }, - onWindowStageCreate(ability, windowStage) { - console.log("onWindowStageCreate ability:" + JSON.stringify(ability)); - console.log("onWindowStageCreate windowStage:" + JSON.stringify(windowStage)); - }, - onWindowStageActive(ability, windowStage) { - console.log("onWindowStageActive ability:" + JSON.stringify(ability)); - console.log("onWindowStageActive windowStage:" + JSON.stringify(windowStage)); - }, - onWindowStageInactive(ability, windowStage) { - console.log("onWindowStageInactive ability:" + JSON.stringify(ability)); - console.log("onWindowStageInactive windowStage:" + JSON.stringify(windowStage)); - }, - onWindowStageDestroy(ability, windowStage) { - console.log("onWindowStageDestroy ability:" + JSON.stringify(ability)); - console.log("onWindowStageDestroy windowStage:" + JSON.stringify(windowStage)); - }, - onAbilityDestroy(ability) { - console.log("onAbilityDestroy ability:" + JSON.stringify(ability)); - }, - onAbilityForeground(ability) { - console.log("onAbilityForeground ability:" + JSON.stringify(ability)); - }, - onAbilityBackground(ability) { - console.log("onAbilityBackground ability:" + JSON.stringify(ability)); - }, - onAbilityContinue(ability) { - console.log("onAbilityContinue ability:" + JSON.stringify(ability)); - } - } - // 1. Obtain applicationContext through the context attribute. - let applicationContext = this.context.getApplicationContext(); - // 2. Use applicationContext to register a listener for the ability lifecycle in the application. - lifecycleId = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("registerAbilityLifecycleCallback number: " + JSON.stringify(lifecycleId)); - } - - onDestroy() { - let applicationContext = this.context.getApplicationContext(); - applicationContext.unregisterAbilityLifecycleCallback(lifecycleId, (error, data) => { - console.log("unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error)); - }); - } -} -``` diff --git a/en/application-dev/reference/apis/js-apis-application-errorManager.md b/en/application-dev/reference/apis/js-apis-application-errorManager.md deleted file mode 100644 index 2fbd840782cefe200f53d6df090bff9220b52c49..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-application-errorManager.md +++ /dev/null @@ -1,100 +0,0 @@ -# @ohos.application.errorManager (ErrorManager) - -The **ErrorManager** module provides APIs for registering and deregistering error observers. - -> **NOTE** -> -> The APIs of this module are supported since API version 9 and are deprecated in versions later than API version 9. You are advised to use [@ohos.app.ability.errorManager](js-apis-app-ability-errorManager.md) instead. Newly added APIs will be marked with a superscript to indicate their earliest API version. - -## Modules to Import -```ts -import errorManager from '@ohos.application.errorManager'; -``` - -## ErrorManager.registerErrorObserver - -registerErrorObserver(observer: ErrorObserver): number; - -Registers an error observer. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| observer | [ErrorObserver](js-apis-inner-application-errorObserver.md) | Yes| Numeric code of the observer.| - -**Example** - -```ts -var observer = { - onUnhandledException(errorMsg) { - console.log('onUnhandledException, errorMsg: ', errorMsg) - } -} -errorManager.registerErrorObserver(observer) -``` - -## ErrorManager.unregisterErrorObserver - -unregisterErrorObserver(observerId: number, callback: AsyncCallback\): void; - -Deregisters an error observer. This API uses an asynchronous callback to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| observerId | number | Yes| Numeric code of the observer.| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Example** - -```ts -var observerId = 100; - -function unregisterErrorObserverCallback(err) { - if (err) { - console.log('------------ unregisterErrorObserverCallback ------------', err); - } -} -errorManager.unregisterErrorObserver(observerId, unregisterErrorObserverCallback); - -``` - -## ErrorManager.unregisterErrorObserver - -unregisterErrorObserver(observerId: number): Promise\; - -Deregisters an error observer. This API uses a promise to return the result. - -**System capability**: SystemCapability.Ability.AbilityRuntime.Core - -**Parameters** - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| observerId | number | Yes| Numeric code of the observer.| - -**Return value** - -| Type| Description| -| -------- | -------- | -| Promise\ | Promise used to return the result.| - -**Example** - -```ts -var observerId = 100; -errorManager.unregisterErrorObserver(observerId) -.then((data) => { - console.log('----------- unregisterErrorObserver success ----------', data); -}) -.catch((err) => { - console.log('----------- unregisterErrorObserver fail ----------', err); -}) - -``` diff --git a/en/application-dev/website.md b/en/application-dev/website.md index 34fb5393b7ca3ebec8b7b5762606f576981bf77b..2364014ef49503250393370882bcb6ebae8d4a48 100644 --- a/en/application-dev/website.md +++ b/en/application-dev/website.md @@ -1,5 +1,4 @@ # Application Development - - [Application Development Overview](application-dev-guide.md) - Quick Start - Getting Started @@ -72,7 +71,7 @@ - [Using Explicit Want to Start an Ability](application-models/ability-startup-with-explicit-want.md) - [Using Implicit Want to Open a Website](application-models/ability-startup-with-implicit-want.md) - [Using Want to Share Data Between Applications](application-models/data-share-via-want.md) - - [Component Startup Rules](application-models/component-startup-rules.md) + - [Component Startup Rules (Stage Model)](application-models/component-startup-rules.md) - Inter-Device Application Component Interaction (Continuation) - [Continuation Overview](application-models/inter-device-interaction-hop-overview.md) - [Cross-Device Migration](application-models/hop-cross-device-migration.md) @@ -269,11 +268,14 @@ - [Animation Effect](ui/ui-js-animate-dynamic-effects.md) - [Animation Frame](ui/ui-js-animate-frame.md) - [Custom Components](ui/ui-js-custom-components.md) - - Common Event and Notification - - [Common Event and Notification Overview](notification/notification-brief.md) - - [Common Event Development](notification/common-event.md) - - [Notification Development](notification/notification-guidelines.md) - - [Debugging Assistant Usage](notification/assistant-guidelines.md) + - Notification + - [Notification Overview](notification/notification-overview.md) + - [Notification Subscription (Open Only to System Applications)](notification/notification-subscription.md) + - [Enabling Notification](notification/notification-enable.md) + - Publishing a Notification + - [Publishing a Basic Notification](notification/text-notification.md) + - [Publishing a Progress Notification](notification/progress-bar-notification.md) + - [Adding a WantAgent Object to a Notification](notification/notification-with-wantagent.md) - Window Manager - [Window Overview](windowmanager/window-overview.md) - [Application Window Development (Stage Mode)](windowmanager/application-window-stage.md) @@ -283,10 +285,8 @@ - [WebGL Overview](webgl/webgl-overview.md) - [WebGL Development](webgl/webgl-guidelines.md) - Media - - Audio + - Audio and Video - [Audio Overview](media/audio-overview.md) - - [Audio Playback Development](media/audio-playback.md) - - [Audio Recording Development](media/audio-recorder.md) - [Audio Rendering Development](media/audio-renderer.md) - [Audio Stream Management Development](media/audio-stream-manager.md) - [Audio Capture Development](media/audio-capturer.md) @@ -295,7 +295,10 @@ - [Audio Interruption Mode Development](media/audio-interruptmode.md) - [Volume Management Development](media/audio-volume-manager.md) - [Audio Routing and Device Management Development](media/audio-routing-manager.md) - - Video + - [AVPlayer Development (Recommended)](media/avplayer-playback.md) + - [AVRecorder Development (Recommended)](media/avrecorder.md) + - [Audio Playback Development](media/audio-playback.md) + - [Audio Recording Development](media/audio-recorder.md) - [Video Playback Development](media/video-playback.md) - [Video Recording Development](media/video-recorder.md) - AVSession @@ -321,6 +324,9 @@ - Crypto Framework - [Crypto Framework Overview](security/cryptoFramework-overview.md) - [Crypto Framework Development](security/cryptoFramework-guidelines.md) + - Certificate + - [Certificate Overview](security/cert-overview.md) + - [Certificate Development](security/cert-guidelines.md) - hapsigner - [hapsigner Overview](security/hapsigntool-overview.md) - [hapsigner Guide](security/hapsigntool-guidelines.md) @@ -337,8 +343,8 @@ - [Subscribing to State Changes of a Remote Object](connectivity/subscribe-remote-state.md) - Telephony - [Telephony Service Overview](telephony/telephony-overview.md) - - [Redirecting to the Dial Screen](telephony/jumping-to-the-dial-screen.md) - - [Obtaining Current Cellular Network Signal Information](telephony/cellular-network-signal-info.md) + - [Call Service Development](telephony/telephony-call.md) + - [SMS Service Development](telephony/telephony-sms.md) - Data Management - Distributed Data Service - [Distributed Data Service Overview](database/database-mdds-overview.md) @@ -363,12 +369,14 @@ - [Album Management](file-management/medialibrary-album-guidelines.md) - File Access Framework - [File Access Framework Overview](file-management/file-access-framework-overview.md) + - [FilePicker Guide](file-management/filepicker-guidelines.md) - Task Management - Background Task Management - [Background Task Management Overview](task-management/background-task-overview.md) - [Transient Task Development](task-management/transient-task-dev-guide.md) - [Continuous Task Development](task-management/continuous-task-dev-guide.md) - [Work Scheduler Development](task-management/work-scheduler-dev-guide.md) + - [WorkSchedulerExtensionAbility Development](task-management/workscheduler-extensionability.md) - [Efficiency Resource Request Development](task-management/efficiency-resources-apply-dev-guide.md) - Agent-Powered Reminder - [Agent-Powered Reminder Overview](task-management/reminder-agent-overview.md) @@ -378,9 +386,7 @@ - [USB Service Overview](device/usb-overview.md) - [USB Service Development](device/usb-guidelines.md) - Location - - [Location Overview](device/device-location-overview.md) - - [Obtaining Device Location Information](device/device-location-info.md) - - [Geocoding and Reverse Geocoding Capabilities](device/device-location-geocoding.md) + - [Location Development](device/location-guidelines.md) - Sensor - [Sensor Overview](device/sensor-overview.md) - [Sensor Development](device/sensor-guidelines.md) @@ -496,6 +502,7 @@ - [DataPanel](reference/arkui-ts/ts-basic-components-datapanel.md) - [DatePicker](reference/arkui-ts/ts-basic-components-datepicker.md) - [Divider](reference/arkui-ts/ts-basic-components-divider.md) + - [Formcomponent](reference/arkui-ts/ts-basic-components-formcomponent.md) - [Gauge](reference/arkui-ts/ts-basic-components-gauge.md) - [Image](reference/arkui-ts/ts-basic-components-image.md) - [ImageAnimator](reference/arkui-ts/ts-basic-components-imageanimator.md) @@ -745,71 +752,60 @@ - [API Reference Document Description](reference/apis/development-intro.md) - Ability Framework - Stage Model (Recommended) - - [@ohos.app.ability.Ability](reference/apis/js-apis-app-ability-ability.md) - - [@ohos.app.ability.AbilityConstant](reference/apis/js-apis-app-ability-abilityConstant.md) - - [@ohos.app.ability.abilityLifecycleCallback](reference/apis/js-apis-app-ability-abilityLifecycleCallback.md) - - [@ohos.app.ability.AbilityStage](reference/apis/js-apis-app-ability-abilityStage.md) - - [@ohos.app.ability.common](reference/apis/js-apis-app-ability-common.md) - - [@ohos.app.ability.contextConstant](reference/apis/js-apis-app-ability-contextConstant.md) - - [@ohos.app.ability.EnvironmentCallback](reference/apis/js-apis-app-ability-environmentCallback.md) - - [@ohos.app.ability.ExtensionAbility](reference/apis/js-apis-app-ability-extensionAbility.md) - - [@ohos.app.ability.ServiceExtensionAbility](reference/apis/js-apis-app-ability-serviceExtensionAbility.md) - - [@ohos.app.ability.StartOptions](reference/apis/js-apis-app-ability-startOptions.md) - - [@ohos.app.ability.UIAbility](reference/apis/js-apis-app-ability-uiAbility.md) - - [@ohos.app.form.FormExtensionAbility](reference/apis/js-apis-app-form-formExtensionAbility.md) + - [@ohos.app.ability.Ability (Ability Base Class)](reference/apis/js-apis-app-ability-ability.md) + - [@ohos.app.ability.AbilityConstant (AbilityConstant)](reference/apis/js-apis-app-ability-abilityConstant.md) + - [@ohos.app.ability.abilityLifecycleCallback (AbilityLifecycleCallback)](reference/apis/js-apis-app-ability-abilityLifecycleCallback.md) + - [@ohos.app.ability.AbilityStage (AbilityStage)](reference/apis/js-apis-app-ability-abilityStage.md) + - [@ohos.app.ability.common (Context)](reference/apis/js-apis-app-ability-common.md) + - [@ohos.app.ability.contextConstant (ContextConstant)](reference/apis/js-apis-app-ability-contextConstant.md) + - [@ohos.app.ability.EnvironmentCallback (EnvironmentCallback)](reference/apis/js-apis-app-ability-environmentCallback.md) + - [@ohos.app.ability.ExtensionAbility (ExtensionAbility Base Class)](reference/apis/js-apis-app-ability-extensionAbility.md) + - [@ohos.app.ability.ServiceExtensionAbility (ServiceExtensionAbility)](reference/apis/js-apis-app-ability-serviceExtensionAbility.md) + - [@ohos.app.ability.StartOptions (StartOptions)](reference/apis/js-apis-app-ability-startOptions.md) + - [@ohos.app.ability.UIAbility (UIAbility)](reference/apis/js-apis-app-ability-uiAbility.md) + - [@ohos.app.form.FormExtensionAbility (FormExtensionAbility)](reference/apis/js-apis-app-form-formExtensionAbility.md) + - [@ohos.application.DataShareExtensionAbility (DataShare Extension Ability)](reference/apis/js-apis-application-dataShareExtensionAbility.md) + - [@ohos.application.StaticSubscriberExtensionAbility (StaticSubscriberExtensionAbility)](reference/apis/js-apis-application-staticSubscriberExtensionAbility.md) - Stage Model (To Be Deprecated Soon) - - [@ohos.application.Ability](reference/apis/js-apis-application-ability.md) - - [@ohos.application.AbilityConstant](reference/apis/js-apis-application-abilityConstant.md) - - [@ohos.application.AbilityLifecycleCallback](reference/apis/js-apis-application-abilityLifecycleCallback.md) - - [@ohos.application.AbilityStage](reference/apis/js-apis-application-abilityStage.md) - - [@ohos.application.context](reference/apis/js-apis-application-context.md) - - [@ohos.application.DataShareExtensionAbility](reference/apis/js-apis-application-dataShareExtensionAbility.md) - - [@ohos.application.EnvironmentCallback](reference/apis/js-apis-application-environmentCallback.md) - - [@ohos.application.ExtensionAbility](reference/apis/js-apis-application-extensionAbility.md) - - [@ohos.application.FormExtension](reference/apis/js-apis-application-formExtension.md) - - [@ohos.application.ServiceExtensionAbility](reference/apis/js-apis-application-serviceExtensionAbility.md) - - [@ohos.application.StartOptions](reference/apis/js-apis-application-startOptions.md) - - [@ohos.application.StaticSubscriberExtensionAbility](reference/apis/js-apis-application-staticSubscriberExtensionAbility.md) + - [@ohos.application.EnvironmentCallback (EnvironmentCallback)](reference/apis/js-apis-application-environmentCallback.md) - FA Model - - [@ohos.ability.ability](reference/apis/js-apis-ability-ability.md) - - [@ohos.ability.featureAbility](reference/apis/js-apis-ability-featureAbility.md) - - [@ohos.ability.particleAbility](reference/apis/js-apis-ability-particleAbility.md) + - [@ohos.ability.ability (Ability)](reference/apis/js-apis-ability-ability.md) + - [@ohos.ability.featureAbility (FeatureAbility)](reference/apis/js-apis-ability-featureAbility.md) + - [@ohos.ability.particleAbility (ParticleAbility)](reference/apis/js-apis-ability-particleAbility.md) - Both Models (Recommended) - - [@ohos.app.ability.abilityDelegatorRegistry](reference/apis/js-apis-app-ability-abilityDelegatorRegistry.md) - - [@ohos.app.ability.abilityManager](reference/apis/js-apis-app-ability-abilityManager.md) - - [@ohos.app.ability.appManager](reference/apis/js-apis-app-ability-appManager.md) - - [@ohos.app.ability.appRecovery](reference/apis/js-apis-app-ability-appRecovery.md) - - [@ohos.app.ability.Configuration](reference/apis/js-apis-app-ability-configuration.md) - - [@ohos.app.ability.ConfigurationConstant](reference/apis/js-apis-app-ability-configurationConstant.md) - - [@ohos.app.ability.dataUriUtils](reference/apis/js-apis-app-ability-dataUriUtils.md) - - [@ohos.app.ability.errorManager](reference/apis/js-apis-app-ability-errorManager.md) - - [@ohos.app.ability.missionManager](reference/apis/js-apis-app-ability-missionManager.md) - - [@ohos.app.ability.quickFixManager](reference/apis/js-apis-app-ability-quickFixManager.md) - - [@ohos.app.ability.Want](reference/apis/js-apis-app-ability-want.md) - - [@ohos.app.ability.wantAgent](reference/apis/js-apis-app-ability-wantAgent.md) - - [@ohos.app.ability.wantConstant](reference/apis/js-apis-app-ability-wantConstant.md) - - [@ohos.app.form.formBindingData](reference/apis/js-apis-app-form-formBindingData.md) - - [@ohos.app.form.formHost](reference/apis/js-apis-app-form-formHost.md) - - [@ohos.app.form.formInfo](reference/apis/js-apis-app-form-formInfo.md) - - [@ohos.app.form.formProvider](reference/apis/js-apis-app-form-formProvider.md) + - [@ohos.app.ability.abilityDelegatorRegistry (AbilityDelegatorRegistry)](reference/apis/js-apis-app-ability-abilityDelegatorRegistry.md) + - [@ohos.app.ability.abilityManager (AbilityManager)](reference/apis/js-apis-app-ability-abilityManager.md) + - [@ohos.app.ability.appManager (appManager)](reference/apis/js-apis-app-ability-appManager.md) + - [@ohos.app.ability.appRecovery (appRecovery)](reference/apis/js-apis-app-ability-appRecovery.md) + - [@ohos.app.ability.Configuration (Configuration)](reference/apis/js-apis-app-ability-configuration.md) + - [@ohos.app.ability.ConfigurationConstant (ConfigurationConstant)](reference/apis/js-apis-app-ability-configurationConstant.md) + - [@ohos.app.ability.errorManager (ErrorManager)](reference/apis/js-apis-app-ability-errorManager.md) + - [@ohos.app.ability.missionManager (missionManager)](reference/apis/js-apis-app-ability-missionManager.md) + - [@ohos.app.ability.quickFixManager (quickFixManager)](reference/apis/js-apis-app-ability-quickFixManager.md) + - [@ohos.app.ability.Want (Want)](reference/apis/js-apis-app-ability-want.md) + - [@ohos.app.ability.wantAgent (WantAgent)](reference/apis/js-apis-app-ability-wantAgent.md) + - [@ohos.app.ability.wantConstant (wantConstant)](reference/apis/js-apis-app-ability-wantConstant.md) + - [@ohos.app.form.formBindingData (formBindingData)](reference/apis/js-apis-app-form-formBindingData.md) + - [@ohos.app.form.formHost (FormHost)](reference/apis/js-apis-app-form-formHost.md) + - [@ohos.app.form.formInfo (FormInfo)](reference/apis/js-apis-app-form-formInfo.md) + - [@ohos.app.form.formProvider (FormProvider)](reference/apis/js-apis-app-form-formProvider.md) - Both Models (To Be Deprecated Soon) - - [@ohos.ability.dataUriUtils](reference/apis/js-apis-ability-dataUriUtils.md) - - [@ohos.ability.errorCode](reference/apis/js-apis-ability-errorCode.md) - - [@ohos.ability.wantConstant](reference/apis/js-apis-ability-wantConstant.md) - - [@ohos.application.abilityDelegatorRegistry](reference/apis/js-apis-application-abilityDelegatorRegistry.md) - - [@ohos.application.abilityManager](reference/apis/js-apis-application-abilityManager.md) - - [@ohos.application.appManager](reference/apis/js-apis-application-appManager.md) - - [@ohos.application.Configuration](reference/apis/js-apis-application-configuration.md) - - [@ohos.application.ConfigurationConstant](reference/apis/js-apis-application-configurationConstant.md) - - [@ohos.application.errorManager](reference/apis/js-apis-application-errorManager.md) - - [@ohos.application.formBindingData](reference/apis/js-apis-application-formBindingData.md) - - [@ohos.application.formError](reference/apis/js-apis-application-formError.md) - - [@ohos.application.formHost](reference/apis/js-apis-application-formHost.md) - - [@ohos.application.formInfo](reference/apis/js-apis-application-formInfo.md) - - [@ohos.application.formProvider](reference/apis/js-apis-application-formProvider.md) - - [@ohos.application.missionManager](reference/apis/js-apis-application-missionManager.md) - - [@ohos.application.Want](reference/apis/js-apis-application-want.md) - - [@ohos.wantAgent](reference/apis/js-apis-wantAgent.md) + - [@ohos.ability.dataUriUtils (DataUriUtils)](reference/apis/js-apis-ability-dataUriUtils.md) + - [@ohos.ability.errorCode (ErrorCode)](reference/apis/js-apis-ability-errorCode.md) + - [@ohos.ability.wantConstant (wantConstant)](reference/apis/js-apis-ability-wantConstant.md) + - [@ohos.application.abilityDelegatorRegistry (AbilityDelegatorRegistry)](reference/apis/js-apis-application-abilityDelegatorRegistry.md) + - [@ohos.application.abilityManager (AbilityManager)](reference/apis/js-apis-application-abilityManager.md) + - [@ohos.application.appManager (appManager)](reference/apis/js-apis-application-appManager.md) + - [@ohos.application.Configuration (Configuration)](reference/apis/js-apis-application-configuration.md) + - [@ohos.application.ConfigurationConstant (ConfigurationConstant)](reference/apis/js-apis-application-configurationConstant.md) + - [@ohos.application.formBindingData (formBindingData)](reference/apis/js-apis-application-formBindingData.md) + - [@ohos.application.formError (FormError)](reference/apis/js-apis-application-formError.md) + - [@ohos.application.formHost (FormHost)](reference/apis/js-apis-application-formHost.md) + - [@ohos.application.formInfo (FormInfo)](reference/apis/js-apis-application-formInfo.md) + - [@ohos.application.formProvider (FormProvider)](reference/apis/js-apis-application-formProvider.md) + - [@ohos.application.missionManager (missionManager)](reference/apis/js-apis-application-missionManager.md) + - [@ohos.application.Want (Want)](reference/apis/js-apis-application-want.md) + - [@ohos.wantAgent (WantAgent)](reference/apis/js-apis-wantAgent.md) - Dependent Elements and Definitions - ability - [abilityResult](reference/apis/js-apis-inner-ability-abilityResult.md) @@ -824,7 +820,6 @@ - [context](reference/apis/js-apis-inner-app-context.md) - [processInfo](reference/apis/js-apis-inner-app-processInfo.md) - application - - [AbilityContext](reference/apis/js-apis-ability-context.md) - [abilityDelegator](reference/apis/js-apis-inner-application-abilityDelegator.md) - [abilityDelegatorArgs](reference/apis/js-apis-inner-application-abilityDelegatorArgs.md) - [abilityMonitor](reference/apis/js-apis-inner-application-abilityMonitor.md) @@ -849,13 +844,13 @@ - [MissionListener](reference/apis/js-apis-inner-application-missionListener.md) - [MissionParameter](reference/apis/js-apis-inner-application-missionParameter.md) - [MissionSnapshot](reference/apis/js-apis-inner-application-missionSnapshot.md) - - [PermissionRequestResult](reference/apis/js-apis-inner-application-permissionRequestResult.md) - [ProcessData](reference/apis/js-apis-inner-application-processData.md) - [ProcessRunningInfo](reference/apis/js-apis-inner-application-processRunningInfo.md) - - [ProcessRunningInformation](reference/apis/js-apis-inner-application-processRunningInformation.md) + - [ProcessInformation](reference/apis/js-apis-inner-application-processInformation.md) - [ServiceExtensionContext](reference/apis/js-apis-inner-application-serviceExtensionContext.md) - [UIAbilityContext](reference/apis/js-apis-inner-application-uiAbilityContext.md) - [shellCmdResult](reference/apis/js-apis-inner-application-shellCmdResult.md) + - [WindowExtensionContext](reference/apis/js-apis-inner-application-windowExtensionContext.md) - wantAgent - [triggerInfo](reference/apis/js-apis-inner-wantAgent-triggerInfo.md) - [wantAgentInfo](reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md) @@ -865,24 +860,24 @@ - [continuationExtraParams](reference/apis/js-apis-continuation-continuationExtraParams.md) - [continuationResult](reference/apis/js-apis-continuation-continuationResult.md) - Common Event and Notification - - [@ohos.commonEventManager](reference/apis/js-apis-commonEventManager.md) - - [@ohos.events.emitter](reference/apis/js-apis-emitter.md) - - [@ohos.notificationManager (Recommended)](reference/apis/js-apis-notificationManager.md) - - [@ohos.notificationSubscribe (Recommended)](reference/apis/js-apis-notificationSubscribe.md) - - [@ohos.commonEvent (To Be Deprecated Soon)](reference/apis/js-apis-commonEvent.md) - - [@ohos.notification](reference/apis/js-apis-notification.md) + - [@ohos.commonEventManager (Common Event) (Recommended)](reference/apis/js-apis-commonEventManager.md) + - [@ohos.events.emitter (Emitter)](reference/apis/js-apis-emitter.md) + - [@ohos.notificationManager (NotificationManager) (Recommended)](reference/apis/js-apis-notificationManager.md) + - [@ohos.notificationSubscribe (NotificationSubscribe) (Recommended)](reference/apis/js-apis-notificationSubscribe.md) + - [@ohos.commonEvent (Common Event) (To Be Deprecated Soon)](reference/apis/js-apis-commonEvent.md) + - [@ohos.notification (Notification) (To Be Deprecated Soon)](reference/apis/js-apis-notification.md) - application - [EventHub](reference/apis/js-apis-inner-application-eventHub.md) - Bundle Management - - [@ohos.bundle.appControl](reference/apis/js-apis-appControl.md) - - [@ohos.bundle.bundleManager](reference/apis/js-apis-bundleManager.md) - - [@ohos.bundle.bundleMonitor](reference/apis/js-apis-bundleMonitor.md) - - [@ohos.bundle.defaultAppManager](reference/apis/js-apis-defaultAppManager.md) - - [@ohos.bundle.distributedBundle](reference/apis/js-apis-distributedBundle.md) - - [@ohos.bundle.freeInstall](reference/apis/js-apis-freeInstall.md) - - [@ohos.bundle.installer](reference/apis/js-apis-installer.md) - - [@ohos.bundle.launcherBundleManager](reference/apis/js-apis-launcherBundleManager.md) - - [@ohos.zlib](reference/apis/js-apis-zlib.md) + - [@ohos.bundle.appControl(appControl)](reference/apis/js-apis-appControl.md) + - [@ohos.bundle.bundleManager (bundleManager)](reference/apis/js-apis-bundleManager.md) + - [@ohos.bundle.bundleMonitor (bundleMonitor)](reference/apis/js-apis-bundleMonitor.md) + - [@ohos.bundle.defaultAppManager (Default Application Management)](reference/apis/js-apis-defaultAppManager.md) + - [@ohos.bundle.distributedBundle (distributedBundleManager)](reference/apis/js-apis-distributedBundleManager.md) + - [@ohos.bundle.freeInstall (freeInstall)](reference/apis/js-apis-freeInstall.md) + - [@ohos.bundle.installer (installer)](reference/apis/js-apis-installer.md) + - [@ohos.bundle.launcherBundleManager (launcherBundleManager)](reference/apis/js-apis-launcherBundleManager.md) + - [@ohos.zlib (Zip)](reference/apis/js-apis-zlib.md) - bundleManager - [abilityInfo](reference/apis/js-apis-bundleManager-abilityInfo.md) - [applicationInfo](reference/apis/js-apis-bundleManager-applicationInfo.md) @@ -893,235 +888,244 @@ - [hapModuleInfo](reference/apis/js-apis-bundleManager-hapModuleInfo.md) - [launcherAbilityInfo](reference/apis/js-apis-bundleManager-launcherAbilityInfo.md) - [metadata](reference/apis/js-apis-bundleManager-metadata.md) - - [packInfo](reference/apis/js-apis-bundleManager-packInfo.md) - [permissionDef](reference/apis/js-apis-bundleManager-permissionDef.md) - [remoteAbilityInfo](reference/apis/js-apis-bundleManager-remoteAbilityInfo.md) - [shortcutInfo](reference/apis/js-apis-bundleManager-shortcutInfo.md) - UI Page - - [@ohos.animator](reference/apis/js-apis-animator.md) - - [@ohos.curves](reference/apis/js-apis-curve.md) - - [@ohos.matrix4](reference/apis/js-apis-matrix4.md) - - [@ohos.mediaquery](reference/apis/js-apis-mediaquery.md) - - [@ohos.promptAction](reference/apis/js-apis-promptAction.md) - - [@ohos.router](reference/apis/js-apis-router.md) + - [@ohos.animator (Animator)](reference/apis/js-apis-animator.md) + - [@ohos.curves (Interpolation Calculation)](reference/apis/js-apis-curve.md) + - [@ohos.matrix4 (Matrix Transformation)](reference/apis/js-apis-matrix4.md) + - [@ohos.mediaquery (Media Query)](reference/apis/js-apis-mediaquery.md) + - [@ohos.promptAction (Prompt)](reference/apis/js-apis-promptAction.md) + - [@ohos.router (Page Routing)](reference/apis/js-apis-router.md) - Graphics - - [@ohos.animation.windowAnimationManager](reference/apis/js-apis-windowAnimationManager.md) - - [@ohos.application.WindowExtensionAbility](reference/apis/js-apis-application-windowExtensionAbility.md) - - [@ohos.display](reference/apis/js-apis-display.md) - - [@ohos.effectKit](reference/apis/js-apis-effectKit.md) - - [@ohos.graphics.colorSpaceManager](reference/apis/js-apis-colorSpaceManager.md) - - [@ohos.screen](reference/apis/js-apis-screen.md) - - [@ohos.screenshot](reference/apis/js-apis-screenshot.md) - - [@ohos.window](reference/apis/js-apis-window.md) + - [@ohos.animation.windowAnimationManager (Window Animation Management)](reference/apis/js-apis-windowAnimationManager.md) + - [@ohos.application.WindowExtensionAbility (WindowExtensionAbility)](reference/apis/js-apis-application-windowExtensionAbility.md) + - [@ohos.display (Display)](reference/apis/js-apis-display.md) + - [@ohos.effectKit (Image Effects)](reference/apis/js-apis-effectKit.md) + - [@ohos.graphics.colorSpaceManager (Color Space Management)](reference/apis/js-apis-colorSpaceManager.md) + - [@ohos.screen (Screen)](reference/apis/js-apis-screen.md) + - [@ohos.screenshot (Screenshot)](reference/apis/js-apis-screenshot.md) + - [@ohos.window (Window)](reference/apis/js-apis-window.md) - webgl - - [webgl](reference/apis/js-apis-webgl.md) - - [webgl2](reference/apis/js-apis-webgl2.md) + - [WebGL](reference/apis/js-apis-webgl.md) + - [WebGL2](reference/apis/js-apis-webgl2.md) - Media - - [@ohos.multimedia.audio](reference/apis/js-apis-audio.md) - - [@ohos.multimedia.avsession](reference/apis/js-apis-avsession.md) - - [@ohos.multimedia.camera](reference/apis/js-apis-camera.md) - - [@ohos.multimedia.image](reference/apis/js-apis-image.md) - - [@ohos.multimedia.media](reference/apis/js-apis-media.md) + - [@ohos.multimedia.audio (Audio Management)](reference/apis/js-apis-audio.md) + - [@ohos.multimedia.avsession (AVSession Management)](reference/apis/js-apis-avsession.md) + - [@ohos.multimedia.camera (Camera Management)](reference/apis/js-apis-camera.md) + - [@ohos.multimedia.image (Image Processing)](reference/apis/js-apis-image.md) + - [@ohos.multimedia.media (Media)](reference/apis/js-apis-media.md) - Resource Management - - [@ohos.i18n](reference/apis/js-apis-i18n.md) - - [@ohos.intl](reference/apis/js-apis-intl.md) - - [@ohos.resourceManager](reference/apis/js-apis-resource-manager.md) + - [@ohos.i18n (Internationalization)](reference/apis/js-apis-i18n.md) + - [@ohos.intl (Internationalization)](reference/apis/js-apis-intl.md) + - [@ohos.resourceManager (Resource Manager)](reference/apis/js-apis-resource-manager.md) - Resource Scheduling - - [@ohos.distributedMissionManager](reference/apis/js-apis-distributedMissionManager.md) - - [@ohos.reminderAgentManager](reference/apis/js-apis-reminderAgentManager.md) - - [@ohos.resourceschedule.backgroundTaskManager](reference/apis/js-apis-resourceschedule-backgroundTaskManager.md) - - [@ohos.resourceschedule.workScheduler](reference/apis/js-apis-resourceschedule-workScheduler.md) - - [@ohos.resourceschedule.usageStatistics](reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md) - - [@ohos.WorkSchedulerExtensionAbility](reference/apis/js-apis-WorkSchedulerExtensionAbility.md) + - [@ohos.distributedMissionManager (Distributed Mission Management)](reference/apis/js-apis-distributedMissionManager.md) + - [@ohos.reminderAgentManager (Reminder Agent Management)](reference/apis/js-apis-reminderAgentManager.md) + - [@ohos.resourceschedule.backgroundTaskManager (Background Task Management)](reference/apis/js-apis-resourceschedule-backgroundTaskManager.md) + - [@ohos.resourceschedule.workScheduler (Work Scheduler)](reference/apis/js-apis-resourceschedule-workScheduler.md) + - [@ohos.resourceschedule.usageStatistics (Device Usage Statistics)](reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md) + - [@ohos.WorkSchedulerExtensionAbility (Work Scheduler Callbacks)](reference/apis/js-apis-WorkSchedulerExtensionAbility.md) - Security - - [@ohos.abilityAccessCtrl](reference/apis/js-apis-abilityAccessCtrl.md) - - [@ohos.privacyManager](reference/apis/js-apis-privacyManager.md) - - [@ohos.security.cryptoFramework](reference/apis/js-apis-cryptoFramework.md) - - [@ohos.security.huks](reference/apis/js-apis-huks.md) - - [@ohos.userIAM.faceAuth](reference/apis/js-apis-useriam-faceauth.md) - - [@ohos.userIAM.userAuth](reference/apis/js-apis-useriam-userauth.md) - - [@system.cipher](reference/apis/js-apis-system-cipher.md) + - [@ohos.abilityAccessCtrl (Ability Access Control)](reference/apis/js-apis-abilityAccessCtrl.md) + - [@ohos.privacyManager (Privacy Management)](reference/apis/js-apis-privacyManager.md) + - [@ohos.security.cert (Certificate)](reference/apis/js-apis-cert.md) + - [@ohos.security.cryptoFramework (Crypto Framework)](reference/apis/js-apis-cryptoFramework.md) + - [@ohos.security.huks (HUKS)](reference/apis/js-apis-huks.md) + - [@ohos.userIAM.faceAuth (Facial Authentication)](reference/apis/js-apis-useriam-faceauth.md) + - [@ohos.userIAM.userAuth (User Authentication)](reference/apis/js-apis-useriam-userauth.md) + - [@system.cipher (Cipher Algorithm)](reference/apis/js-apis-system-cipher.md) + - security + - [PermissionRequestResult](reference/apis/js-apis-permissionrequestresult.md) - Data Management - - [@ohos.data.dataAbility](reference/apis/js-apis-data-ability.md) - - [@ohos.data.dataShare](reference/apis/js-apis-data-dataShare.md) - - [@ohos.data.dataSharePredicates](reference/apis/js-apis-data-dataSharePredicates.md) - - [@ohos.data.dataShareResultSet](reference/apis/js-apis-data-DataShareResultSet.md) - - [@ohos.data.distributedDataObject](reference/apis/js-apis-data-distributedobject.md) - - [@ohos.data.distributedKVStore](reference/apis/js-apis-distributedKVStore.md) - - [@ohos.data.preferences](reference/apis/js-apis-data-preferences.md) - - [@ohos.data.rdb](reference/apis/js-apis-data-rdb.md) + - [@ohos.data.dataAbility (DataAbility Predicates)](reference/apis/js-apis-data-ability.md) + - [@ohos.data.dataShare (DataShare)](reference/apis/js-apis-data-dataShare.md) + - [@ohos.data.dataSharePredicates (DataShare Predicates)](reference/apis/js-apis-data-dataSharePredicates.md) + - [@ohos.data.dataShareResultSet (DataShare Result Set)](reference/apis/js-apis-data-DataShareResultSet.md) + - [@ohos.data.distributedDataObject (Distributed Data Object)](reference/apis/js-apis-data-distributedobject.md) + - [@ohos.data.distributedKVStore (Distributed KV Store)](reference/apis/js-apis-distributedKVStore.md) + - [@ohos.data.preferences (Preferences)](reference/apis/js-apis-data-preferences.md) + - [@ohos.data.relationalStore (RDB Store)](reference/apis/js-apis-data-relationalStore.md) - [@ohos.data.ValuesBucket](reference/apis/js-apis-data-valuesBucket.md) - data/rdb - - [resultSet](reference/apis/js-apis-data-resultset.md) + - [resultSet (Result Set)](reference/apis/js-apis-data-resultset.md) - File Management - - [@ohos.environment](reference/apis/js-apis-environment.md) - - [@ohos.data.fileAccess](reference/apis/js-apis-fileAccess.md) - - [@ohos.fileExtensionInfo](reference/apis/js-apis-fileExtensionInfo.md) - - [@ohos.fileio](reference/apis/js-apis-fileio.md) - - [@ohos.filemanagement.userFileManager](reference/apis/js-apis-userFileManager.md) - - [@ohos.multimedia.medialibrary](reference/apis/js-apis-medialibrary.md) - - [@ohos.securityLabel](reference/apis/js-apis-securityLabel.md) - - [@ohos.statfs](reference/apis/js-apis-statfs.md) - - [@ohos.storageStatistics](reference/apis/js-apis-storage-statistics.md) - - [@ohos.volumeManager](reference/apis/js-apis-volumemanager.md) + - [@ohos.file.environment (Directory Environment Capability)](reference/apis/js-apis-file-environment.md) + - [@ohos.file.fileAccess (User File Access and Management)](reference/apis/js-apis-fileAccess.md) + - [@ohos.file.fileExtensionInfo (User File Extension Information)](reference/apis/js-apis-fileExtensionInfo.md) + - [@ohos.file.fs (File Management)](reference/apis/js-apis-file-fs.md) + - [@ohos.file.hash (File Hash Processing)](reference/apis/js-apis-file-hash.md) + - [@ohos.file.securityLabel (Data Label)](reference/apis/js-apis-file-securityLabel.md) + - [@ohos.file.statvfs (File System Space Statistics)](reference/apis/js-apis-file-statvfs.md) + - [@ohos.storageStatistics (Application Storage Statistics)](reference/apis/js-apis-file-storage-statistics.md) + - [@ohos.volumeManager (Volume Management)](reference/apis/js-apis-file-volumemanager.md) + - [@ohos.filemanagement.userFileManager (User Data Management)](reference/apis/js-apis-userFileManager.md) + - [@ohos.multimedia.medialibrary (Media Library Management)](reference/apis/js-apis-medialibrary.md) - Telephony Service - - [@ohos.contact](reference/apis/js-apis-contact.md) - - [@ohos.telephony.call](reference/apis/js-apis-call.md) - - [@ohos.telephony.data](reference/apis/js-apis-telephony-data.md) - - [@ohos.telephony.observer](reference/apis/js-apis-observer.md) - - [@ohos.telephony.radio](reference/apis/js-apis-radio.md) - - [@ohos.telephony.sim](reference/apis/js-apis-sim.md) - - [@ohos.telephony.sms](reference/apis/js-apis-sms.md) + - [@ohos.contact (Contacts)](reference/apis/js-apis-contact.md) + - [@ohos.telephony.call (Call)](reference/apis/js-apis-call.md) + - [@ohos.telephony.data (Cellular Data)](reference/apis/js-apis-telephony-data.md) + - [@ohos.telephony.observer (Observer)](reference/apis/js-apis-observer.md) + - [@ohos.telephony.radio (Network Search)](reference/apis/js-apis-radio.md) + - [@ohos.telephony.sim (SIM Management)](reference/apis/js-apis-sim.md) + - [@ohos.telephony.sms (SMS)](reference/apis/js-apis-sms.md) - Network Management - - [@ohos.net.connection](reference/apis/js-apis-net-connection.md) - - [@ohos.net.ethernet](reference/apis/js-apis-net-ethernet.md) - - [@ohos.net.http](reference/apis/js-apis-http.md) - - [@ohos.net.sharing](reference/apis/js-apis-net-sharing.md) - - [@ohos.net.socket](reference/apis/js-apis-socket.md) - - [@ohos.net.webSocket](reference/apis/js-apis-webSocket.md) - - [@ohos.request](reference/apis/js-apis-request.md) + - [@ohos.net.connection (Network Connection Management)](reference/apis/js-apis-net-connection.md) + - [@ohos.net.ethernet (Ethernet Connection Management)](reference/apis/js-apis-net-ethernet.md) + - [@ohos.net.http (Data Request)](reference/apis/js-apis-http.md) + - [@ohos.net.sharing (Network Sharing)](reference/apis/js-apis-net-sharing.md) + - [@ohos.net.socket (Socket Connection)](reference/apis/js-apis-socket.md) + - [@ohos.net.webSocket (WebSocket Connection)](reference/apis/js-apis-webSocket.md) + - [@ohos.request (Upload and Download)](reference/apis/js-apis-request.md) - Connectivity - - [@ohos.bluetooth](reference/apis/js-apis-bluetooth.md) - - [@ohos.connectedTag](reference/apis/js-apis-connectedTag.md) - - [@ohos.nfc.cardEmulation](reference/apis/js-apis-cardEmulation.md) - - [@ohos.nfc.controller](reference/apis/js-apis-nfcController.md) - - [@ohos.nfc.tag](reference/apis/js-apis-nfcTag.md) - - [@ohos.rpc](reference/apis/js-apis-rpc.md) - - [@ohos.wifiManager (Recommended)](reference/apis/js-apis-wifiManager.md) - - [@ohos.wifiManagerExt (Recommended)](reference/apis/js-apis-wifiManagerExt.md) - - [@ohos.wifi (To Be Deprecated Soon)](reference/apis/js-apis-wifi.md) - - [@ohos.wifiext (To Be Deprecated Soon)](reference/apis/js-apis-wifiext.md) + - [@ohos.bluetooth (Bluetooth)](reference/apis/js-apis-bluetooth.md) + - [@ohos.connectedTag (Active Tags)](reference/apis/js-apis-connectedTag.md) + - [@ohos.nfc.cardEmulation (Standard NFC Card Emulation)](reference/apis/js-apis-cardEmulation.md) + - [@ohos.nfc.controller (Standard NFC)](reference/apis/js-apis-nfcController.md) + - [@ohos.nfc.tag (Standard NFC Tags)](reference/apis/js-apis-nfcTag.md) + - [@ohos.rpc (RPC)](reference/apis/js-apis-rpc.md) + - [@ohos.wifiManager (WLAN)](reference/apis/js-apis-wifiManager.md) + - [@ohos.wifiManagerExt (WLAN Extension)](reference/apis/js-apis-wifiManagerExt.md) + - [@ohos.wifi (To Be Deprecated)](reference/apis/js-apis-wifi.md) + - [@ohos.wifiext (To Be Deprecated)](reference/apis/js-apis-wifiext.md) - tag - - [nfctech](reference/apis/js-apis-nfctech.md) - - [tagSession](reference/apis/js-apis-tagSession.md) + - [nfctech (Standard NFC Technologies)](reference/apis/js-apis-nfctech.md) + - [tagSession (Standard NFC Tag Session)](reference/apis/js-apis-tagSession.md) - Basic Features - - [@ohos.accessibility](reference/apis/js-apis-accessibility.md) - - [@ohos.accessibility.config](reference/apis/js-apis-accessibility-config.md) - - [@ohos.accessibility.GesturePath](reference/apis/js-apis-accessibility-GesturePath.md) - - [@ohos.accessibility.GesturePoint](reference/apis/js-apis-accessibility-GesturePoint.md) - - [@ohos.application.AccessibilityExtensionAbility](reference/apis/js-apis-application-accessibilityExtensionAbility.md) - - [@ohos.faultLogger](reference/apis/js-apis-faultLogger.md) - - [@ohos.hichecker](reference/apis/js-apis-hichecker.md) - - [@ohos.hidebug](reference/apis/js-apis-hidebug.md) - - [@ohos.hilog](reference/apis/js-apis-hilog.md) - - [@ohos.hiSysEvent](reference/apis/js-apis-hisysevent.md) - - [@ohos.hiTraceChain](reference/apis/js-apis-hitracechain.md) - - [@ohos.hiTraceMeter](reference/apis/js-apis-hitracemeter.md) - - [@ohos.hiviewdfx.hiAppEvent](reference/apis/js-apis-hiviewdfx-hiappevent.md) - - [@ohos.inputmethod](reference/apis/js-apis-inputmethod.md) - - [@ohos.inputmethodengine](reference/apis/js-apis-inputmethodengine.md) - - [@ohos.inputmethodextensionability](reference/apis/js-apis-inputmethod-extension-ability.md) - - [@ohos.inputmethodextensioncontext](reference/apis/js-apis-inputmethod-extension-context.md) - - [@ohos.inputmethodsubtype](reference/apis/js-apis-inputmethod-subtype.md) - - [@ohos.pasteboard](reference/apis/js-apis-pasteboard.md) - - [@ohos.screenLock](reference/apis/js-apis-screen-lock.md) - - [@ohos.systemTime](reference/apis/js-apis-system-time.md) - - [@ohos.systemTimer](reference/apis/js-apis-system-timer.md) - - [@ohos.wallpaper](reference/apis/js-apis-wallpaper.md) - - [@ohos.web.webview](reference/apis/js-apis-webview.md) - - [console](reference/apis/js-apis-logs.md) + - [@ohos.accessibility (Accessibility)](reference/apis/js-apis-accessibility.md) + - [@ohos.accessibility.config (System Accessibility Configuration)](reference/apis/js-apis-accessibility-config.md) + - [@ohos.accessibility.GesturePath (Gesture Path)](reference/apis/js-apis-accessibility-GesturePath.md) + - [@ohos.accessibility.GesturePoint (Gesture Point)](reference/apis/js-apis-accessibility-GesturePoint.md) + - [@ohos.application.AccessibilityExtensionAbility (AccessibilityExtensionAbility)](reference/apis/js-apis-application-accessibilityExtensionAbility.md) + - [@ohos.faultLogger (FaultLogger)](reference/apis/js-apis-faultLogger.md) + - [@ohos.hichecker (HiChecker)](reference/apis/js-apis-hichecker.md) + - [@ohos.hidebug (HiDebug)](reference/apis/js-apis-hidebug.md) + - [@ohos.hilog (HiLog)](reference/apis/js-apis-hilog.md) + - [@ohos.hiSysEvent (System Event Logging)](reference/apis/js-apis-hisysevent.md) + - [@ohos.hiTraceChain (Distributed Call Chain Tracing)](reference/apis/js-apis-hitracechain.md) + - [@ohos.hiTraceMeter (Performance Tracing)](reference/apis/js-apis-hitracemeter.md) + - [@ohos.hiviewdfx.hiAppEvent (Application Event Logging)](reference/apis/js-apis-hiviewdfx-hiappevent.md) + - [@ohos.inputMethod (Input Method Framework)](reference/apis/js-apis-inputmethod.md) + - [@ohos.inputMethodEngine (Input Method Service)](reference/apis/js-apis-inputmethodengine.md) + - [@ohos.InputMethodExtensionAbility (InputMethodExtensionAbility)](reference/apis/js-apis-inputmethod-extension-ability.md) + - [@ohos.InputMethodExtensionContext (InputMethodExtensionContext)](reference/apis/js-apis-inputmethod-extension-context.md) + - [@ohos.InputMethodSubtype (Input Method Subtype)](reference/apis/js-apis-inputmethod-subtype.md) + - [@ohos.pasteboard (Pasteboard)](reference/apis/js-apis-pasteboard.md) + - [@ohos.screenLock (Screenlock)](reference/apis/js-apis-screen-lock.md) + - [@ohos.systemDateTime (System Time and Time Zone)](reference/apis/js-apis-system-date-time.md) + - [@ohos.systemTimer (System Timer)](reference/apis/js-apis-system-timer.md) + - [@ohos.wallpaper (Wallpaper)](reference/apis/js-apis-wallpaper.md) + - [@ohos.web.webview (Webview)](reference/apis/js-apis-webview.md) + - [console (Log)](reference/apis/js-apis-logs.md) - [Timer](reference/apis/js-apis-timer.md) - application - [AccessibilityExtensionContext](reference/apis/js-apis-inner-application-accessibilityExtensionContext.md) - Device Management - - [@ohos.batteryInfo](reference/apis/js-apis-battery-info.md) - - [@ohos.batteryStatistics](reference/apis/js-apis-batteryStatistics.md) - - [@ohos.brightness](reference/apis/js-apis-brightness.md) - - [@ohos.deviceInfo](reference/apis/js-apis-device-info.md) - - [@ohos.distributedHardware.deviceManager](reference/apis/js-apis-device-manager.md) - - [@ohos.geoLocationManager](reference/apis/js-apis-geoLocationManager.md) - - [@ohos.multimodalInput.inputConsumer](reference/apis/js-apis-inputconsumer.md) - - [@ohos.multimodalInput.inputDevice](reference/apis/js-apis-inputdevice.md) - - [@ohos.multimodalInput.inputDeviceCooperate](reference/apis/js-apis-cooperate.md) - - [@ohos.multimodalInput.inputEvent](reference/apis/js-apis-inputevent.md) - - [@ohos.multimodalInput.inputEventClient](reference/apis/js-apis-inputeventclient.md) - - [@ohos.multimodalInput.inputMonitor](reference/apis/js-apis-inputmonitor.md) - - [@ohos.multimodalInput.keyCode](reference/apis/js-apis-keycode.md) - - [@ohos.multimodalInput.keyEvent](reference/apis/js-apis-keyevent.md) - - [@ohos.multimodalInput.mouseEvent](reference/apis/js-apis-mouseevent.md) - - [@ohos.multimodalInput.pointer](reference/apis/js-apis-pointer.md) - - [@ohos.multimodalInput.touchEvent](reference/apis/js-apis-touchevent.md) - - [@ohos.power](reference/apis/js-apis-power.md) - - [@ohos.runningLock](reference/apis/js-apis-runninglock.md) - - [@ohos.sensor](reference/apis/js-apis-sensor.md) - - [@ohos.settings](reference/apis/js-apis-settings.md) - - [@ohos.stationary](reference/apis/js-apis-stationary.md) - - [@ohos.systemParameterV9](reference/apis/js-apis-system-parameterV9.md) - - [@ohos.thermal](reference/apis/js-apis-thermal.md) - - [@ohos.update](reference/apis/js-apis-update.md) - - [@ohos.usb](reference/apis/js-apis-usb.md) - - [@ohos.vibrator](reference/apis/js-apis-vibrator.md) + - [@ohos.batteryInfo (Battery Information)](reference/apis/js-apis-battery-info.md) + - [@ohos.batteryStatistics (Battery Statistics)](reference/apis/js-apis-batteryStatistics.md) + - [@ohos.brightness (Screen Brightness)](reference/apis/js-apis-brightness.md) + - [@ohos.deviceInfo (Device Information)](reference/apis/js-apis-device-info.md) + - [@ohos.distributedHardware.deviceManager (Device Management)](reference/apis/js-apis-device-manager.md) + - [@ohos.geoLocationManager (Geolocation Manager)](reference/apis/js-apis-geoLocationManager.md) + - [@ohos.multimodalInput.inputConsumer (Input Consumer)](reference/apis/js-apis-inputconsumer.md) + - [@ohos.multimodalInput.inputDevice (Input Device)](reference/apis/js-apis-inputdevice.md) + - [@ohos.multimodalInput.inputDeviceCooperate (Screen Hopping)](reference/apis/js-apis-cooperate.md) + - [@ohos.multimodalInput.inputEvent (Input Event)](reference/apis/js-apis-inputevent.md) + - [@ohos.multimodalInput.inputEventClient (Key Event Injection)](reference/apis/js-apis-inputeventclient.md) + - [@ohos.multimodalInput.inputMonitor (Input Monitor)](reference/apis/js-apis-inputmonitor.md) + - [@ohos.multimodalInput.keyCode (Key Code)](reference/apis/js-apis-keycode.md) + - [@ohos.multimodalInput.keyEvent (Key Event)](reference/apis/js-apis-keyevent.md) + - [@ohos.multimodalInput.mouseEvent (Mouse Event)](reference/apis/js-apis-mouseevent.md) + - [@ohos.multimodalInput.pointer (Mouse Pointer)](reference/apis/js-apis-pointer.md) + - [@ohos.multimodalInput.touchEvent (Touch Event)](reference/apis/js-apis-touchevent.md) + - [@ohos.power (System Power Management)](reference/apis/js-apis-power.md) + - [@ohos.runningLock (Runninglock)](reference/apis/js-apis-runninglock.md) + - [@ohos.sensor (Sensor)](reference/apis/js-apis-sensor.md) + - [@ohos.settings (Data Item Settings)](reference/apis/js-apis-settings.md) + - [@ohos.stationary (Device Status Awareness Framework)](reference/apis/js-apis-stationary.md) + - [@ohos.systemCapability (SystemCapability)](reference/apis/js-apis-system-capability.md) + - [@ohos.systemParameterEnhance (System Parameter)](reference/apis/js-apis-system-parameterEnhance.md) + - [@ohos.thermal (Thermal Management)](reference/apis/js-apis-thermal.md) + - [@ohos.update (Update)](reference/apis/js-apis-update.md) + - [@ohos.usbManager (USB Management)](reference/apis/js-apis-usbManager.md) + - [@ohos.vibrator (Vibrator)](reference/apis/js-apis-vibrator.md) - Account Management - - [@ohos.account.appAccount](reference/apis/js-apis-appAccount.md) - - [@ohos.account.distributedAccount](reference/apis/js-apis-distributed-account.md) - - [@ohos.account.osAccount](reference/apis/js-apis-osAccount.md) + - [@ohos.account.appAccount (App Account Management)](reference/apis/js-apis-appAccount.md) + - [@ohos.account.distributedAccount (Distributed Account Management)](reference/apis/js-apis-distributed-account.md) + - [@ohos.account.osAccount (OS Account Management)](reference/apis/js-apis-osAccount.md) - Custom Management - - [@ohos.configPolicy](reference/apis/js-apis-configPolicy.md) - - [@ohos.enterprise.deviceInfo](reference/apis/js-apis-enterprise-deviceInfo.md) - - [@ohos.enterprise.EnterpriseAdminExtensionAbility](reference/apis/js-apis-EnterpriseAdminExtensionAbility.md) - - [@ohos.enterprise.adminManager](reference/apis/js-apis-enterprise-adminManager.md) - - [@ohos.enterprise.dateTimeManager](reference/apis/js-apis-enterprise-dateTimeManager.md) + - [@ohos.configPolicy (Configuration Policy)](reference/apis/js-apis-configPolicy.md) + - [@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)](reference/apis/js-apis-EnterpriseAdminExtensionAbility.md) + - [@ohos.enterprise.adminManager (Enterprise Device Management)](reference/apis/js-apis-enterprise-adminManager.md) + - [@ohos.enterprise.dateTimeManager (System Time Management)](reference/apis/js-apis-enterprise-dateTimeManager.md) - Language Base Class Library - - [@ohos.buffer](reference/apis/js-apis-buffer.md) - - [@ohos.convertxml](reference/apis/js-apis-convertxml.md) - - [@ohos.process](reference/apis/js-apis-process.md) - - [@ohos.uri](reference/apis/js-apis-uri.md) - - [@ohos.url](reference/apis/js-apis-url.md) - - [@ohos.util](reference/apis/js-apis-util.md) - - [@ohos.util.ArrayList](reference/apis/js-apis-arraylist.md) - - [@ohos.util.Deque](reference/apis/js-apis-deque.md) - - [@ohos.util.HashMap](reference/apis/js-apis-hashmap.md) - - [@ohos.util.HashSet](reference/apis/js-apis-hashset.md) - - [@ohos.util.LightWeightMap](reference/apis/js-apis-lightweightmap.md) - - [@ohos.util.LightWeightSet](reference/apis/js-apis-lightweightset.md) - - [@ohos.util.LinkedList](reference/apis/js-apis-linkedlist.md) - - [@ohos.util.List](reference/apis/js-apis-list.md) - - [@ohos.util.PlainArray](reference/apis/js-apis-plainarray.md) - - [@ohos.util.Queue](reference/apis/js-apis-queue.md) - - [@ohos.util.Stack](reference/apis/js-apis-stack.md) - - [@ohos.util.TreeMap](reference/apis/js-apis-treemap.md) - - [@ohos.util.TreeSet](reference/apis/js-apis-treeset.md) - - [@ohos.util.Vector](reference/apis/js-apis-vector.md) - - [@ohos.worker](reference/apis/js-apis-worker.md) - - [@ohos.xml](reference/apis/js-apis-xml.md) + - [@ohos.buffer (Buffer)](reference/apis/js-apis-buffer.md) + - [@ohos.convertxml (XML-to-JavaScript Conversion)](reference/apis/js-apis-convertxml.md) + - [@ohos.process (Obtaining Process Information)](reference/apis/js-apis-process.md) + - [@ohos.taskpool (Using the Task Pool)](reference/apis/js-apis-taskpool.md) + - [@ohos.uri (URI String Parsing)](reference/apis/js-apis-uri.md) + - [@ohos.url (URL String Parsing)](reference/apis/js-apis-url.md) + - [@ohos.util (util)](reference/apis/js-apis-util.md) + - [@ohos.util.ArrayList (Linear Container ArrayList)](reference/apis/js-apis-arraylist.md) + - [@ohos.util.Deque (Linear Container Deque)](reference/apis/js-apis-deque.md) + - [@ohos.util.HashMap (Nonlinear Container HashMap)](reference/apis/js-apis-hashmap.md) + - [@ohos.util.HashSet (Nonlinear Container HashSet)](reference/apis/js-apis-hashset.md) + - [@ohos.util.LightWeightMap (Nonlinear Container LightWeightMap)](reference/apis/js-apis-lightweightmap.md) + - [@ohos.util.LightWeightSet (Nonlinear Container LightWeightSet)](reference/apis/js-apis-lightweightset.md) + - [@ohos.util.LinkedList (Linear Container LinkedList)](reference/apis/js-apis-linkedlist.md) + - [@ohos.util.List (Linear Container List)](reference/apis/js-apis-list.md) + - [@ohos.util.PlainArray (Nonlinear Container PlainArray)](reference/apis/js-apis-plainarray.md) + - [@ohos.util.Queue (Linear Container Queue)](reference/apis/js-apis-queue.md) + - [@ohos.util.Stack (Linear Container Stack)](reference/apis/js-apis-stack.md) + - [@ohos.util.TreeMap (Nonlinear Container TreeMap)](reference/apis/js-apis-treemap.md) + - [@ohos.util.TreeSet (Nonlinear Container TreeSet)](reference/apis/js-apis-treeset.md) + - [@ohos.util.Vector (Linear Container Vector)](reference/apis/js-apis-vector.md) + - [@ohos.worker (Worker Startup)](reference/apis/js-apis-worker.md) + - [@ohos.xml (XML Parsing and Generation)](reference/apis/js-apis-xml.md) - Test - [@ohos.application.testRunner (TestRunner)](reference/apis/js-apis-application-testRunner.md) - [@ohos.uitest](reference/apis/js-apis-uitest.md) - APIs No Longer Maintained - - [@ohos.backgroundTaskManager](reference/apis/js-apis-backgroundTaskManager.md) - - [@ohos.bundle](reference/apis/js-apis-Bundle.md) - - [@ohos.bundle.innerBundleManager](reference/apis/js-apis-Bundle-InnerBundleManager.md) - - [@ohos.bundleState](reference/apis/js-apis-deviceUsageStatistics.md) - - [@ohos.bytrace](reference/apis/js-apis-bytrace.md) - - [@ohos.data.storage](reference/apis/js-apis-data-storage.md) - - [@ohos.data.distributedData](reference/apis/js-apis-distributed-data.md) - - [@ohos.distributedBundle](reference/apis/js-apis-Bundle-distributedBundle.md) - - [@ohos.document](reference/apis/js-apis-document.md) - - [@ohos.geolocation](reference/apis/js-apis-geolocation.md) - - [@ohos.hiAppEvent](reference/apis/js-apis-hiappevent.md) - - [@ohos.prompt](reference/apis/js-apis-prompt.md) - - [@ohos.reminderAgent](reference/apis/js-apis-reminderAgent.md) - - [@ohos.systemParameter](reference/apis/js-apis-system-parameter.md) - - [@ohos.usb](reference/apis/js-apis-usb-deprecated.md) - - [@system.app](reference/apis/js-apis-system-app.md) - - [@system.battery](reference/apis/js-apis-system-battery.md) - - [@system.bluetooth](reference/apis/js-apis-system-bluetooth.md) - - [@system.brightness](reference/apis/js-apis-system-brightness.md) - - [@system.configuration](reference/apis/js-apis-system-configuration.md) - - [@system.device](reference/apis/js-apis-system-device.md) - - [@system.fetch](reference/apis/js-apis-system-fetch.md) - - [@system.file](reference/apis/js-apis-system-file.md) - - [@system.geolocation](reference/apis/js-apis-system-location.md) - - [@system.mediaquery](reference/apis/js-apis-system-mediaquery.md) - - [@system.network](reference/apis/js-apis-system-network.md) - - [@system.notification](reference/apis/js-apis-system-notification.md) - - [@system.package](reference/apis/js-apis-system-package.md) - - [@system.prompt](reference/apis/js-apis-system-prompt.md) - - [@system.request](reference/apis/js-apis-system-request.md) - - [@system.router](reference/apis/js-apis-system-router.md) - - [@system.sensor](reference/apis/js-apis-system-sensor.md) - - [@system.storage](reference/apis/js-apis-system-storage.md) - - [@system.vibrator](reference/apis/js-apis-system-vibrate.md) + - [@ohos.backgroundTaskManager (Background Task Management)](reference/apis/js-apis-backgroundTaskManager.md) + - [@ohos.bundle (Bundle)](reference/apis/js-apis-Bundle.md) + - [@ohos.bundle.innerBundleManager (innerBundleManager)](reference/apis/js-apis-Bundle-InnerBundleManager.md) + - [@ohos.bundleState (Device Usage Statistics)](reference/apis/js-apis-deviceUsageStatistics.md) + - [@ohos.bytrace (Performance Tracing)](reference/apis/js-apis-bytrace.md) + - [@ohos.data.distributedData (Distributed Data Management)](reference/apis/js-apis-distributed-data.md) + - [@ohos.data.storage (Lightweight Data Storage)](reference/apis/js-apis-data-storage.md) + - [@ohos.data.rdb (RDB)](reference/apis/js-apis-data-rdb.md) + - [@ohos.distributedBundle (Distributed Bundle Management)](reference/apis/js-apis-Bundle-distributedBundle.md) + - [@ohos.document (File Operation)](reference/apis/js-apis-document.md) + - [@ohos.fileio (File Management)](reference/apis/js-apis-fileio.md) + - [@ohos.geolocation (Geolocation)](reference/apis/js-apis-geolocation.md) + - [@ohos.hiAppEvent (Application Event Logging)](reference/apis/js-apis-hiappevent.md) + - [@ohos.prompt (Prompt)](reference/apis/js-apis-prompt.md) + - [@ohos.reminderAgent (Reminder Agent)](reference/apis/js-apis-reminderAgent.md) + - [@ohos.statfs (statfs)](reference/apis/js-apis-statfs.md) + - [@ohos.systemParameter (System Parameter)](reference/apis/js-apis-system-parameter.md) + - [@ohos.systemTime (System Time and Time Zone)](reference/apis/js-apis-system-time.md) + - [@ohos.usb (USB Management)](reference/apis/js-apis-usb-deprecated.md) + - [@ohos.usbV9 (USB Management)](reference/apis/js-apis-usb.md) + - [@system.app (Application Context)](reference/apis/js-apis-system-app.md) + - [@system.battery (Battery Information)](reference/apis/js-apis-system-battery.md) + - [@system.bluetooth (Bluetooth)](reference/apis/js-apis-system-bluetooth.md) + - [@system.brightness (Screen Brightness)](reference/apis/js-apis-system-brightness.md) + - [@system.configuration (Application Configuration)](reference/apis/js-apis-system-configuration.md) + - [@system.device (Device Information)](reference/apis/js-apis-system-device.md) + - [@system.fetch (Data Request)](reference/apis/js-apis-system-fetch.md) + - [@system.file (File Storage)](reference/apis/js-apis-system-file.md) + - [@system.geolocation (Geographic Location)](reference/apis/js-apis-system-location.md) + - [@system.mediaquery (Media Query)](reference/apis/js-apis-system-mediaquery.md) + - [@system.network (Network State)](reference/apis/js-apis-system-network.md) + - [@system.notification (Notification)](reference/apis/js-apis-system-notification.md) + - [@system.package (Bundle Management)](reference/apis/js-apis-system-package.md) + - [@system.prompt (Prompt)](reference/apis/js-apis-system-prompt.md) + - [@system.request (Upload and Download)](reference/apis/js-apis-system-request.md) + - [@system.router (Page Routing)](reference/apis/js-apis-system-router.md) + - [@system.sensor (Sensor)](reference/apis/js-apis-system-sensor.md) + - [@system.storage (Data Storage)](reference/apis/js-apis-system-storage.md) + - [@system.vibrator (Vibrator)](reference/apis/js-apis-system-vibrate.md) - bundle - [abilityInfo](reference/apis/js-apis-bundle-AbilityInfo.md) - [applicationInfo](reference/apis/js-apis-bundle-ApplicationInfo.md) @@ -1147,6 +1151,7 @@ - [zlib Error Codes](reference/errorcodes/errorcode-zlib.md) - Common Events and Notification - [Event Error Codes](reference/errorcodes/errorcode-CommonEventService.md) + - [Notification Error Codes](reference/errorcodes/errorcode-notification.md) - [DistributedNotificationService Error Codes](reference/errorcodes/errorcode-DistributedNotificationService.md) - UI Page - [Animator Error Codes](reference/errorcodes/errorcode-animator.md) @@ -1165,14 +1170,18 @@ - [Resource Manager Error Codes](reference/errorcodes/errorcode-resource-manager.md) - Resource Scheduling - [backgroundTaskManager Error Codes](reference/errorcodes/errorcode-backgroundTaskMgr.md) - - [DeviceUsageStatistics Error Codes](reference/errorcodes/errorcode-DeviceUsageStatistics.md) - [reminderAgentManager Error Codes](reference/errorcodes/errorcode-reminderAgentManager.md) - [workScheduler Error Codes](reference/errorcodes/errorcode-workScheduler.md) - Security - [Ability Access Control Error Codes](reference/errorcodes/errorcode-access-token.md) - [HUKS Error Codes](reference/errorcodes/errorcode-huks.md) + - [Crypto Framework Error Codes](reference/errorcodes/errorcode-crypto-framework.md) + - [Certificate Error Codes](reference/errorcodes/errorcode-cert.md) + - [User Authentication Error Codes](reference/errorcodes/errorcode-useriam.md) - Data Management - [RDB Error Codes](reference/errorcodes/errorcode-data-rdb.md) + - [DataShare Error Codes](reference/errorcodes/errorcode-datashare.md) + - [Distributed Data Object Error Codes](reference/errorcodes/errorcode-distributed-dataObject.md) - [Distributed KV Store Error Codes](reference/errorcodes/errorcode-distributedKVStore.md) - [Preferences Error Codes](reference/errorcodes/errorcode-preferences.md) - File Management @@ -1190,11 +1199,10 @@ - [HiDebug Error Codes](reference/errorcodes/errorcode-hiviewdfx-hidebug.md) - [Input Method Framework Error Codes](reference/errorcodes/errorcode-inputmethod-framework.md) - [Pasteboard Error Codes](reference/errorcodes/errorcode-pasteboard.md) - - [Screen Lock Management Error Codes](reference/errorcodes/errorcode-screenlock.md) + - [Time and Time Zone Service Error Codes](reference/errorcodes/errorcode-time.md) - [Webview Error Codes](reference/errorcodes/errorcode-webview.md) - Account Management - [Account Error Codes](reference/errorcodes/errorcode-account.md) - - [App Account Error Codes](reference/errorcodes/errorcode-app-account.md) - Device Management - [Power Consumption Statistics Error Codes](reference/errorcodes/errorcode-batteryStatistics.md) - [Brightness Error Codes](reference/errorcodes/errorcode-brightness.md) @@ -1209,8 +1217,11 @@ - [System Parameter Error Codes](reference/errorcodes/errorcode-system-parameterV9.md) - [USB Error Codes](reference/errorcodes/errorcode-usb.md) - [Update Error Codes](reference/errorcodes/errorcode-update.md) + - [DeviceUsageStatistics Error Codes](reference/errorcodes/errorcode-DeviceUsageStatistics.md) - Customization Management - [Enterprise Device Management Error Codes](reference/errorcodes/errorcode-enterpriseDeviceManager.md) + - Language Base Class Library + - [Utils Error Codes](reference/errorcodes/errorcode-utils.md) - Test - [UiTest Error Codes](reference/errorcodes/errorcode-uitest.md) - Native APIs diff --git a/en/release-notes/OpenHarmony-v3.2-beta5.md b/en/release-notes/OpenHarmony-v3.2-beta5.md new file mode 100644 index 0000000000000000000000000000000000000000..e7e5e09a3e2e6b31c4f739dcde007bb192fff3a9 --- /dev/null +++ b/en/release-notes/OpenHarmony-v3.2-beta5.md @@ -0,0 +1,214 @@ +# OpenHarmony 3.2 Beta5 + + +## Version Description + +OpenHarmony 3.2 Beta5 provides the following enhancements over OpenHarmony 3.2 Beta4: + +**Enhanced basic capabilities for the standard system** + +The startup performance of the WebView component is optimized. Configuration management and input event support capabilities are enhanced. JSON files can be imported and loaded in modular mode. + +The task pool and the TS2AOT-tool of the host version are provided. The dynamic library of the HAP package can be loaded without being compressed. The compiler runtime supports shared packages in the same application. + +The dynamic shared library can be installed, updated, uninstalled, packed, and unpacked. For an application that is not configured with an entry icon, a default icon is displayed on the home screen. The runtime capability of the HAR shared package can be verified. + +The local database is changed for widgets. Protection against frequent restart is provided for applications. The ServiceExtensionAbility component supports the asynchronous **onConnected** lifecycle. + +Binding and authentication between local accounts and domain accounts are supported. A basic framework is provided for domain account management services. Direct creation of local users is forbidden. + +The capabilities for controlling power indicators and lights are provided. + +The HDI driver display layer supports horizontal mirroring and vertical mirroring. + +**Enhanced application development framework for the standard system** + +The process of compiling the shared package is added to the toolchain. + +ArkUI supports obtaining of resources by resource name. + +The component supports multi-level menus and group menus. + +The process of compiling the HAR package is added. + +The HAP compilation process is adapted so that .d.ets declaration files can be identified during HAP compilation. + +**Enhanced distributed capabilities for the standard system** + +BLE connection parameters can be configured, and the connection process is optimized. + + +## Version Mapping + +**Table 1** Version mapping of software and tools + +| Software/Tool| Version| Remarks| +| -------- | -------- | -------- | +| OpenHarmony | 3.2 Beta5 | NA | +| Public SDK | Ohos_sdk_public 3.2.10.6 (API Version 9 Beta5) | This toolkit is intended for application developers and does not contain system APIs that require system permissions. It is provided as standard in DevEco Studio.| +| (Optional) HUAWEI DevEco Studio| *To be released*| Recommended for developing OpenHarmony applications| +| (Optional) HUAWEI DevEco Device Tool| *To be released*| Recommended for developing OpenHarmony smart devices| + + +## Source Code Acquisition + + +### Prerequisites + +1. Register your account with Gitee. + +2. Register an SSH public key for access to Gitee. + +3. Install the [git client](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure user information. + + ``` + git config --global user.name "yourname" + git config --global user.email "your-email-address" + git config --global credential.helper store + ``` + +4. Run the following commands to install the **repo** tool: + + ``` + curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo # If you do not have the permission, download the tool to another directory and configure it as an environment variable by running the chmod a+x /usr/local/bin/repo command. + pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests + ``` + + +### Acquiring Source Code Using the repo Tool + +**Method 1 (recommended)** + +Use the **repo** tool to download the source code over SSH. (You must have an SSH public key for access to Gitee.) + +- Obtain the source code from the version branch. You can obtain the latest source code of the version branch, which includes the code that has been incorporated into the branch up until the time you run the following commands: + ``` + repo init -u git@gitee.com:openharmony/manifest.git -b OpenHarmony-3.2-Beta5 --no-repo-verify + repo sync -c + repo forall -c 'git lfs pull' + ``` + +- Obtain the source code from the version tag, which is the same as that released with the version. + ``` + repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v3.2-Beta5 --no-repo-verify + repo sync -c + repo forall -c 'git lfs pull' + ``` + +**Method 2** + +Use the **repo** tool to download the source code over HTTPS. + +- Obtain the source code from the version branch. You can obtain the latest source code of the version branch, which includes the code that has been incorporated into the branch up until the time you run the following commands: + ``` + repo init -u https://gitee.com/openharmony/manifest -b OpenHarmony-3.2-Beta5 --no-repo-verify + repo sync -c + repo forall -c 'git lfs pull' + ``` + +- Obtain the source code from the version tag, which is the same as that released with the version. + ``` + repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v3.2-Beta5 --no-repo-verify + repo sync -c + repo forall -c 'git lfs pull' + ``` + + +### Acquiring Source Code from Mirrors + +**Table 2** Mirrors for acquiring source code + +| Source Code | Version| Mirror | SHA-256 Checksum | Software Package Size| +| --------------------------------------- | ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | +| Full code base (for mini, small, and standard systems) | 3.2 Beta5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/code-v3.2-Beta5.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/code-v3.2-Beta5.tar.gz.sha256) | 21.3 GB | +| Hi3861 solution (binary) | 3.2 Beta5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/hispark_pegasus.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/hispark_pegasus.tar.gz.sha256) | 22.9 MB | +| Hi3516 solution-LiteOS (binary)| 3.2 Beta5 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta5/hispark_taurus_LiteOS.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta5/hispark_taurus_LiteOS.tar.gz.sha256) | 293.6 MB | +| Hi3516 solution-Linux (binary) | 3.2 Beta5 | [Download](hispark_taurus_Linux.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta5/hispark_taurus_Linux.tar.gz.sha256) | 174.3 MB | +| RK3568 standard system solution (binary) | 3.2 Beta5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/dayu200_standard_arm32_20230201.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/dayu200_standard_arm32_20230201.tar.gz.sha256) | 3.9 GB | +| Public SDK package for the standard system (macOS) | 3.2.10.6 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/ohos-sdk-mac-public.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/ohos-sdk-mac-public.tar.gz.sha256) | 674.5 MB | +| Public SDK package for the standard system (macOS-M1) | 3.2.10.6 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/L2-SDK-MAC-M1-PUBLIC.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/L2-SDK-MAC-M1-PUBLIC.tar.gz.sha256)| 634.5 MB | +| Public SDK package for the standard system (Windows\Linux) | 3.2.10.6 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/ohos-sdk-windows_linux-public.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/ohos-sdk-windows_linux-public.tar.gz.sha256) | 1.6 GB | + + + +## **What's New** + +This version has the following updates to OpenHarmony 3.2 Beta4. + +### SDK Updates + +From this version, only the public SDK is released. It can also be downloaded through DevEco Studio. + +To use the full SDK, you must download the source code, build the source code, and switch to the full SDK. For details, see [Guide to Building Full SDK](../application-dev/quick-start/full-sdk-compile-guide.md). + + +### Feature Updates + +**Table 3** New and enhanced features + +| Subsystem| Standard System| Mini and Small Systems| +| -------- | -------- | -------- | +| ArkUI | - Resources can be obtained by resource name.
- The component supports multi-level menus and group menus.
- The compilation capability is enhanced.
The following requirements are involved:
I683Z1 [New function] Adaptation to resource name–based resource retrieval
I68DBH [Basic capability] Providing multi-level menus and group menus
I68DRY [New function] Adding the HAR package compilation process
I68DRY [New function] Adapting to the HAP compilation process so that .d.ets declaration files can be identified during HAP compilation
I68DRY [New function] Adding the shared package compilation process to the toolchain| NA | +| Web subsystem| The WebView component supports the following new capabilities:
- Web pages can be loaded and displayed, including historical records, forward, and backward. Events can be reported during page loading. The webmessage supports the arraybuffer type. The fetch supports custom protocols.
- The following capabilities are added to configuration management: scroll bar and scroll position, network loading interception configuration, determining whether a page contains images, obtaining the source URL, request method, and website icon, and font management.
- The web context menu can obtain the selected content on the page.
- Interaction normalization is available for input events, and original input events are supported.
- Several W3C interfaces are supported.
The following requirements are involved:
I6BFPR [Function enhancement] [WebView component] Web page loading and display (supporting historical records and forward and backward list management)
I6BFRC [Function enhancement] [WebView component] W3C interface support (HTML-partial test cases)
I6BFS6 [Function enhancement] [WebView component] W3C interface support (CSS-partial test cases)
I6BFSK [Function enhancement] [WebView component] Web page loading and display (1. arraybuffer type support by webmessage)
I6BFTS [Function enhancement] [WebView component] W3C interface support (1. appmanifest)
I6BFUD [Function enhancement] [WebView component] Web page loading and display (1. custom protocols for fetch)
I6BFUM [Function enhancement] [WebView component] Status callback for web pages (1. page loading events)
I6BFV4 [Function enhancement] [WebView component] WebView configuration management (1. scroll bar and scroll position)
I6BFXF [Function enhancement] [WebView component] WebView configuration management (1. network loading interception configuration 2. Determining whether a page contains images 3. Obtaining the source URL, request method, and website icon)
I6BFXT [Function enhancement] [WebView component] WebView configuration management (1. font management)
I6BFY9 [Function enhancement] [WebView component] Input event support (1. interaction normalization)
I6BG4H [Function enhancement] [WebView component] Input event support (1. original input events)
I6BG59 [Function enhancement] [WebView component] Selecting and copying content on web pages (1. obtaining selected content from the web context menu)| NA | +| Security| - Mini system devices support authentication session cancellation.
- HUKS supports RSA signature enhancement.
The following requirements are involved:
I65VLX [Function enhancement] Authentication session cancellation for mini system devices
I611S5 [New specifications] RSA signature enhancement by HUKS| NA | +| Bundle management framework| - Implicit query is enhanced.
- Creation of a TS code optimization directory is supported.
- **bundleName** in **provision** can be verified during signature verification.
- A default icon is displayed on the home screen for an application for which no entry icon is configured.
- The following basic capabilities are added: packaging, unpacking, installing, updating, and uninstalling the dynamic shared library, and verifying the runtime capability of the HAR shared package.
The following requirements are involved:
I6BD9G [Basic capability] Enhancement to implicit query
I6BD9E [Basic capability] Creating a TS code optimization directory
I6BD99 [Basic capability] Verifying **bundleName** in **provision** during signature verification
I6BD8Z [Basic capability] Displaying a default icon on the home screen for an application for which no entry icon is configured
I6BD92 [New function] Packaging and unpacking the dynamic shared library
I6BD96 [New specifications] Installing, updating, and uninstalling the dynamic shared library
I6BD9I Verifying the runtime capability of the HAR shared package| NA | +| Building and runtime| - **taskpool**, a TS/JS task pool concurrency API, is added.
- The TSAOT function on the host side is supported. The TSC supports the export and import of .d.ts and .d.ets declaration files.
The following requirements are involved:
I65G6O [Basic capability] [Closed-source HAR package] Export and import of .d.ts and .d.ets declaration files
I64QIR [taskpool] TS/JS task pool concurrency APIs
I65HID [Function enhancement] TS2AOT-tool of the host version| NA | +| Pan-sensor service| The control of a single logical light is supported.
The following requirements are involved:
I63TFA [New specifications] Single logical light control| NA | +| Media| The APIs for playing and recording audio and video are reconstructed.
The following requirements are involved:
I63GTA [Reconstruction] Integration of audio and video playback APIs
I66VL5 [Reconstruction] Integration of audio and video recording APIs| NA | +| Startup subsystem| Symbols are hidden for the NAPI module, and the dependency on the static library module is changed to the dependency on the dynamic library module.
The following requirements are involved:
I698CV [Symbol optimization] Symbols hidden for the NAPI module; changing from the dependency on the static library module to the dependency on the dynamic library module| NA | +| Common event and notification subsystem| The local notification database is changed.
The following requirement is involved:
I67E9A [Basic capability] Local notification database switchover| NA | +| Graphics subsystem| Camera preview image is supported.
The following requirements are involved:
I6BDOH [RenderService] [New function] Camera preview image| NA | +| Location service| The network location framework is supported.
The following requirements are involved:
I5X4S9 [New feature] Network location framework| NA | +| File storage| - Unified URI processing is added for application files.
- Temporary authorization and unified open entry are added for user data.
The following requirements are involved:
I687C8 [New capability] Unified URI processing for application files
I64U8W [Basic capability] Temporary authorization and unified open entry for user data| NA | +| Ability framework| - The restart of resident processes is optimized.
- The widget database can be switched.
- The asynchronous **onConnected** lifecycle is provided.
The following requirements are involved:
I65M3F [Basic capability] ShellCommand execution control
I65V83 [Basic capability] ServiceExtensionAbility support for asynchronous **onConnected** lifecycle
I61H21 [Basic capability] Change of the local widget database
I63UJ5 [Ability] [ability_runtime] Exception handling in API version 8 and earlier versions
I6BDCW [Basic capability] Forbidden to load code in the **data** directory during application loading
I6BDDU [Basic capability] Default ability launch mode of the FA model: Standard
I6BDE2 [Basic capability] Protection against frequent restart of resident applications| NA | + + +### Chip and Development Board Adaptation + +For details about the adaptation status, see [SIG-Devboard](https://gitee.com/openharmony/community/blob/master/sig/sig-devboard/sig_devboard.md). + + +### Samples + +**Table 4** New samples + +| Subsystem| Name| Introduction| Programming Language| +| -------- | -------- | -------- | -------- | +| Web subsystem| [JS Injection and Execution](https://gitee.com/openharmony/applications_app_samples/tree/master/Web/RunJsInWeb)| This sample is based on HTML5 games. It uses the ArkUI component **\