提交 2e2ec67e 编写于 作者: G Gloria

Update docs against 15283

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 a20f8a88
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
- [Audio Routing and Device Management Development](audio-routing-manager.md) - [Audio Routing and Device Management Development](audio-routing-manager.md)
- [AVPlayer Development (Recommended)](avplayer-playback.md) - [AVPlayer Development (Recommended)](avplayer-playback.md)
- [AVRecorder Development (Recommended)](avrecorder.md) - [AVRecorder Development (Recommended)](avrecorder.md)
- [Audio Playback Development](audio-playback.md) - [Audio Playback Development (To Be Deprecated)](audio-playback.md)
- [Audio Recording Development](audio-recorder.md) - [Audio Recording Development (To Be Deprecated)](audio-recorder.md)
- [Video Playback Development](video-playback.md) - [Video Playback Development (To Be Deprecated)](video-playback.md)
- [Video Recording Development](video-recorder.md) - [Video Recording Development (To Be Deprecated)](video-recorder.md)
- AVSession - AVSession
- [AVSession Overview](avsession-overview.md) - [AVSession Overview](avsession-overview.md)
......
...@@ -4,24 +4,24 @@ The **AbilityMonitor** module provides monitors for abilities that meet specifie ...@@ -4,24 +4,24 @@ The **AbilityMonitor** module provides monitors for abilities that meet specifie
> **NOTE** > **NOTE**
> >
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The APIs of this module are supported and deprecated since API version 9. You are advised to use [abilityMonitor (AbilityMonitor)](js-apis-inner-application-abilityMonitor.md) instead.
## Usage ## Usage
The ability monitor is set by calling **addAbilityMonitor** in **abilityDelegator**. The ability monitor can be set by calling **addAbilityMonitor** in **abilityDelegator**.
```js ```js
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
var abilityDelegator; let abilityDelegator;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
console.info("onAbilityCreateCallback"); console.info("onAbilityCreateCallback");
} }
var monitor = { let monitor = {
abilityName: "abilityname", abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback onAbilityCreate: onAbilityCreateCallback
} };
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.addAbilityMonitor(monitor, (err : any) => { abilityDelegator.addAbilityMonitor(monitor, (err : any) => {
...@@ -37,11 +37,13 @@ Describes an ability monitor. ...@@ -37,11 +37,13 @@ Describes an ability monitor.
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| ------------------------------------------------------------ | -------- | ---- | ---- | ------------------------------------------------------------ | | ------------------------------------------------------------ | -------- | ---- | ---- | ------------------------------------------------------------ |
| abilityName | string | Yes | Yes | Name of the ability bound to the ability monitor. | | abilityName | string | Yes | Yes | Name of the ability bound to the ability monitor.|
| onAbilityCreate?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability is created.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. | | moduleName? | string | Yes | Yes | Name of the module bound to the ability monitor.|
| onAbilityForeground?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability starts to run in the foreground.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. | | onAbilityCreate?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability is created.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.|
| onAbilityBackground?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability starts to run in the background.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. | | onAbilityForeground?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability starts to run in the foreground.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.|
| onAbilityDestroy?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability is destroyed.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. | | onAbilityBackground?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability starts to run in the background.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.|
| onWindowStageCreate?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is created.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. | | onAbilityDestroy?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the ability is destroyed.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.<br>|
| onWindowStageRestore?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is restored.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. | | onWindowStageCreate?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is created.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.<br>|
| onWindowStageDestroy?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is destroyed.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received. | | onWindowStageRestore?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is restored.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.<br>|
| onWindowStageDestroy?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | Yes | Yes | Called when the window stage is destroyed.<br>If this attribute is not set, the corresponding lifecycle callback cannot be received.<br>|
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
- [zlib Error Codes](errorcode-zlib.md) - [zlib Error Codes](errorcode-zlib.md)
- Common Event and Notification - Common Event and Notification
- [Event Error Codes](errorcode-CommonEventService.md) - [Event Error Codes](errorcode-CommonEventService.md)
- [Notification Error Codes](errorcode-notification.md)
- [DistributedNotificationService Error Codes](errorcode-DistributedNotificationService.md) - [DistributedNotificationService Error Codes](errorcode-DistributedNotificationService.md)
- UI Page - UI Page
- [Animator Error Codes](errorcode-animator.md) - [Animator Error Codes](errorcode-animator.md)
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
- Resource Management - Resource Management
- [I18N Error Codes](errorcode-i18n.md) - [I18N Error Codes](errorcode-i18n.md)
- [Resource Manager Error Codes](errorcode-resource-manager.md) - [Resource Manager Error Codes](errorcode-resource-manager.md)
- Resource Scheduling - Background Task
- [backgroundTaskManager Error Codes](errorcode-backgroundTaskMgr.md) - [backgroundTaskManager Error Codes](errorcode-backgroundTaskMgr.md)
- [DeviceUsageStatistics Error Codes](errorcode-DeviceUsageStatistics.md) - [DeviceUsageStatistics Error Codes](errorcode-DeviceUsageStatistics.md)
- [reminderAgentManager Error Codes](errorcode-reminderAgentManager.md) - [reminderAgentManager Error Codes](errorcode-reminderAgentManager.md)
...@@ -50,7 +51,6 @@ ...@@ -50,7 +51,6 @@
- Connectivity - Connectivity
- [NFC Error Codes](errorcode-nfc.md) - [NFC Error Codes](errorcode-nfc.md)
- [RPC Error Codes](errorcode-rpc.md) - [RPC Error Codes](errorcode-rpc.md)
- [Wi-Fi Error Codes](errorcode-wifi.md)
- Basic Features - Basic Features
- [Accessibility Error Codes](errorcode-accessibility.md) - [Accessibility Error Codes](errorcode-accessibility.md)
- [FaultLogger Error Codes](errorcode-faultlogger.md) - [FaultLogger Error Codes](errorcode-faultlogger.md)
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
- [HiDebug Error Codes](errorcode-hiviewdfx-hidebug.md) - [HiDebug Error Codes](errorcode-hiviewdfx-hidebug.md)
- [Input Method Framework Error Codes](errorcode-inputmethod-framework.md) - [Input Method Framework Error Codes](errorcode-inputmethod-framework.md)
- [Pasteboard Error Codes](errorcode-pasteboard.md) - [Pasteboard Error Codes](errorcode-pasteboard.md)
- [Screen Lock Management Error Codes](errorcode-screenlock.md)
- [Time and Time Zone Service Error Codes](errorcode-time.md) - [Time and Time Zone Service Error Codes](errorcode-time.md)
- [Webview Error Codes](errorcode-webview.md) - [Webview Error Codes](errorcode-webview.md)
- Account Management - Account Management
......
...@@ -62,6 +62,8 @@ ...@@ -62,6 +62,8 @@
- [ServiceExtensionAbility](application-models/serviceextensionability.md) - [ServiceExtensionAbility](application-models/serviceextensionability.md)
- [DataShareExtensionAbility](application-models/datashareextensionability.md) - [DataShareExtensionAbility](application-models/datashareextensionability.md)
- [FormExtensionAbility (Widget)](application-models/widget-development-stage.md) - [FormExtensionAbility (Widget)](application-models/widget-development-stage.md)
- [AccessibilityExtensionAbility](application-models/accessibilityextensionability.md)
- [WindowExtensionAbility](application-models/windowextensionability.md)
- [AbilityStage Component Container](application-models/abilitystage.md) - [AbilityStage Component Container](application-models/abilitystage.md)
- [Context](application-models/application-context-stage.md) - [Context](application-models/application-context-stage.md)
- Want - Want
...@@ -297,10 +299,10 @@ ...@@ -297,10 +299,10 @@
- [Audio Routing and Device Management Development](media/audio-routing-manager.md) - [Audio Routing and Device Management Development](media/audio-routing-manager.md)
- [AVPlayer Development (Recommended)](media/avplayer-playback.md) - [AVPlayer Development (Recommended)](media/avplayer-playback.md)
- [AVRecorder Development (Recommended)](media/avrecorder.md) - [AVRecorder Development (Recommended)](media/avrecorder.md)
- [Audio Playback Development](media/audio-playback.md) - [Audio Playback Development (To Be Deprecated)](media/audio-playback.md)
- [Audio Recording Development](media/audio-recorder.md) - [Audio Recording Development (To Be Deprecated)](media/audio-recorder.md)
- [Video Playback Development](media/video-playback.md) - [Video Playback Development (To Be Deprecated)](media/video-playback.md)
- [Video Recording Development](media/video-recorder.md) - [Video Recording Development (To Be Deprecated)](media/video-recorder.md)
- AVSession - AVSession
- [AVSession Overview](media/avsession-overview.md) - [AVSession Overview](media/avsession-overview.md)
- [AVSession Development](media/avsession-guidelines.md) - [AVSession Development](media/avsession-guidelines.md)
...@@ -887,6 +889,7 @@ ...@@ -887,6 +889,7 @@
- [abilityInfo](reference/apis/js-apis-bundleManager-abilityInfo.md) - [abilityInfo](reference/apis/js-apis-bundleManager-abilityInfo.md)
- [applicationInfo](reference/apis/js-apis-bundleManager-applicationInfo.md) - [applicationInfo](reference/apis/js-apis-bundleManager-applicationInfo.md)
- [bundleInfo](reference/apis/js-apis-bundleManager-bundleInfo.md) - [bundleInfo](reference/apis/js-apis-bundleManager-bundleInfo.md)
- [BundlePackInfo](reference/apis/js-apis-bundleManager-BundlePackInfo.md)
- [dispatchInfo](reference/apis/js-apis-bundleManager-dispatchInfo.md) - [dispatchInfo](reference/apis/js-apis-bundleManager-dispatchInfo.md)
- [elementName](reference/apis/js-apis-bundleManager-elementName.md) - [elementName](reference/apis/js-apis-bundleManager-elementName.md)
- [extensionAbilityInfo](reference/apis/js-apis-bundleManager-extensionAbilityInfo.md) - [extensionAbilityInfo](reference/apis/js-apis-bundleManager-extensionAbilityInfo.md)
...@@ -1175,6 +1178,7 @@ ...@@ -1175,6 +1178,7 @@
- [Resource Manager Error Codes](reference/errorcodes/errorcode-resource-manager.md) - [Resource Manager Error Codes](reference/errorcodes/errorcode-resource-manager.md)
- Resource Scheduling - Resource Scheduling
- [backgroundTaskManager Error Codes](reference/errorcodes/errorcode-backgroundTaskMgr.md) - [backgroundTaskManager Error Codes](reference/errorcodes/errorcode-backgroundTaskMgr.md)
- [DeviceUsageStatistics Error Codes](reference/errorcodes/errorcode-DeviceUsageStatistics.md)
- [reminderAgentManager Error Codes](reference/errorcodes/errorcode-reminderAgentManager.md) - [reminderAgentManager Error Codes](reference/errorcodes/errorcode-reminderAgentManager.md)
- [workScheduler Error Codes](reference/errorcodes/errorcode-workScheduler.md) - [workScheduler Error Codes](reference/errorcodes/errorcode-workScheduler.md)
- Security - Security
...@@ -1223,7 +1227,6 @@ ...@@ -1223,7 +1227,6 @@
- [System Parameter Error Codes](reference/errorcodes/errorcode-system-parameterV9.md) - [System Parameter Error Codes](reference/errorcodes/errorcode-system-parameterV9.md)
- [USB Error Codes](reference/errorcodes/errorcode-usb.md) - [USB Error Codes](reference/errorcodes/errorcode-usb.md)
- [Update Error Codes](reference/errorcodes/errorcode-update.md) - [Update Error Codes](reference/errorcodes/errorcode-update.md)
- [DeviceUsageStatistics Error Codes](reference/errorcodes/errorcode-DeviceUsageStatistics.md)
- Customization Management - Customization Management
- [Enterprise Device Management Error Codes](reference/errorcodes/errorcode-enterpriseDeviceManager.md) - [Enterprise Device Management Error Codes](reference/errorcodes/errorcode-enterpriseDeviceManager.md)
- Language Base Class Library - Language Base Class Library
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册