提交 551e57ef 编写于 作者: G Gloria

Update docs against 16779+17385+16817+17385

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 827b1c9c
......@@ -26,6 +26,14 @@ Registers an error observer.
| type | string | Yes| Type of the API to call.|
| observer | [ErrorObserver](./js-apis-inner-application-errorObserver.md) | Yes| Digital code of the observer.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 16000003 | Id does not exist. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```js
......@@ -57,6 +65,14 @@ Deregisters an error observer. This API uses an asynchronous callback to return
| observerId | number | Yes| Digital code of the observer.|
| callback | AsyncCallback\<void> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 16000003 | Id does not exist. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```js
......@@ -95,6 +111,14 @@ Deregisters an error observer. This API uses a promise to return the result.
| -------- | -------- |
| Promise\<void> | Promise used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 16000003 | Id does not exist. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```js
......
......@@ -331,7 +331,10 @@ Sends parcelable data to the target ability.
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
| 16200001 | Caller released. The caller has been released. |
| 16200002 | Callee invalid. The callee does not exist. |
| 16000050 | Internal Error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
......@@ -411,7 +414,10 @@ Sends parcelable data to the target ability and obtains the parcelable data retu
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
| 16200001 | Caller released. The caller has been released. |
| 16200002 | Callee invalid. The callee does not exist. |
| 16000050 | Internal Error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
......@@ -480,10 +486,10 @@ Releases the caller interface of the target ability.
| 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. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
......@@ -519,6 +525,14 @@ Registers a callback that is invoked when the stub on the target ability is disc
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 16200001 | Caller released. The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Parameters**
| Name| Type| Mandatory| Description|
......@@ -572,7 +586,8 @@ Registers a callback that is invoked when the stub on the target ability is disc
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
| 16200001 | Caller released. The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
......@@ -729,7 +744,9 @@ Registers a caller notification callback, which is invoked when the target abili
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
| 16200004 | Method registered. The method has registered. |
| 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
......@@ -794,7 +811,9 @@ Deregisters a caller notification callback, which is invoked when the target abi
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
| 16200005 | Method not registered. The method has not registered. |
| 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
......
......@@ -354,8 +354,9 @@ For details about the error codes, see [AVSession Management Error Codes](../err
import audio from '@ohos.multimedia.audio';
let audioManager = audio.getAudioManager();
let audioRoutingManager = audioManager.getRoutingManager();
let audioDevices;
await audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG).then((data) => {
await audioRoutingManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG).then((data) => {
audioDevices = data;
console.info('Promise returned to indicate that the device list is obtained.');
}).catch((err) => {
......@@ -407,8 +408,9 @@ For details about the error codes, see [AVSession Management Error Codes](../err
import audio from '@ohos.multimedia.audio';
let audioManager = audio.getAudioManager();
let audioRoutingManager = audioManager.getRoutingManager();
let audioDevices;
await audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG).then((data) => {
await audioRoutingManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG).then((data) => {
audioDevices = data;
console.info('Promise returned to indicate that the device list is obtained.');
}).catch((err) => {
......@@ -2402,7 +2404,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
**Example**
```js
import wantAgent from '@ohos.app.ability.wantAgent';
import wantAgent from '@ohos.wantAgent';
controller.getLaunchAbility(function (err, agent) {
if (err) {
......
......@@ -283,6 +283,15 @@ Obtains information about the running processes. This API uses a promise to retu
| -------- | -------- |
| Promise\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | Promise used to return the API call result and the process running information. You can perform error handling or custom processing in this callback.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 16000011 | The context does not exist. |
| 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
......@@ -312,6 +321,15 @@ Obtains information about the running processes. This API uses an asynchronous c
| -------- | -------- |
|AsyncCallback\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | Callback used to return the API call result and the process running information. You can perform error handling or custom processing in this callback.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 16000011 | The context does not exist. |
| 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
......@@ -339,6 +357,14 @@ Kills all the processes where the application is located. This API uses a promis
| -------- | -------- |
| Promise\<void>> | Promise used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 16000011 | The context does not exist. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
......@@ -364,6 +390,14 @@ Kills all the processes where the application is located. This API uses an async
| -------- | -------- |
|AsyncCallback\<void\> | Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------- |
| 16000011 | The context does not exist. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册