提交 b2aefd2f 编写于 作者: D dingxiaochen

fix docs.

Signed-off-by: Ndingxiaochen <dingxiaochen@huawei.com>
上级 bdd128ef
...@@ -132,13 +132,15 @@ dialCall\(phoneNumber: string, callback: AsyncCallback<void\>\): void ...@@ -132,13 +132,15 @@ dialCall\(phoneNumber: string, callback: AsyncCallback<void\>\): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ----------- |---------------------------| ---- |-------------------------| | ----------- | ---------------------------- | ---- | -------------------------------------- |
| phoneNumber | string | 是 | 电话号码。 | | phoneNumber | string | 是 | 电话号码。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 以callback形式异步返回拨打电话的结果。 | | callback | AsyncCallback&lt;void&gt; | 是 | 以callback形式异步返回拨打电话的结果。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -151,8 +153,8 @@ dialCall\(phoneNumber: string, callback: AsyncCallback<void\>\): void ...@@ -151,8 +153,8 @@ dialCall\(phoneNumber: string, callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.dialCall("138xxxxxxxx", (err, data) => { call.dialCall("138xxxxxxxx", (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -171,14 +173,16 @@ dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback ...@@ -171,14 +173,16 @@ dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ----------- |--------------------------------------| ---- | ------------------------------------ | | ----------- | ----------------------------------- | ---- | ----------------------------------- |
| phoneNumber | string | 是 | 电话号码。 | | phoneNumber | string | 是 | 电话号码。 |
| options | [DialCallOptions](#dialcalloptions9) | 是 | 通话参数,携带呼叫的其他配置信息。 | | options | [DialCallOptions](#dialcalloptions9)| 是 | 通话参数,携带呼叫的其他配置信息。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 以callback形式异步返回拨打电话的结果。 | | callback | AsyncCallback&lt;void&gt; | 是 | 以callback形式异步返回拨打电话的结果。|
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -196,8 +200,8 @@ call.dialCall("138xxxxxxxx", { ...@@ -196,8 +200,8 @@ call.dialCall("138xxxxxxxx", {
videoState: 0, videoState: 0,
dialScene: 0, dialScene: 0,
dialType: 0, dialType: 0,
}, (err, data) => { }, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -223,12 +227,14 @@ dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise<void\> ...@@ -223,12 +227,14 @@ dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise<void\>
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ------------------- | --------------------------------- | | ---------------------- | ---------------------------- |
| Promise&lt;void&gt; | 以Promise形式异步返回拨打电话的结果。 | | Promise&lt;void&gt; | 以Promise形式异步返回拨号结果。|
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -247,9 +253,9 @@ let promise = call.dialCall("138xxxxxxxx", { ...@@ -247,9 +253,9 @@ let promise = call.dialCall("138xxxxxxxx", {
dialScene: 0, dialScene: 0,
dialType: 0, dialType: 0,
}); });
promise.then(data => { promise.then(() => {
console.log(`dialCall success, promise: data->${JSON.stringify(data)}`); console.log(`dialCall success.`);
}).catch(err => { }).catch((err) => {
console.error(`dialCall fail, promise: err->${JSON.stringify(err)}`); console.error(`dialCall fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -272,6 +278,8 @@ makeCall(phoneNumber: string, callback: AsyncCallback\<void\>): void ...@@ -272,6 +278,8 @@ makeCall(phoneNumber: string, callback: AsyncCallback\<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -311,6 +319,8 @@ makeCall(phoneNumber: string): Promise\<void\> ...@@ -311,6 +319,8 @@ makeCall(phoneNumber: string): Promise\<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -463,6 +473,8 @@ isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback<boolean\>\) ...@@ -463,6 +473,8 @@ isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback<boolean\>\)
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -498,6 +510,8 @@ isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, ca ...@@ -498,6 +510,8 @@ isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, ca
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -538,6 +552,8 @@ isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\): ...@@ -538,6 +552,8 @@ isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\):
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -576,6 +592,8 @@ formatPhoneNumber\(phoneNumber: string, callback: AsyncCallback<string\>\): void ...@@ -576,6 +592,8 @@ formatPhoneNumber\(phoneNumber: string, callback: AsyncCallback<string\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -612,6 +630,8 @@ formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: ...@@ -612,6 +630,8 @@ formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback:
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -656,6 +676,8 @@ formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise ...@@ -656,6 +676,8 @@ formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -697,6 +719,8 @@ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: Asy ...@@ -697,6 +719,8 @@ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: Asy
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -741,6 +765,8 @@ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise<str ...@@ -741,6 +765,8 @@ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise<str
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -780,8 +806,11 @@ muteRinger\(callback: AsyncCallback<void\>\): void ...@@ -780,8 +806,11 @@ muteRinger\(callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. | | 401 | Parameter error. |
| 8300001 | Invalid parameter value. | | 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. | | 8300002 | Operation failed. Cannot connect to service. |
...@@ -791,8 +820,8 @@ muteRinger\(callback: AsyncCallback<void\>\): void ...@@ -791,8 +820,8 @@ muteRinger\(callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.muteRinger((err, data) => { call.muteRinger((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -817,11 +846,11 @@ muteRinger\(\): Promise<void\> ...@@ -817,11 +846,11 @@ muteRinger\(\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. | | 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. | | 8300003 | System internal error. |
| 8300999 | Unknown error code. | | 8300999 | Unknown error code. |
...@@ -829,10 +858,9 @@ muteRinger\(\): Promise<void\> ...@@ -829,10 +858,9 @@ muteRinger\(\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.muteRinger(); call.muteRinger().then(() => {
promise.then(data => { console.log(`muteRinger success.`);
console.log(`muteRinger success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`muteRinger fail, promise: err->${JSON.stringify(err)}`); console.error(`muteRinger fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -859,6 +887,8 @@ answerCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -859,6 +887,8 @@ answerCall\(callId: number, callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -871,8 +901,8 @@ answerCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -871,8 +901,8 @@ answerCall\(callId: number, callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.answerCall(1, (err, data) => { call.answerCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -903,6 +933,8 @@ answerCall(callId?: number\): Promise<void\> ...@@ -903,6 +933,8 @@ answerCall(callId?: number\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -915,10 +947,9 @@ answerCall(callId?: number\): Promise<void\> ...@@ -915,10 +947,9 @@ answerCall(callId?: number\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.answerCall(1); call.answerCall(1).then(() => {
promise.then(data => { console.log(`answerCall success.`);
console.log(`answerCall success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`); console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -944,6 +975,8 @@ answerCall\(callback: AsyncCallback<void\>\): void ...@@ -944,6 +975,8 @@ answerCall\(callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -956,8 +989,8 @@ answerCall\(callback: AsyncCallback<void\>\): void ...@@ -956,8 +989,8 @@ answerCall\(callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.answerCall((err, data) => { call.answerCall((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -983,6 +1016,8 @@ hangUpCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -983,6 +1016,8 @@ hangUpCall\(callId: number, callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -995,8 +1030,8 @@ hangUpCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -995,8 +1030,8 @@ hangUpCall\(callId: number, callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.hangUpCall(1, (err, data) => { call.hangUpCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1027,6 +1062,8 @@ hangUpCall\(callId?: number\): Promise<void\> ...@@ -1027,6 +1062,8 @@ hangUpCall\(callId?: number\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1039,10 +1076,9 @@ hangUpCall\(callId?: number\): Promise<void\> ...@@ -1039,10 +1076,9 @@ hangUpCall\(callId?: number\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.hangUpCall(1); call.hangUpCall(1).then(() => {
promise.then(data => { console.log(`hangUpCall success.`);
console.log(`hangUpCall success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`); console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1068,6 +1104,8 @@ hangUpCall\(callback: AsyncCallback<void\>\): void ...@@ -1068,6 +1104,8 @@ hangUpCall\(callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1081,8 +1119,8 @@ hangUpCall\(callback: AsyncCallback<void\>\): void ...@@ -1081,8 +1119,8 @@ hangUpCall\(callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.hangUpCall((err, data) => { call.hangUpCall((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1108,6 +1146,8 @@ rejectCall(callId: number, callback: AsyncCallback\<void>): void ...@@ -1108,6 +1146,8 @@ rejectCall(callId: number, callback: AsyncCallback\<void>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1121,8 +1161,8 @@ rejectCall(callId: number, callback: AsyncCallback\<void>): void ...@@ -1121,8 +1161,8 @@ rejectCall(callId: number, callback: AsyncCallback\<void>): void
**示例:** **示例:**
```js ```js
call.rejectCall(1, (err, data) => { call.rejectCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1149,6 +1189,8 @@ rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallba ...@@ -1149,6 +1189,8 @@ rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallba
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1164,8 +1206,8 @@ rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallba ...@@ -1164,8 +1206,8 @@ rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallba
let rejectMessageOptions={ let rejectMessageOptions={
messageContent: "拦截陌生号码" messageContent: "拦截陌生号码"
} }
call.rejectCall(1, rejectMessageOptions, (err, data) => { call.rejectCall(1, rejectMessageOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1197,6 +1239,8 @@ rejectCall(callId?: number, options?: RejectMessageOptions\): Promise<void\> ...@@ -1197,6 +1239,8 @@ rejectCall(callId?: number, options?: RejectMessageOptions\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1212,10 +1256,9 @@ rejectCall(callId?: number, options?: RejectMessageOptions\): Promise<void\> ...@@ -1212,10 +1256,9 @@ rejectCall(callId?: number, options?: RejectMessageOptions\): Promise<void\>
let rejectMessageOptions={ let rejectMessageOptions={
messageContent: "拦截陌生号码" messageContent: "拦截陌生号码"
} }
let promise = call.reject(1, rejectMessageOptions); call.reject(1, rejectMessageOptions).then(() => {
promise.then(data => { console.log(`reject success.`);
console.log(`reject success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`reject fail, promise: err->${JSON.stringify(err)}`); console.error(`reject fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1241,6 +1284,8 @@ rejectCall\(callback: AsyncCallback<void\>\): void ...@@ -1241,6 +1284,8 @@ rejectCall\(callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1253,8 +1298,8 @@ rejectCall\(callback: AsyncCallback<void\>\): void ...@@ -1253,8 +1298,8 @@ rejectCall\(callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.rejectCall((err, data) => { call.rejectCall((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1280,6 +1325,8 @@ rejectCall\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): voi ...@@ -1280,6 +1325,8 @@ rejectCall\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): voi
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1295,8 +1342,8 @@ rejectCall\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): voi ...@@ -1295,8 +1342,8 @@ rejectCall\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): voi
let rejectMessageOptions={ let rejectMessageOptions={
messageContent: "拦截陌生号码" messageContent: "拦截陌生号码"
} }
call.rejectCall(rejectMessageOptions, (err, data) => { call.rejectCall(rejectMessageOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1322,6 +1369,8 @@ holdCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1322,6 +1369,8 @@ holdCall\(callId: number, callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1334,8 +1383,8 @@ holdCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1334,8 +1383,8 @@ holdCall\(callId: number, callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.holdCall(1, (err, data) => { call.holdCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1366,6 +1415,8 @@ holdCall\(callId: number\): Promise<void\> ...@@ -1366,6 +1415,8 @@ holdCall\(callId: number\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1378,10 +1429,9 @@ holdCall\(callId: number\): Promise<void\> ...@@ -1378,10 +1429,9 @@ holdCall\(callId: number\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.holdCall(1); call.holdCall(1).then(() => {
promise.then(data => { console.log(`holdCall success.`);
console.log(`holdCall success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`holdCall fail, promise: err->${JSON.stringify(err)}`); console.error(`holdCall fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1407,6 +1457,8 @@ unHoldCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1407,6 +1457,8 @@ unHoldCall\(callId: number, callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1419,8 +1471,8 @@ unHoldCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1419,8 +1471,8 @@ unHoldCall\(callId: number, callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.unHoldCall(1, (err, data) => { call.unHoldCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1451,6 +1503,8 @@ unHoldCall\(callId: number\): Promise<void\> ...@@ -1451,6 +1503,8 @@ unHoldCall\(callId: number\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1463,10 +1517,9 @@ unHoldCall\(callId: number\): Promise<void\> ...@@ -1463,10 +1517,9 @@ unHoldCall\(callId: number\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.unHoldCall(1); call.unHoldCall(1).then(() => {
promise.then(data => { console.log(`unHoldCall success.`);
console.log(`unHoldCall success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`unHoldCall fail, promise: err->${JSON.stringify(err)}`); console.error(`unHoldCall fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1492,6 +1545,8 @@ switchCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1492,6 +1545,8 @@ switchCall\(callId: number, callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1504,8 +1559,8 @@ switchCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1504,8 +1559,8 @@ switchCall\(callId: number, callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.switchCall(1, (err, data) => { call.switchCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1536,6 +1591,8 @@ switchCall\(callId: number\): Promise<void\> ...@@ -1536,6 +1591,8 @@ switchCall\(callId: number\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1548,10 +1605,9 @@ switchCall\(callId: number\): Promise<void\> ...@@ -1548,10 +1605,9 @@ switchCall\(callId: number\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.switchCall(1); call.switchCall(1).then(() => {
promise.then(data => { console.log(`switchCall success.`);
console.log(`switchCall success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`switchCall fail, promise: err->${JSON.stringify(err)}`); console.error(`switchCall fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1575,6 +1631,8 @@ combineConference\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1575,6 +1631,8 @@ combineConference\(callId: number, callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1586,8 +1644,8 @@ combineConference\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1586,8 +1644,8 @@ combineConference\(callId: number, callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.combineConference(1, (err, data) => { call.combineConference(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1616,6 +1674,8 @@ combineConference\(callId: number\): Promise<void\> ...@@ -1616,6 +1674,8 @@ combineConference\(callId: number\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1627,10 +1687,9 @@ combineConference\(callId: number\): Promise<void\> ...@@ -1627,10 +1687,9 @@ combineConference\(callId: number\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.combineConference(1); call.combineConference(1).then(() => {
promise.then(data => { console.log(`combineConference success.`);
console.log(`combineConference success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`combineConference fail, promise: err->${JSON.stringify(err)}`); console.error(`combineConference fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1654,6 +1713,8 @@ getMainCallId\(callId: number, callback: AsyncCallback<number\>\): void ...@@ -1654,6 +1713,8 @@ getMainCallId\(callId: number, callback: AsyncCallback<number\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1696,6 +1757,8 @@ getMainCallId\(callId: number\): Promise<number\> ...@@ -1696,6 +1757,8 @@ getMainCallId\(callId: number\): Promise<number\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1734,6 +1797,8 @@ getSubCallIdList\(callId: number, callback: AsyncCallback<Array<string\>\>\): vo ...@@ -1734,6 +1797,8 @@ getSubCallIdList\(callId: number, callback: AsyncCallback<Array<string\>\>\): vo
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1775,6 +1840,8 @@ getSubCallIdList\(callId: number\): Promise<Array<string\>\> ...@@ -1775,6 +1840,8 @@ getSubCallIdList\(callId: number\): Promise<Array<string\>\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1813,6 +1880,8 @@ getCallIdListForConference\(callId: number, callback: AsyncCallback<Array<string ...@@ -1813,6 +1880,8 @@ getCallIdListForConference\(callId: number, callback: AsyncCallback<Array<string
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1854,6 +1923,8 @@ getCallIdListForConference\(callId: number\): Promise<Array<string\>\> ...@@ -1854,6 +1923,8 @@ getCallIdListForConference\(callId: number\): Promise<Array<string\>\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1894,6 +1965,8 @@ getCallWaitingStatus\(slotId: number, callback: AsyncCallback<CallWaitingStatus\ ...@@ -1894,6 +1965,8 @@ getCallWaitingStatus\(slotId: number, callback: AsyncCallback<CallWaitingStatus\
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1938,6 +2011,8 @@ getCallWaitingStatus\(slotId: number\): Promise<CallWaitingStatus\> ...@@ -1938,6 +2011,8 @@ getCallWaitingStatus\(slotId: number\): Promise<CallWaitingStatus\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1980,6 +2055,8 @@ setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback<void\ ...@@ -1980,6 +2055,8 @@ setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback<void\
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1992,8 +2069,8 @@ setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback<void\ ...@@ -1992,8 +2069,8 @@ setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback<void\
**示例:** **示例:**
```js ```js
call.setCallWaiting(0, true, (err, data) => { call.setCallWaiting(0, true, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2025,6 +2102,8 @@ setCallWaiting\(slotId: number, activate: boolean\): Promise<void\> ...@@ -2025,6 +2102,8 @@ setCallWaiting\(slotId: number, activate: boolean\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2037,10 +2116,9 @@ setCallWaiting\(slotId: number, activate: boolean\): Promise<void\> ...@@ -2037,10 +2116,9 @@ setCallWaiting\(slotId: number, activate: boolean\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.setCallWaiting(0, true); call.setCallWaiting(0, true).then(() => {
promise.then(data => { console.log(`setCallWaiting success.`);
console.log(`setCallWaiting success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`setCallWaiting fail, promise: err->${JSON.stringify(err)}`); console.error(`setCallWaiting fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2065,6 +2143,8 @@ startDTMF\(callId: number, character: string, callback: AsyncCallback<void\>\): ...@@ -2065,6 +2143,8 @@ startDTMF\(callId: number, character: string, callback: AsyncCallback<void\>\):
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -2076,8 +2156,8 @@ startDTMF\(callId: number, character: string, callback: AsyncCallback<void\>\): ...@@ -2076,8 +2156,8 @@ startDTMF\(callId: number, character: string, callback: AsyncCallback<void\>\):
**示例:** **示例:**
```js ```js
call.startDTMF(1, "0", (err, data) => { call.startDTMF(1, "0", (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2107,6 +2187,8 @@ startDTMF\(callId: number, character: string\): Promise<void\> ...@@ -2107,6 +2187,8 @@ startDTMF\(callId: number, character: string\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -2118,10 +2200,9 @@ startDTMF\(callId: number, character: string\): Promise<void\> ...@@ -2118,10 +2200,9 @@ startDTMF\(callId: number, character: string\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.startDTMF(1, "0"); call.startDTMF(1, "0").then(() => {
promise.then(data => { console.log(`startDTMF success.`);
console.log(`startDTMF success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`startDTMF fail, promise: err->${JSON.stringify(err)}`); console.error(`startDTMF fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2145,6 +2226,8 @@ stopDTMF\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -2145,6 +2226,8 @@ stopDTMF\(callId: number, callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -2156,8 +2239,8 @@ stopDTMF\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -2156,8 +2239,8 @@ stopDTMF\(callId: number, callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.stopDTMF(1, (err, data) => { call.stopDTMF(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2186,6 +2269,8 @@ stopDTMF\(callId: number\): Promise<void\> ...@@ -2186,6 +2269,8 @@ stopDTMF\(callId: number\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -2197,10 +2282,9 @@ stopDTMF\(callId: number\): Promise<void\> ...@@ -2197,10 +2282,9 @@ stopDTMF\(callId: number\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.stopDTMF(1); call.stopDTMF(1).then(() => {
promise.then(data => { console.log(`stopDTMF success.`);
console.log(`stopDTMF success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`stopDTMF fail, promise: err->${JSON.stringify(err)}`); console.error(`stopDTMF fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2225,6 +2309,8 @@ isInEmergencyCall\(callback: AsyncCallback<boolean\>\): void ...@@ -2225,6 +2309,8 @@ isInEmergencyCall\(callback: AsyncCallback<boolean\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2263,6 +2349,8 @@ isInEmergencyCall\(\): Promise<boolean\> ...@@ -2263,6 +2349,8 @@ isInEmergencyCall\(\): Promise<boolean\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2299,11 +2387,13 @@ on\(type: 'callDetailsChange', callback: Callback<CallAttributeOptions\>\): void ...@@ -2299,11 +2387,13 @@ on\(type: 'callDetailsChange', callback: Callback<CallAttributeOptions\>\): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------- | ---- | -------------------------- | | -------- | ------------------------------------------------------- | ---- | -------------------------- |
| type | string | 是 | 通话时监听通话详情的变化。 | | type | string | 是 | 通话时监听通话详情的变化,参数固定为'callDetailsChange'。 |
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | 是 | 回调函数。 | | callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | 是 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2337,11 +2427,13 @@ on\(type: 'callEventChange', callback: Callback<CallEventOptions\>\): void ...@@ -2337,11 +2427,13 @@ on\(type: 'callEventChange', callback: Callback<CallEventOptions\>\): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------ | ---- | -------------------------- | | -------- | ------------------------------------------------ | ---- | -------------------------- |
| type | string | 是 | 通话时监听通话事件的变化。 | | type | string | 是 | 通话时监听通话事件的变化,参数固定为'callEventChange'。 |
| callback | Callback<[CallEventOptions](#calleventoptions8)> | 是 | 回调函数。 | | callback | Callback<[CallEventOptions](#calleventoptions8)> | 是 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2375,11 +2467,13 @@ on\(type: 'callDisconnectedCause', callback: Callback<DisconnectedDetails\>): vo ...@@ -2375,11 +2467,13 @@ on\(type: 'callDisconnectedCause', callback: Callback<DisconnectedDetails\>): vo
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------ | ---- | -------------------------- | | -------- | ------------------------------------------------------ | ---- | -------------------------- |
| type | string | 是 | 通话时监听断开连接的原因。 | | type | string | 是 | 通话时监听断开连接的原因,参数固定为'callDisconnectedCause'。 |
| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | 是 | 回调函数。 | | callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | 是 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2413,11 +2507,13 @@ on\(type: 'mmiCodeResult', callback: Callback<MmiCodeResults\>\): void ...@@ -2413,11 +2507,13 @@ on\(type: 'mmiCodeResult', callback: Callback<MmiCodeResults\>\): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------------------------------- | ---- | --------------------- | | -------- | -------------------------------------------- | ---- | --------------------- |
| type | string | 是 | 通话时监听MMI码结果。 | | type | string | 是 | 通话时监听MMI码结果,参数固定为'mmiCodeResult'。 |
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | 是 | 回调函数。 | | callback | Callback<[MmiCodeResults](#mmicoderesults9)> | 是 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2451,11 +2547,13 @@ off\(type: 'callDetailsChange', callback?: Callback<CallAttributeOptions\>\): vo ...@@ -2451,11 +2547,13 @@ off\(type: 'callDetailsChange', callback?: Callback<CallAttributeOptions\>\): vo
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------------------------------------------- | ---- | ---------------------------------- | | -------- | -------------------------------------------------------- | ---- | ---------------------------------- |
| type | string | 是 | 通话结束时取消监听通话详情的变化。 | | type | string | 是 | 通话结束时取消监听通话详情的变化,参数固定为'callDetailsChange'。 |
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | 否 | 回调函数。 | | callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | 否 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2489,11 +2587,13 @@ off\(type: 'callEventChange', callback?: Callback<CallEventOptions\>\): void ...@@ -2489,11 +2587,13 @@ off\(type: 'callEventChange', callback?: Callback<CallEventOptions\>\): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------ | ---- | ---------------------------------- | | -------- | ------------------------------------------------ | ---- | ---------------------------------- |
| type | string | 是 | 通话结束时取消监听通话事件的变化。 | | type | string | 是 | 通话结束时取消监听通话事件的变化,参数固定为'callEventChange'。 |
| callback | Callback<[CallEventOptions](#calleventoptions8)> | 否 | 回调函数。 | | callback | Callback<[CallEventOptions](#calleventoptions8)> | 否 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2526,12 +2626,14 @@ off\(type: 'callDisconnectedCause', callback?: Callback<DisconnectedDetails\>\): ...@@ -2526,12 +2626,14 @@ off\(type: 'callDisconnectedCause', callback?: Callback<DisconnectedDetails\>\):
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------------------------- | ---- | -------------------- | | -------- | ---------------------------------------------------------- | ---- | ------------------- |
| type | 'callDisconnectedCause' | 是 | 调用断开连接的原因。 | | type | string | 是 | 调用断开连接的原因,参数固定为'callDisconnectedCause'。 |
| callback | Callback**<**[DisconnectedDetails](#disconnecteddetails9)> | 否 | 回调函数。 | | callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | 否 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2563,13 +2665,15 @@ off\(type: 'mmiCodeResult', callback?: Callback<MmiCodeResults\>\): void ...@@ -2563,13 +2665,15 @@ off\(type: 'mmiCodeResult', callback?: Callback<MmiCodeResults\>\): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------ | ---- | ----------- | | -------- | ------------------------------------------------ | ---- | ----------- |
| type | 'mmiCodeResult' | 是 | MMI码结果。 | | type | string | 是 | MMI码结果,参数固定为'mmiCodeResult'。 |
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | 否 | 回调函数。 | | callback | Callback<[MmiCodeResults](#mmicoderesults9)> | 否 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2605,6 +2709,8 @@ isNewCallAllowed\(callback: AsyncCallback<boolean\>\): void ...@@ -2605,6 +2709,8 @@ isNewCallAllowed\(callback: AsyncCallback<boolean\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -2640,6 +2746,8 @@ isNewCallAllowed\(\): Promise<boolean\> ...@@ -2640,6 +2746,8 @@ isNewCallAllowed\(\): Promise<boolean\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -2678,6 +2786,8 @@ separateConference\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -2678,6 +2786,8 @@ separateConference\(callId: number, callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -2689,8 +2799,8 @@ separateConference\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -2689,8 +2799,8 @@ separateConference\(callId: number, callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.separateConference(1, (err, data) => { call.separateConference(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2719,6 +2829,8 @@ separateConference\(callId: number\): Promise<void\> ...@@ -2719,6 +2829,8 @@ separateConference\(callId: number\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -2730,10 +2842,9 @@ separateConference\(callId: number\): Promise<void\> ...@@ -2730,10 +2842,9 @@ separateConference\(callId: number\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.separateConference(1); call.separateConference(1).then(() => {
promise.then(data => { console.log(`separateConference success.`);
console.log(`separateConference success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`separateConference fail, promise: err->${JSON.stringify(err)}`); console.error(`separateConference fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2760,6 +2871,8 @@ getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: A ...@@ -2760,6 +2871,8 @@ getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: A
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2805,6 +2918,8 @@ getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise<R ...@@ -2805,6 +2918,8 @@ getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise<R
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2847,6 +2962,8 @@ setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCa ...@@ -2847,6 +2962,8 @@ setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCa
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2864,8 +2981,8 @@ let callRestrictionInfo={ ...@@ -2864,8 +2981,8 @@ let callRestrictionInfo={
password: "123456", password: "123456",
mode: 1 mode: 1
} }
call.setCallRestriction(0, callRestrictionInfo, (err, data) => { call.setCallRestriction(0, callRestrictionInfo, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2897,6 +3014,8 @@ setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise<void\> ...@@ -2897,6 +3014,8 @@ setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2914,10 +3033,9 @@ let callRestrictionInfo={ ...@@ -2914,10 +3033,9 @@ let callRestrictionInfo={
password: "123456", password: "123456",
mode: 1 mode: 1
} }
let promise = call.setCallRestriction(0, callRestrictionInfo); call.setCallRestriction(0, callRestrictionInfo).then(() => {
promise.then(data => { console.log(`setCallRestriction success.`);
console.log(`setCallRestriction success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`setCallRestriction fail, promise: err->${JSON.stringify(err)}`); console.error(`setCallRestriction fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2944,6 +3062,8 @@ getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCall ...@@ -2944,6 +3062,8 @@ getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCall
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2989,6 +3109,8 @@ getCallTransferInfo\(slotId: number, type: CallTransferType): Promise<CallTransf ...@@ -2989,6 +3109,8 @@ getCallTransferInfo\(slotId: number, type: CallTransferType): Promise<CallTransf
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3031,6 +3153,8 @@ setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback ...@@ -3031,6 +3153,8 @@ setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3048,8 +3172,8 @@ let callTransferInfo={ ...@@ -3048,8 +3172,8 @@ let callTransferInfo={
type: 1, type: 1,
settingType: 1 settingType: 1
} }
call.setCallTransfer(0, callTransferInfo, (err, data) => { call.setCallTransfer(0, callTransferInfo, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3081,6 +3205,8 @@ setCallTransfer\(slotId: number, info: CallTransferInfo): Promise<void\> ...@@ -3081,6 +3205,8 @@ setCallTransfer\(slotId: number, info: CallTransferInfo): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3098,10 +3224,9 @@ let callTransferInfo={ ...@@ -3098,10 +3224,9 @@ let callTransferInfo={
type: 1, type: 1,
settingType: 1 settingType: 1
} }
let promise = call.setCallTransfer(0, callTransferInfo); call.setCallTransfer(0, callTransferInfo).then(() => {
promise.then(data => { console.log(`setCallTransfer success.`);
console.log(`setCallTransfer success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`setCallTransfer fail, promise: err->${JSON.stringify(err)}`); console.error(`setCallTransfer fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3126,6 +3251,8 @@ isRinging\(callback: AsyncCallback<boolean\>\): void ...@@ -3126,6 +3251,8 @@ isRinging\(callback: AsyncCallback<boolean\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3164,6 +3291,8 @@ isRinging\(\): Promise<boolean\> ...@@ -3164,6 +3291,8 @@ isRinging\(\): Promise<boolean\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3202,6 +3331,8 @@ setMuted\(callback: AsyncCallback<void\>\): void ...@@ -3202,6 +3331,8 @@ setMuted\(callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3213,8 +3344,8 @@ setMuted\(callback: AsyncCallback<void\>\): void ...@@ -3213,8 +3344,8 @@ setMuted\(callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.setMuted((err, data) => { call.setMuted((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3237,6 +3368,8 @@ setMuted\(\): Promise<void\> ...@@ -3237,6 +3368,8 @@ setMuted\(\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3248,10 +3381,9 @@ setMuted\(\): Promise<void\> ...@@ -3248,10 +3381,9 @@ setMuted\(\): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.setMuted(); call.setMuted().then(() => {
promise.then(data => { console.log(`setMuted success.`);
console.log(`setMuted success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`setMuted fail, promise: err->${JSON.stringify(err)}`); console.error(`setMuted fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3274,6 +3406,8 @@ cancelMuted(callback: AsyncCallback<void\>): void ...@@ -3274,6 +3406,8 @@ cancelMuted(callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3285,8 +3419,8 @@ cancelMuted(callback: AsyncCallback<void\>): void ...@@ -3285,8 +3419,8 @@ cancelMuted(callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
call.cancelMuted((err, data) => { call.cancelMuted((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3309,6 +3443,8 @@ cancelMuted(): Promise<void\> ...@@ -3309,6 +3443,8 @@ cancelMuted(): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3320,10 +3456,9 @@ cancelMuted(): Promise<void\> ...@@ -3320,10 +3456,9 @@ cancelMuted(): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.cancelMuted(); call.cancelMuted().then(() => {
promise.then(data => { console.log(`cancelMuted success.`);
console.log(`cancelMuted success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`cancelMuted fail, promise: err->${JSON.stringify(err)}`); console.error(`cancelMuted fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3347,6 +3482,8 @@ setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void ...@@ -3347,6 +3482,8 @@ setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3358,8 +3495,8 @@ setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void ...@@ -3358,8 +3495,8 @@ setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
call.setAudioDevice(1, (err, data) => { call.setAudioDevice(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3384,6 +3521,8 @@ setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: Asyn ...@@ -3384,6 +3521,8 @@ setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: Asyn
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3398,8 +3537,8 @@ setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: Asyn ...@@ -3398,8 +3537,8 @@ setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: Asyn
let audioDeviceOptions={ let audioDeviceOptions={
bluetoothAddress: "IEEE 802-2014" bluetoothAddress: "IEEE 802-2014"
} }
call.setAudioDevice(1, audioDeviceOptions, (err, data) => { call.setAudioDevice(1, audioDeviceOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3429,6 +3568,8 @@ setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise<void\ ...@@ -3429,6 +3568,8 @@ setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise<void\
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3443,10 +3584,9 @@ setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise<void\ ...@@ -3443,10 +3584,9 @@ setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise<void\
let audioDeviceOptions={ let audioDeviceOptions={
bluetoothAddress: "IEEE 802-2014" bluetoothAddress: "IEEE 802-2014"
} }
let promise = call.setAudioDevice(1, audioDeviceOptions); call.setAudioDevice(1, audioDeviceOptions).then(() => {
promise.then(data => { console.log(`setAudioDevice success.`);
console.log(`setAudioDevice success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`setAudioDevice fail, promise: err->${JSON.stringify(err)}`); console.error(`setAudioDevice fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3471,6 +3611,8 @@ joinConference(mainCallId: number, callNumberList: Array<string\>, callback: Asy ...@@ -3471,6 +3611,8 @@ joinConference(mainCallId: number, callNumberList: Array<string\>, callback: Asy
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3485,8 +3627,8 @@ joinConference(mainCallId: number, callNumberList: Array<string\>, callback: Asy ...@@ -3485,8 +3627,8 @@ joinConference(mainCallId: number, callNumberList: Array<string\>, callback: Asy
let callNumberList: Array<string> = [ let callNumberList: Array<string> = [
"138XXXXXXXX" "138XXXXXXXX"
]; ];
call.joinConference(1, callNumberList, (err, data) => { call.joinConference(1, callNumberList, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3515,6 +3657,8 @@ joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void ...@@ -3515,6 +3657,8 @@ joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3529,10 +3673,9 @@ joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void ...@@ -3529,10 +3673,9 @@ joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void
let callNumberList: Array<string> = [ let callNumberList: Array<string> = [
"138XXXXXXXX" "138XXXXXXXX"
]; ];
let promise = call.joinConference(1, callNumberList); call.joinConference(1, callNumberList).then(() => {
promise.then(data => { console.log(`joinConference success.`);
console.log(`joinConference success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`joinConference fail, promise: err->${JSON.stringify(err)}`); console.error(`joinConference fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3557,6 +3700,8 @@ updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback<voi ...@@ -3557,6 +3700,8 @@ updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback<voi
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3568,8 +3713,8 @@ updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback<voi ...@@ -3568,8 +3713,8 @@ updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback<voi
**示例:** **示例:**
```js ```js
call.updateImsCallMode(1, 1, (err, data) => { call.updateImsCallMode(1, 1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3598,6 +3743,8 @@ updateImsCallMode(callId: number, mode: ImsCallMode): Promise<void\> ...@@ -3598,6 +3743,8 @@ updateImsCallMode(callId: number, mode: ImsCallMode): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3609,10 +3756,9 @@ updateImsCallMode(callId: number, mode: ImsCallMode): Promise<void\> ...@@ -3609,10 +3756,9 @@ updateImsCallMode(callId: number, mode: ImsCallMode): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.updateImsCallMode(1, 1); call.updateImsCallMode(1, 1).then(() => {
promise.then(data => { console.log(`updateImsCallMode success.`);
console.log(`updateImsCallMode success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`updateImsCallMode fail, promise: err->${JSON.stringify(err)}`); console.error(`updateImsCallMode fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3638,6 +3784,8 @@ enableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void ...@@ -3638,6 +3784,8 @@ enableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3650,8 +3798,8 @@ enableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void ...@@ -3650,8 +3798,8 @@ enableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
call.enableImsSwitch(0, (err, data) => { call.enableImsSwitch(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3681,6 +3829,8 @@ enableImsSwitch(slotId: number): Promise<void\> ...@@ -3681,6 +3829,8 @@ enableImsSwitch(slotId: number): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3693,10 +3843,9 @@ enableImsSwitch(slotId: number): Promise<void\> ...@@ -3693,10 +3843,9 @@ enableImsSwitch(slotId: number): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.enableImsSwitch(0); call.enableImsSwitch(0).then(() => {
promise.then(data => { console.log(`enableImsSwitch success.`);
console.log(`enableImsSwitch success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`enableImsSwitch fail, promise: err->${JSON.stringify(err)}`); console.error(`enableImsSwitch fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3722,6 +3871,8 @@ disableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void ...@@ -3722,6 +3871,8 @@ disableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3734,8 +3885,8 @@ disableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void ...@@ -3734,8 +3885,8 @@ disableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
call.disableImsSwitch(0, (err, data) => { call.disableImsSwitch(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3753,19 +3904,21 @@ disableImsSwitch(slotId: number): Promise<void\> ...@@ -3753,19 +3904,21 @@ disableImsSwitch(slotId: number): Promise<void\>
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 | | Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:** **错误码:**
| 错误码ID | 错误信息 | 以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3777,10 +3930,9 @@ disableImsSwitch(slotId: number): Promise<void\> ...@@ -3777,10 +3930,9 @@ disableImsSwitch(slotId: number): Promise<void\>
**示例:** **示例:**
```js ```js
let promise = call.disableImsSwitch(0); call.disableImsSwitch(0).then(() => {
promise.then(data => { console.log(`disableImsSwitch success.`);
console.log(`disableImsSwitch success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`disableImsSwitch fail, promise: err->${JSON.stringify(err)}`); console.error(`disableImsSwitch fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3804,6 +3956,8 @@ isImsSwitchEnabled(slotId: number, callback: AsyncCallback<boolean\>): void ...@@ -3804,6 +3956,8 @@ isImsSwitchEnabled(slotId: number, callback: AsyncCallback<boolean\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3844,6 +3998,8 @@ isImsSwitchEnabled(slotId: number): Promise<boolean\> ...@@ -3844,6 +3998,8 @@ isImsSwitchEnabled(slotId: number): Promise<boolean\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
......
...@@ -25,13 +25,15 @@ on\(type: \'networkStateChange\', callback: Callback<NetworkState\>\): void; ...@@ -25,13 +25,15 @@ on\(type: \'networkStateChange\', callback: Callback<NetworkState\>\): void;
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | --------------------------------------------------------- | ---- | ---------------------------------------------------------------- |
| type | string | 是 | 网络状态变化事件 | | type | string | 是 | 网络状态变化事件,参数固定为'networkStateChange'。 |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | 是 | 回调函数。参考radio的[NetworkState](js-apis-radio.md#networkstate) | | callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | 是 | 回调函数。参考radio的[NetworkState](js-apis-radio.md#networkstate)|
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -62,14 +64,16 @@ on\(type: \'networkStateChange\', options: { slotId: number }, callback: Callbac ...@@ -62,14 +64,16 @@ on\(type: \'networkStateChange\', options: { slotId: number }, callback: Callbac
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | -------------------------------------- | | -------- | --------------------------------------------------------- | ---- | ---------------------------------------------------------------- |
| type | string | 是 | 网络状态变化事件 | | type | string | 是 | 网络状态变化事件,参数固定为'networkStateChange'。 |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | 是 | 回调函数。参考radio的[NetworkState](js-apis-radio.md#networkstate) | | callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | 是 | 回调函数。参考radio的[NetworkState](js-apis-radio.md#networkstate) |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -104,7 +108,7 @@ off\(type: \'networkStateChange\', callback?: Callback<NetworkState\>\): void; ...@@ -104,7 +108,7 @@ off\(type: \'networkStateChange\', callback?: Callback<NetworkState\>\): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | 是 | 网络状态变化事件 | | type | string | 是 | 网络状态变化事件,参数固定为'networkStateChange'。 |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | 否 | 回调函数。参考radio的[NetworkState](js-apis-radio.md#networkstate) | | callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | 否 | 回调函数。参考radio的[NetworkState](js-apis-radio.md#networkstate) |
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
...@@ -138,12 +142,14 @@ on\(type: \'signalInfoChange\', callback: Callback<Array<SignalInformation\>\>): ...@@ -138,12 +142,14 @@ on\(type: \'signalInfoChange\', callback: Callback<Array<SignalInformation\>\>):
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | string | 是 | 信号状态变化事件 | | type | string | 是 | 信号状态变化事件,参数固定为'signalInfoChange'。 |
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | 是 | 回调函数。参考radio的[SignalInformation](js-apis-radio.md#signalinformation) | | callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | 是 | 回调函数。参考radio的[SignalInformation](js-apis-radio.md#signalinformation) |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -172,14 +178,16 @@ on\(type: \'signalInfoChange\', options: { slotId: number }, callback: Callback< ...@@ -172,14 +178,16 @@ on\(type: \'signalInfoChange\', options: { slotId: number }, callback: Callback<
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | -------------------------------------- | | -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | string | 是 | 信号状态变化事件 | | type | string | 是 | 信号状态变化事件,参数固定为'signalInfoChange'。 |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | 是 | 回调函数。参考radio的[SignalInformation](js-apis-radio.md#signalinformation) | | callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | 是 | 回调函数。参考radio的[SignalInformation](js-apis-radio.md#signalinformation) |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -214,11 +222,13 @@ off\(type: \'signalInfoChange\', callback?: Callback<Array<SignalInformation\>\> ...@@ -214,11 +222,13 @@ off\(type: \'signalInfoChange\', callback?: Callback<Array<SignalInformation\>\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 信号状态变化事件 | | type | string | 是 | 信号状态变化事件,参数固定为'signalInfoChange'。 |
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | 否 | 回调函数。参考radio的[SignalInformation](js-apis-radio.md#signalinformation) | | callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | 否 | 回调函数。参考radio的[SignalInformation](js-apis-radio.md#signalinformation) |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -255,7 +265,7 @@ on\(type: \'cellInfoChange\', callback: Callback<CellInformation\>\): void; ...@@ -255,7 +265,7 @@ on\(type: \'cellInfoChange\', callback: Callback<CellInformation\>\): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------------------- | ---- |------------------------------------------------------------| | -------- | --------------------------------------------------------- | ---- |------------------------------------------------------------|
| type | string | 是 | 小区信息变化事件,固定为'cellInfoChange'。 | | type | string | 是 | 小区信息变化事件,固定为'cellInfoChange'。 |
| callback | Callback\<[CellInformation](js-apis-radio.md#cellinformation8)\> | 是 | 回调函数。| | callback | Callback\<[CellInformation](js-apis-radio.md#cellinformation8)\> | 是 | 回调函数。|
**错误码:** **错误码:**
...@@ -370,12 +380,14 @@ on(type: 'callStateChange', callback: Callback\<{ state: CallState, number: stri ...@@ -370,12 +380,14 @@ on(type: 'callStateChange', callback: Callback\<{ state: CallState, number: stri
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | string | 是 | 通话状态变化事件 | | type | string | 是 | 通话状态变化事件,参数固定为'callStateChange'。 |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | 是 | 回调函数,参考call的[CallState](js-apis-call.md#callstate)<br />number:电话号码 | | callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | 是 | 回调函数,参考call的[CallState](js-apis-call.md#callstate)<br />number:电话号码 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -404,13 +416,15 @@ on(type: 'callStateChange', options: { slotId: number }, callback: Callback<{ st ...@@ -404,13 +416,15 @@ on(type: 'callStateChange', options: { slotId: number }, callback: Callback<{ st
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | string | 是 | 通话状态变化事件 | | type | string | 是 | 通话状态变化事件,参数固定为'callStateChange'。 |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | 是 | 回调函数,参考call的[CallState](js-apis-call.md#callstate)<br />number:电话号码 | | callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | 是 | 回调函数,参考call的[CallState](js-apis-call.md#callstate)<br />number:电话号码 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -443,12 +457,14 @@ off(type: 'callStateChange', callback?: Callback<{ state: CallState, number: str ...@@ -443,12 +457,14 @@ off(type: 'callStateChange', callback?: Callback<{ state: CallState, number: str
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | string | 是 | 通话状态变化事件 | | type | string | 是 | 通话状态变化事件,参数固定为'callStateChange'。 |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | 否 | 回调函数,参考call的[CallState](js-apis-call.md#callstate)<br />number:电话号码 | | callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | 否 | 回调函数,参考call的[CallState](js-apis-call.md#callstate)<br />number:电话号码 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -482,11 +498,13 @@ on\(type: 'cellularDataConnectionStateChange', callback: Callback\<{ state: Data ...@@ -482,11 +498,13 @@ on\(type: 'cellularDataConnectionStateChange', callback: Callback\<{ state: Data
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 蜂窝数据链路连接状态事件 | | type | string | 是 | 蜂窝数据链路连接状态事件,参数固定为'cellularDataConnectionStateChange'。|
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | 是 | 回调函数,参考data的[DataConnectState](js-apis-telephony-data.md#dataconnectstate),radio的[RadioTechnology](js-apis-radio.md#radiotechnology)。 | | callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | 是 | 回调函数,参考data的[DataConnectState](js-apis-telephony-data.md#dataconnectstate),radio的[RadioTechnology](js-apis-radio.md#radiotechnology)。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -516,12 +534,14 @@ on\(type: 'cellularDataConnectionStateChange', options: { slotId: number }, call ...@@ -516,12 +534,14 @@ on\(type: 'cellularDataConnectionStateChange', options: { slotId: number }, call
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 蜂窝数据链路连接状态事件 | | type | string | 是 | 蜂窝数据链路连接状态事件,参数固定为'cellularDataConnectionStateChange'。|
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | 是 | 回调函数,参考data的[DataConnectState](js-apis-telephony-data.md#dataconnectstate),radio的[RadioTechnology](js-apis-radio.md#radiotechnology)。 | | callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | 是 | 回调函数,参考data的[DataConnectState](js-apis-telephony-data.md#dataconnectstate),radio的[RadioTechnology](js-apis-radio.md#radiotechnology)。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -555,11 +575,13 @@ off\(type: 'cellularDataConnectionStateChange', callback?: Callback\<{ state: D ...@@ -555,11 +575,13 @@ off\(type: 'cellularDataConnectionStateChange', callback?: Callback\<{ state: D
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 蜂窝数据链路连接状态事件 | | type | string | 是 | 蜂窝数据链路连接状态事件,参数固定为'cellularDataConnectionStateChange'。|
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | 否 | 回调函数,参考data的[DataConnectState](js-apis-telephony-data.md#dataconnectstate),radio的[RadioTechnology](js-apis-radio.md#radiotechnology)。 | | callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | 否 | 回调函数,参考data的[DataConnectState](js-apis-telephony-data.md#dataconnectstate),radio的[RadioTechnology](js-apis-radio.md#radiotechnology)。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -593,11 +615,13 @@ on\(type: 'cellularDataFlowChange', callback: Callback\<DataFlowType\>\): void; ...@@ -593,11 +615,13 @@ on\(type: 'cellularDataFlowChange', callback: Callback\<DataFlowType\>\): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 蜂窝数据业务的上下行数据流状态状态事件 | | type | string | 是 | 蜂窝数据业务的上下行数据流状态状态事件,参数固定为'cellularDataFlowChange'。 |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | 是 | 回调函数,参考data的[DataFlowType](js-apis-telephony-data.md#dataflowtype)。 | | callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | 是 | 回调函数,参考data的[DataFlowType](js-apis-telephony-data.md#dataflowtype)。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -627,12 +651,14 @@ on\(type: 'cellularDataFlowChange', options: { slotId: number }, callback: Call ...@@ -627,12 +651,14 @@ on\(type: 'cellularDataFlowChange', options: { slotId: number }, callback: Call
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 蜂窝数据业务的上下行数据流状态事件 | | type | string | 是 | 蜂窝数据业务的上下行数据流状态状态事件,参数固定为'cellularDataFlowChange'。 |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | 是 | 回调函数,参考data的[DataFlowType](js-apis-telephony-data.md#dataflowtype)。 | | callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | 是 | 回调函数,参考data的[DataFlowType](js-apis-telephony-data.md#dataflowtype)。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -664,13 +690,15 @@ off\(type: 'cellularDataFlowChange', callback?: Callback\<DataFlowType\>\): void ...@@ -664,13 +690,15 @@ off\(type: 'cellularDataFlowChange', callback?: Callback\<DataFlowType\>\): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 蜂窝数据业务的上下行数据流状态事件 | | type | string | 是 | 蜂窝数据业务的上下行数据流状态状态事件,参数固定为'cellularDataFlowChange'。 |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | 否 | 回调函数,参考data的[DataFlowType](js-apis-telephony-data.md#dataflowtype)。 | | callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | 否 | 回调函数,参考data的[DataFlowType](js-apis-telephony-data.md#dataflowtype)。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -703,12 +731,14 @@ on\(type: 'simStateChange', callback: Callback\<SimStateData\>\): void; ...@@ -703,12 +731,14 @@ on\(type: 'simStateChange', callback: Callback\<SimStateData\>\): void;
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | string | 是 | sim状态更改事件 | | type | string | 是 | sim状态更改事件,参数固定为'simStateChange'。 |
| callback | Callback\<[SimStateData](#simstatedata7)\> | 是 | 回调函数。 | | callback | Callback\<[SimStateData](#simstatedata7)\> | 是 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -738,12 +768,14 @@ on\(type: 'simStateChange', options: { slotId: number }, callback: Callback\<Sim ...@@ -738,12 +768,14 @@ on\(type: 'simStateChange', options: { slotId: number }, callback: Callback\<Sim
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | sim状态更改事件 | | type | string | 是 | sim状态更改事件,参数固定为'simStateChange'。 |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| callback | Callback\<[SimStateData](#simstatedata7)\> | 是 | 回调函数。 | | callback | Callback\<[SimStateData](#simstatedata7)\> | 是 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -777,11 +809,13 @@ off\(type: 'simStateChange', callback?: Callback\<SimStateData\>\): void; ...@@ -777,11 +809,13 @@ off\(type: 'simStateChange', callback?: Callback\<SimStateData\>\): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | sim状态更改事件 | | type | string | 是 | sim状态更改事件,参数固定为'simStateChange'。 |
| callback | Callback\<[SimStateData](#simstatedata7)\> | 否 | 回调函数。 | | callback | Callback\<[SimStateData](#simstatedata7)\> | 否 | 回调函数。 |
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
......
...@@ -32,6 +32,8 @@ getRadioTech\(slotId: number, callback: AsyncCallback<\{psRadioTech: RadioTechno ...@@ -32,6 +32,8 @@ getRadioTech\(slotId: number, callback: AsyncCallback<\{psRadioTech: RadioTechno
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -75,6 +77,8 @@ getRadioTech\(slotId: number\): Promise<\{psRadioTech: RadioTechnology, csRadioT ...@@ -75,6 +77,8 @@ getRadioTech\(slotId: number\): Promise<\{psRadioTech: RadioTechnology, csRadioT
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -115,6 +119,8 @@ getNetworkState\(callback: AsyncCallback<NetworkState\>\): void ...@@ -115,6 +119,8 @@ getNetworkState\(callback: AsyncCallback<NetworkState\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -152,6 +158,8 @@ getNetworkState\(slotId: number, callback: AsyncCallback<NetworkState\>\): void ...@@ -152,6 +158,8 @@ getNetworkState\(slotId: number, callback: AsyncCallback<NetworkState\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -195,6 +203,8 @@ getNetworkState\(slotId?: number\): Promise<NetworkState\> ...@@ -195,6 +203,8 @@ getNetworkState\(slotId?: number\): Promise<NetworkState\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -234,6 +244,8 @@ getNetworkSelectionMode\(slotId: number, callback: AsyncCallback<NetworkSelectio ...@@ -234,6 +244,8 @@ getNetworkSelectionMode\(slotId: number, callback: AsyncCallback<NetworkSelectio
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -274,6 +286,8 @@ getNetworkSelectionMode\(slotId: number\): Promise<NetworkSelectionMode\> ...@@ -274,6 +286,8 @@ getNetworkSelectionMode\(slotId: number\): Promise<NetworkSelectionMode\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -312,6 +326,8 @@ getISOCountryCodeForNetwork\(slotId: number, callback: AsyncCallback<string\>\): ...@@ -312,6 +326,8 @@ getISOCountryCodeForNetwork\(slotId: number, callback: AsyncCallback<string\>\):
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -352,6 +368,8 @@ getISOCountryCodeForNetwork\(slotId: number\): Promise<string\> ...@@ -352,6 +368,8 @@ getISOCountryCodeForNetwork\(slotId: number\): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -389,6 +407,8 @@ getPrimarySlotId\(callback: AsyncCallback\<number\>\): void ...@@ -389,6 +407,8 @@ getPrimarySlotId\(callback: AsyncCallback\<number\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 8300001 | Invalid parameter value. | | 8300001 | Invalid parameter value. |
...@@ -422,6 +442,8 @@ getPrimarySlotId\(\): Promise\<number\> ...@@ -422,6 +442,8 @@ getPrimarySlotId\(\): Promise\<number\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 8300001 | Invalid parameter value. | | 8300001 | Invalid parameter value. |
...@@ -459,6 +481,8 @@ getSignalInformation\(slotId: number, callback: AsyncCallback<Array<SignalInform ...@@ -459,6 +481,8 @@ getSignalInformation\(slotId: number, callback: AsyncCallback<Array<SignalInform
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -499,6 +523,8 @@ getSignalInformation\(slotId: number\): Promise<Array<SignalInformation\>\> ...@@ -499,6 +523,8 @@ getSignalInformation\(slotId: number\): Promise<Array<SignalInformation\>\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -646,6 +672,8 @@ isRadioOn\(callback: AsyncCallback<boolean\>\): void ...@@ -646,6 +672,8 @@ isRadioOn\(callback: AsyncCallback<boolean\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -683,6 +711,8 @@ isRadioOn\(slotId: number, callback: AsyncCallback<boolean\>\): void ...@@ -683,6 +711,8 @@ isRadioOn\(slotId: number, callback: AsyncCallback<boolean\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -726,6 +756,8 @@ isRadioOn\(slotId?: number\): Promise<boolean\> ...@@ -726,6 +756,8 @@ isRadioOn\(slotId?: number\): Promise<boolean\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -765,6 +797,8 @@ getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void ...@@ -765,6 +797,8 @@ getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -805,6 +839,8 @@ getOperatorName\(slotId: number\): Promise<string\> ...@@ -805,6 +839,8 @@ getOperatorName\(slotId: number\): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -846,6 +882,8 @@ setPrimarySlotId(slotId: number, callback: AsyncCallback<void\>): void ...@@ -846,6 +882,8 @@ setPrimarySlotId(slotId: number, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -860,8 +898,8 @@ setPrimarySlotId(slotId: number, callback: AsyncCallback<void\>): void ...@@ -860,8 +898,8 @@ setPrimarySlotId(slotId: number, callback: AsyncCallback<void\>): void
```js ```js
let slotId = 0; let slotId = 0;
radio.setPrimarySlotId(slotId, (err, data) => { radio.setPrimarySlotId(slotId, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -892,6 +930,8 @@ setPrimarySlotId\(slotId: number\): Promise\<void\> ...@@ -892,6 +930,8 @@ setPrimarySlotId\(slotId: number\): Promise\<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -907,9 +947,9 @@ setPrimarySlotId\(slotId: number\): Promise\<void\> ...@@ -907,9 +947,9 @@ setPrimarySlotId\(slotId: number\): Promise\<void\>
```js ```js
let slotId = 0; let slotId = 0;
let promise = radio.setPrimarySlotId(slotId); let promise = radio.setPrimarySlotId(slotId);
promise.then(data => { promise.then(() => {
console.log(`setPrimarySlotId success, promise: data->${JSON.stringify(data)}`); console.log(`setPrimarySlotId success.`);
}).catch(err => { }).catch((err) => {
console.log(`setPrimarySlotId failed, promise: err->${JSON.stringify(err)}`); console.log(`setPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -934,6 +974,8 @@ getIMEI(callback: AsyncCallback<string\>): void ...@@ -934,6 +974,8 @@ getIMEI(callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -973,6 +1015,8 @@ getIMEI(slotId: number, callback: AsyncCallback<string\>): void ...@@ -973,6 +1015,8 @@ getIMEI(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1018,6 +1062,8 @@ getIMEI(slotId?: number): Promise<string\> ...@@ -1018,6 +1062,8 @@ getIMEI(slotId?: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1059,6 +1105,8 @@ getMEID(callback: AsyncCallback<string\>): void ...@@ -1059,6 +1105,8 @@ getMEID(callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1098,6 +1146,8 @@ getMEID(slotId: number, callback: AsyncCallback<string\>): void ...@@ -1098,6 +1146,8 @@ getMEID(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1143,6 +1193,8 @@ getMEID(slotId?: number): Promise<string\> ...@@ -1143,6 +1193,8 @@ getMEID(slotId?: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1184,6 +1236,8 @@ getUniqueDeviceId(callback: AsyncCallback<string\>): void ...@@ -1184,6 +1236,8 @@ getUniqueDeviceId(callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1223,6 +1277,8 @@ getUniqueDeviceId(slotId: number, callback: AsyncCallback<string\>): void ...@@ -1223,6 +1277,8 @@ getUniqueDeviceId(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1268,6 +1324,8 @@ getUniqueDeviceId(slotId?: number): Promise<string\> ...@@ -1268,6 +1324,8 @@ getUniqueDeviceId(slotId?: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1309,6 +1367,8 @@ sendUpdateCellLocationRequest\(callback: AsyncCallback<void\>\): void ...@@ -1309,6 +1367,8 @@ sendUpdateCellLocationRequest\(callback: AsyncCallback<void\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1321,8 +1381,8 @@ sendUpdateCellLocationRequest\(callback: AsyncCallback<void\>\): void ...@@ -1321,8 +1381,8 @@ sendUpdateCellLocationRequest\(callback: AsyncCallback<void\>\): void
**示例:** **示例:**
```js ```js
radio.sendUpdateCellLocationRequest((err, data) => { radio.sendUpdateCellLocationRequest((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1347,6 +1407,8 @@ sendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback<void\>\): ...@@ -1347,6 +1407,8 @@ sendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback<void\>\):
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1360,8 +1422,8 @@ sendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback<void\>\): ...@@ -1360,8 +1422,8 @@ sendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback<void\>\):
```js ```js
let slotId = 0; let slotId = 0;
radio.sendUpdateCellLocationRequest(slotId, (err, data) => { radio.sendUpdateCellLocationRequest(slotId, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1391,6 +1453,8 @@ sendUpdateCellLocationRequest\(slotId?: number): Promise<void\> ...@@ -1391,6 +1453,8 @@ sendUpdateCellLocationRequest\(slotId?: number): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1404,10 +1468,9 @@ sendUpdateCellLocationRequest\(slotId?: number): Promise<void\> ...@@ -1404,10 +1468,9 @@ sendUpdateCellLocationRequest\(slotId?: number): Promise<void\>
```js ```js
let slotId = 0; let slotId = 0;
let promise = radio.sendUpdateCellLocationRequest(slotId); radio.sendUpdateCellLocationRequest(slotId).then(() => {
promise.then(data => { console.log(`sendUpdateCellLocationRequest success.`);
console.log(`sendUpdateCellLocationRequest success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.log(`sendUpdateCellLocationRequest failed, promise: err->${JSON.stringify(err)}`); console.log(`sendUpdateCellLocationRequest failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1432,6 +1495,8 @@ getCellInformation(callback: AsyncCallback<Array<CellInformation\>>): void ...@@ -1432,6 +1495,8 @@ getCellInformation(callback: AsyncCallback<Array<CellInformation\>>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1471,6 +1536,8 @@ getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation ...@@ -1471,6 +1536,8 @@ getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1516,6 +1583,8 @@ getCellInformation(slotId?: number): Promise<Array<CellInformation\>\> ...@@ -1516,6 +1583,8 @@ getCellInformation(slotId?: number): Promise<Array<CellInformation\>\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1558,6 +1627,8 @@ setNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCa ...@@ -1558,6 +1627,8 @@ setNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCa
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1582,8 +1653,8 @@ let networkSelectionModeOptions={ ...@@ -1582,8 +1653,8 @@ let networkSelectionModeOptions={
networkInformation: networkInformation, networkInformation: networkInformation,
resumeSelection: true resumeSelection: true
} }
radio.setNetworkSelectionMode(networkSelectionModeOptions, (err, data) => { radio.setNetworkSelectionMode(networkSelectionModeOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1613,6 +1684,8 @@ setNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise<void\> ...@@ -1613,6 +1684,8 @@ setNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1638,9 +1711,9 @@ let networkSelectionModeOptions={ ...@@ -1638,9 +1711,9 @@ let networkSelectionModeOptions={
resumeSelection: true resumeSelection: true
} }
let promise = radio.setNetworkSelectionMode(networkSelectionModeOptions); let promise = radio.setNetworkSelectionMode(networkSelectionModeOptions);
promise.then(data => { promise.then(() => {
console.log(`setNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`); console.log(`setNetworkSelectionMode success.`);
}).catch(err => { }).catch((err) => {
console.log(`setNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`); console.log(`setNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1666,6 +1739,8 @@ getNetworkSearchInformation\(slotId: number, callback: AsyncCallback<NetworkSear ...@@ -1666,6 +1739,8 @@ getNetworkSearchInformation\(slotId: number, callback: AsyncCallback<NetworkSear
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1709,6 +1784,8 @@ getNetworkSearchInformation\(slotId: number\): Promise<NetworkSearchResult\> ...@@ -1709,6 +1784,8 @@ getNetworkSearchInformation\(slotId: number\): Promise<NetworkSearchResult\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1747,6 +1824,8 @@ getNrOptionMode(callback: AsyncCallback<NrOptionMode\>): void ...@@ -1747,6 +1824,8 @@ getNrOptionMode(callback: AsyncCallback<NrOptionMode\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1783,6 +1862,8 @@ getNrOptionMode(slotId: number, callback: AsyncCallback<NrOptionMode\>): void ...@@ -1783,6 +1862,8 @@ getNrOptionMode(slotId: number, callback: AsyncCallback<NrOptionMode\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1825,6 +1906,8 @@ getNrOptionMode(slotId?: number): Promise<NrOptionMode\> ...@@ -1825,6 +1906,8 @@ getNrOptionMode(slotId?: number): Promise<NrOptionMode\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1865,6 +1948,8 @@ turnOnRadio(callback: AsyncCallback<void\>): void ...@@ -1865,6 +1948,8 @@ turnOnRadio(callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1877,8 +1962,8 @@ turnOnRadio(callback: AsyncCallback<void\>): void ...@@ -1877,8 +1962,8 @@ turnOnRadio(callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
radio.turnOnRadio((err, data) => { radio.turnOnRadio((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1904,6 +1989,8 @@ turnOnRadio(slotId: number, callback: AsyncCallback<void\>): void ...@@ -1904,6 +1989,8 @@ turnOnRadio(slotId: number, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1917,8 +2004,8 @@ turnOnRadio(slotId: number, callback: AsyncCallback<void\>): void ...@@ -1917,8 +2004,8 @@ turnOnRadio(slotId: number, callback: AsyncCallback<void\>): void
```js ```js
let slotId = 0; let slotId = 0;
radio.turnOnRadio(slotId, (err, data) => { radio.turnOnRadio(slotId, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1949,6 +2036,8 @@ turnOnRadio(slotId?: number): Promise<void\> ...@@ -1949,6 +2036,8 @@ turnOnRadio(slotId?: number): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1962,10 +2051,9 @@ turnOnRadio(slotId?: number): Promise<void\> ...@@ -1962,10 +2051,9 @@ turnOnRadio(slotId?: number): Promise<void\>
```js ```js
let slotId = 0; let slotId = 0;
let promise = radio.turnOnRadio(slotId); radio.turnOnRadio(slotId).then(() => {
promise.then(data => { console.log(`turnOnRadio success.`);
console.log(`turnOnRadio success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`turnOnRadio failed, promise: err->${JSON.stringify(err)}`); console.error(`turnOnRadio failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1990,6 +2078,8 @@ turnOffRadio(callback: AsyncCallback<void\>): void ...@@ -1990,6 +2078,8 @@ turnOffRadio(callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2002,8 +2092,8 @@ turnOffRadio(callback: AsyncCallback<void\>): void ...@@ -2002,8 +2092,8 @@ turnOffRadio(callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
radio.turnOffRadio((err, data) => { radio.turnOffRadio((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2029,6 +2119,8 @@ turnOffRadio(slotId: number, callback: AsyncCallback<void\>): void ...@@ -2029,6 +2119,8 @@ turnOffRadio(slotId: number, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2042,8 +2134,8 @@ turnOffRadio(slotId: number, callback: AsyncCallback<void\>): void ...@@ -2042,8 +2134,8 @@ turnOffRadio(slotId: number, callback: AsyncCallback<void\>): void
```js ```js
let slotId = 0; let slotId = 0;
radio.turnOffRadio(slotId, (err, data) => { radio.turnOffRadio(slotId, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2074,6 +2166,8 @@ turnOffRadio(slotId?: number): Promise<void\> ...@@ -2074,6 +2166,8 @@ turnOffRadio(slotId?: number): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2087,10 +2181,9 @@ turnOffRadio(slotId?: number): Promise<void\> ...@@ -2087,10 +2181,9 @@ turnOffRadio(slotId?: number): Promise<void\>
```js ```js
let slotId = 0; let slotId = 0;
let promise = radio.turnOffRadio(slotId); radio.turnOffRadio(slotId).then(() => {
promise.then(data => { console.log(`turnOffRadio success.`);
console.log(`turnOffRadio success, promise: data->${JSON.stringify(data)}`); }).catch((err) => {
}).catch(err => {
console.error(`turnOffRadio failed, promise: err->${JSON.stringify(err)}`); console.error(`turnOffRadio failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2117,6 +2210,8 @@ setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback ...@@ -2117,6 +2210,8 @@ setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2129,8 +2224,9 @@ setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback ...@@ -2129,8 +2224,9 @@ setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback
**示例:** **示例:**
```js ```js
radio.setPreferredNetwork(0, 1, (err, data) => { let slotId = 0;
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); radio.setPreferredNetwork(slotId, radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2161,7 +2257,9 @@ setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise< ...@@ -2161,7 +2257,9 @@ setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<
**错误码:** **错误码:**
| 错误码ID | 错误信息 | 以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -2173,10 +2271,10 @@ setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise< ...@@ -2173,10 +2271,10 @@ setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<
**示例:** **示例:**
```js ```js
let promise = radio.setPreferredNetwork(0, 1); let slotId = 0;
promise.then(data => { radio.setPreferredNetwork(slotId, radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM).then(() => {
console.log(`setPreferredNetwork success, promise: data->${JSON.stringify(data)}`); console.log(`setPreferredNetwork success.`);
}).catch(err => { }).catch((err) => {
console.log(`setPreferredNetwork failed, promise: err->${JSON.stringify(err)}`); console.log(`setPreferredNetwork failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2202,6 +2300,8 @@ getPreferredNetwork\(slotId: number, callback: AsyncCallback<PreferredNetworkMod ...@@ -2202,6 +2300,8 @@ getPreferredNetwork\(slotId: number, callback: AsyncCallback<PreferredNetworkMod
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2245,6 +2345,8 @@ getPreferredNetwork(slotId: number): Promise<PreferredNetworkMode\> ...@@ -2245,6 +2345,8 @@ getPreferredNetwork(slotId: number): Promise<PreferredNetworkMode\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2287,6 +2389,8 @@ getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<I ...@@ -2287,6 +2389,8 @@ getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<I
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2331,6 +2435,8 @@ getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo\> ...@@ -2331,6 +2435,8 @@ getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2374,6 +2480,8 @@ on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: ...@@ -2374,6 +2480,8 @@ on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback:
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2414,6 +2522,8 @@ off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback ...@@ -2414,6 +2522,8 @@ off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
......
...@@ -134,6 +134,8 @@ hasOperatorPrivileges(slotId: number, callback: AsyncCallback\<boolean\>): void ...@@ -134,6 +134,8 @@ hasOperatorPrivileges(slotId: number, callback: AsyncCallback\<boolean\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -173,6 +175,8 @@ hasOperatorPrivileges(slotId: number): Promise<boolean\> ...@@ -173,6 +175,8 @@ hasOperatorPrivileges(slotId: number): Promise<boolean\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -210,6 +214,8 @@ getISOCountryCodeForSim\(slotId: number, callback: AsyncCallback<string\>\): voi ...@@ -210,6 +214,8 @@ getISOCountryCodeForSim\(slotId: number, callback: AsyncCallback<string\>\): voi
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -250,6 +256,8 @@ getISOCountryCodeForSim\(slotId: number\): Promise<string\> ...@@ -250,6 +256,8 @@ getISOCountryCodeForSim\(slotId: number\): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -288,6 +296,8 @@ getSimOperatorNumeric\(slotId: number, callback: AsyncCallback<string\>\): void ...@@ -288,6 +296,8 @@ getSimOperatorNumeric\(slotId: number, callback: AsyncCallback<string\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -328,6 +338,8 @@ getSimOperatorNumeric\(slotId: number\): Promise<string\> ...@@ -328,6 +338,8 @@ getSimOperatorNumeric\(slotId: number\): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -366,6 +378,8 @@ getSimSpn\(slotId: number, callback: AsyncCallback<string\>\): void ...@@ -366,6 +378,8 @@ getSimSpn\(slotId: number, callback: AsyncCallback<string\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -406,6 +420,8 @@ getSimSpn\(slotId: number\): Promise<string\> ...@@ -406,6 +420,8 @@ getSimSpn\(slotId: number\): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -444,6 +460,8 @@ getSimState\(slotId: number, callback: AsyncCallback<SimState\>\): void ...@@ -444,6 +460,8 @@ getSimState\(slotId: number, callback: AsyncCallback<SimState\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -484,6 +502,8 @@ getSimState\(slotId: number\): Promise<SimState\> ...@@ -484,6 +502,8 @@ getSimState\(slotId: number\): Promise<SimState\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -521,6 +541,8 @@ getCardType\(slotId: number, callback: AsyncCallback<CardType\>\): void ...@@ -521,6 +541,8 @@ getCardType\(slotId: number, callback: AsyncCallback<CardType\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -561,6 +583,8 @@ getCardType\(slotId: number\): Promise<CardType\> ...@@ -561,6 +583,8 @@ getCardType\(slotId: number\): Promise<CardType\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -599,6 +623,8 @@ hasSimCard\(slotId: number, callback: AsyncCallback<boolean\>\): void ...@@ -599,6 +623,8 @@ hasSimCard\(slotId: number, callback: AsyncCallback<boolean\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -639,6 +665,8 @@ hasSimCard\(slotId: number\): Promise<boolean\> ...@@ -639,6 +665,8 @@ hasSimCard\(slotId: number\): Promise<boolean\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -680,6 +708,8 @@ getSimAccountInfo(slotId: number, callback: AsyncCallback<IccAccountInfo\>): voi ...@@ -680,6 +708,8 @@ getSimAccountInfo(slotId: number, callback: AsyncCallback<IccAccountInfo\>): voi
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -726,6 +756,8 @@ getSimAccountInfo(slotId: number): Promise<IccAccountInfo\> ...@@ -726,6 +756,8 @@ getSimAccountInfo(slotId: number): Promise<IccAccountInfo\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -768,6 +800,8 @@ getActiveSimAccountInfoList(callback: AsyncCallback<Array<IccAccountInfo\>>): vo ...@@ -768,6 +800,8 @@ getActiveSimAccountInfoList(callback: AsyncCallback<Array<IccAccountInfo\>>): vo
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -807,6 +841,8 @@ getActiveSimAccountInfoList(): Promise<Array<IccAccountInfo\>>; ...@@ -807,6 +841,8 @@ getActiveSimAccountInfoList(): Promise<Array<IccAccountInfo\>>;
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -849,6 +885,8 @@ setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback<void\>): void ...@@ -849,6 +885,8 @@ setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -863,8 +901,8 @@ setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback<void\>): void ...@@ -863,8 +901,8 @@ setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
sim.setDefaultVoiceSlotId(0, (err, data) => { sim.setDefaultVoiceSlotId(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -895,6 +933,8 @@ setDefaultVoiceSlotId(slotId: number): Promise\<void\> ...@@ -895,6 +933,8 @@ setDefaultVoiceSlotId(slotId: number): Promise\<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -910,9 +950,9 @@ setDefaultVoiceSlotId(slotId: number): Promise\<void\> ...@@ -910,9 +950,9 @@ setDefaultVoiceSlotId(slotId: number): Promise\<void\>
```js ```js
let promise = sim.setDefaultVoiceSlotId(0); let promise = sim.setDefaultVoiceSlotId(0);
promise.then(data => { promise.then(() => {
console.log(`setDefaultVoiceSlotId success, promise: data->${JSON.stringify(data)}`); console.log(`setDefaultVoiceSlotId success.`);
}).catch(err => { }).catch((err) => {
console.log(`setDefaultVoiceSlotId failed, promise: err->${JSON.stringify(err)}`); console.log(`setDefaultVoiceSlotId failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -939,6 +979,8 @@ setShowName\(slotId: number, name: string, callback: AsyncCallback<void\>\): voi ...@@ -939,6 +979,8 @@ setShowName\(slotId: number, name: string, callback: AsyncCallback<void\>\): voi
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -953,8 +995,8 @@ setShowName\(slotId: number, name: string, callback: AsyncCallback<void\>\): voi ...@@ -953,8 +995,8 @@ setShowName\(slotId: number, name: string, callback: AsyncCallback<void\>\): voi
```js ```js
let name = "ShowName"; let name = "ShowName";
sim.setShowName(0, name, (err, data) => { sim.setShowName(0, name, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -985,6 +1027,8 @@ setShowName\(slotId: number, name: string\): Promise\<void\> ...@@ -985,6 +1027,8 @@ setShowName\(slotId: number, name: string\): Promise\<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1000,9 +1044,9 @@ setShowName\(slotId: number, name: string\): Promise\<void\> ...@@ -1000,9 +1044,9 @@ setShowName\(slotId: number, name: string\): Promise\<void\>
```js ```js
let name = "ShowName"; let name = "ShowName";
let promise = sim.setShowName(0, name); let promise = sim.setShowName(0, name);
promise.then(data => { promise.then(() => {
console.log(`setShowName success, promise: data->${JSON.stringify(data)}`); console.log(`setShowName success.`);
}).catch(err => { }).catch((err) => {
console.log(`setShowName failed, promise: err->${JSON.stringify(err)}`); console.log(`setShowName failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1028,6 +1072,8 @@ getShowName(slotId: number, callback: AsyncCallback<string\>): void ...@@ -1028,6 +1072,8 @@ getShowName(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1073,6 +1119,8 @@ getShowName(slotId: number): Promise<string\> ...@@ -1073,6 +1119,8 @@ getShowName(slotId: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1116,6 +1164,8 @@ setShowNumber\(slotId: number, number: string, callback: AsyncCallback<void\>\): ...@@ -1116,6 +1164,8 @@ setShowNumber\(slotId: number, number: string, callback: AsyncCallback<void\>\):
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1130,8 +1180,8 @@ setShowNumber\(slotId: number, number: string, callback: AsyncCallback<void\>\): ...@@ -1130,8 +1180,8 @@ setShowNumber\(slotId: number, number: string, callback: AsyncCallback<void\>\):
```js ```js
let number = '+861xxxxxxxxxx'; let number = '+861xxxxxxxxxx';
sim.setShowNumber(0, number, (err, data) => { sim.setShowNumber(0, number, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1163,6 +1213,8 @@ setShowNumber\(slotId: number, number: string\): Promise\<void\> ...@@ -1163,6 +1213,8 @@ setShowNumber\(slotId: number, number: string\): Promise\<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1178,9 +1230,9 @@ setShowNumber\(slotId: number, number: string\): Promise\<void\> ...@@ -1178,9 +1230,9 @@ setShowNumber\(slotId: number, number: string\): Promise\<void\>
```js ```js
let number = '+861xxxxxxxxxx'; let number = '+861xxxxxxxxxx';
let promise = sim.setShowNumber(0, number); let promise = sim.setShowNumber(0, number);
promise.then(data => { promise.then(() => {
console.log(`setShowNumber success, promise: data->${JSON.stringify(data)}`); console.log(`setShowNumber success.`);
}).catch(err => { }).catch((err) => {
console.log(`setShowNumber failed, promise: err->${JSON.stringify(err)}`); console.log(`setShowNumber failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1206,6 +1258,8 @@ getShowNumber(slotId: number, callback: AsyncCallback<string\>): void ...@@ -1206,6 +1258,8 @@ getShowNumber(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1251,6 +1305,8 @@ getShowNumber(slotId: number): Promise<string\> ...@@ -1251,6 +1305,8 @@ getShowNumber(slotId: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1293,6 +1349,8 @@ activateSim(slotId: number, callback: AsyncCallback<void\>): void ...@@ -1293,6 +1349,8 @@ activateSim(slotId: number, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1306,8 +1364,8 @@ activateSim(slotId: number, callback: AsyncCallback<void\>): void ...@@ -1306,8 +1364,8 @@ activateSim(slotId: number, callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
sim.activateSim(0, (err, data) => { sim.activateSim(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1338,6 +1396,8 @@ activateSim(slotId: number): Promise\<void\> ...@@ -1338,6 +1396,8 @@ activateSim(slotId: number): Promise\<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1352,9 +1412,9 @@ activateSim(slotId: number): Promise\<void\> ...@@ -1352,9 +1412,9 @@ activateSim(slotId: number): Promise\<void\>
```js ```js
let promise = sim.activateSim(0); let promise = sim.activateSim(0);
promise.then(data => { promise.then(() => {
console.log(`activateSim success, promise: data->${JSON.stringify(data)}`); console.log(`activateSim success.`);
}).catch(err => { }).catch((err) => {
console.log(`activateSim failed, promise: err->${JSON.stringify(err)}`); console.log(`activateSim failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1380,6 +1440,8 @@ deactivateSim(slotId: number, callback: AsyncCallback<void\>): void ...@@ -1380,6 +1440,8 @@ deactivateSim(slotId: number, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1393,8 +1455,8 @@ deactivateSim(slotId: number, callback: AsyncCallback<void\>): void ...@@ -1393,8 +1455,8 @@ deactivateSim(slotId: number, callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
sim.deactivateSim(0, (err, data) => { sim.deactivateSim(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1425,6 +1487,8 @@ deactivateSim(slotId: number): Promise\<void\> ...@@ -1425,6 +1487,8 @@ deactivateSim(slotId: number): Promise\<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1439,9 +1503,9 @@ deactivateSim(slotId: number): Promise\<void\> ...@@ -1439,9 +1503,9 @@ deactivateSim(slotId: number): Promise\<void\>
```js ```js
let promise = sim.deactivateSim(0); let promise = sim.deactivateSim(0);
promise.then(data => { promise.then(() => {
console.log(`deactivateSim success, promise: data->${JSON.stringify(data)}`); console.log(`deactivateSim success.`);
}).catch(err => { }).catch((err) => {
console.log(`deactivateSim failed, promise: err->${JSON.stringify(err)}`); console.log(`deactivateSim failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1468,6 +1532,8 @@ setLockState(slotId: number, options: LockInfo, callback: AsyncCallback<LockStat ...@@ -1468,6 +1532,8 @@ setLockState(slotId: number, options: LockInfo, callback: AsyncCallback<LockStat
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1520,6 +1586,8 @@ setLockState(slotId: number, options: LockInfo): Promise<LockStatusResponse\> ...@@ -1520,6 +1586,8 @@ setLockState(slotId: number, options: LockInfo): Promise<LockStatusResponse\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1569,6 +1637,8 @@ getLockState(slotId: number, lockType: LockType, callback: AsyncCallback<LockSta ...@@ -1569,6 +1637,8 @@ getLockState(slotId: number, lockType: LockType, callback: AsyncCallback<LockSta
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1616,6 +1686,8 @@ getLockState(slotId: number, lockType: LockType): Promise<LockState\> ...@@ -1616,6 +1686,8 @@ getLockState(slotId: number, lockType: LockType): Promise<LockState\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1661,6 +1733,8 @@ alterPin(slotId: number, newPin: string, oldPin: string, callback: AsyncCallback ...@@ -1661,6 +1733,8 @@ alterPin(slotId: number, newPin: string, oldPin: string, callback: AsyncCallback
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1709,6 +1783,8 @@ alterPin(slotId: number, newPin: string, oldPin: string): Promise<LockStatusResp ...@@ -1709,6 +1783,8 @@ alterPin(slotId: number, newPin: string, oldPin: string): Promise<LockStatusResp
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1754,6 +1830,8 @@ alterPin2(slotId: number, newPin2: string, oldPin2: string, callback: AsyncCallb ...@@ -1754,6 +1830,8 @@ alterPin2(slotId: number, newPin2: string, oldPin2: string, callback: AsyncCallb
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1802,6 +1880,8 @@ alterPin2(slotId: number, newPin2: string, oldPin2: string): Promise<LockStatusR ...@@ -1802,6 +1880,8 @@ alterPin2(slotId: number, newPin2: string, oldPin2: string): Promise<LockStatusR
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1846,6 +1926,8 @@ unlockPin(slotId: number, pin: string, callback: AsyncCallback<LockStatusRespons ...@@ -1846,6 +1926,8 @@ unlockPin(slotId: number, pin: string, callback: AsyncCallback<LockStatusRespons
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1894,6 +1976,8 @@ unlockPin(slotId: number, pin: string): Promise&lt;LockStatusResponse\> ...@@ -1894,6 +1976,8 @@ unlockPin(slotId: number, pin: string): Promise&lt;LockStatusResponse\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1940,6 +2024,8 @@ unlockPuk(slotId: number, newPin: string, puk: string, callback: AsyncCallback<L ...@@ -1940,6 +2024,8 @@ unlockPuk(slotId: number, newPin: string, puk: string, callback: AsyncCallback<L
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -1990,6 +2076,8 @@ unlockPuk(slotId: number, newPin: string, puk: string): Promise&lt;LockStatusRes ...@@ -1990,6 +2076,8 @@ unlockPuk(slotId: number, newPin: string, puk: string): Promise&lt;LockStatusRes
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2036,6 +2124,8 @@ unlockPin2(slotId: number, pin2: string, callback: AsyncCallback<LockStatusRespo ...@@ -2036,6 +2124,8 @@ unlockPin2(slotId: number, pin2: string, callback: AsyncCallback<LockStatusRespo
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2084,6 +2174,8 @@ unlockPin2(slotId: number, pin2: string): Promise&lt;LockStatusResponse\> ...@@ -2084,6 +2174,8 @@ unlockPin2(slotId: number, pin2: string): Promise&lt;LockStatusResponse\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2130,6 +2222,8 @@ unlockPuk2(slotId: number, newPin2: string, puk2: string, callback: AsyncCallbac ...@@ -2130,6 +2222,8 @@ unlockPuk2(slotId: number, newPin2: string, puk2: string, callback: AsyncCallbac
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2180,6 +2274,8 @@ unlockPuk2(slotId: number, newPin2: string, puk2: string): Promise&lt;LockStatus ...@@ -2180,6 +2274,8 @@ unlockPuk2(slotId: number, newPin2: string, puk2: string): Promise&lt;LockStatus
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2245,6 +2341,8 @@ getSimIccId(slotId: number, callback: AsyncCallback<string\>): void ...@@ -2245,6 +2341,8 @@ getSimIccId(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2290,6 +2388,8 @@ getSimIccId(slotId: number): Promise<string\> ...@@ -2290,6 +2388,8 @@ getSimIccId(slotId: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2332,6 +2432,8 @@ getVoiceMailIdentifier(slotId: number, callback: AsyncCallback<string\>): void ...@@ -2332,6 +2432,8 @@ getVoiceMailIdentifier(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2377,6 +2479,8 @@ getVoiceMailIdentifier(slotId: number): Promise<string\> ...@@ -2377,6 +2479,8 @@ getVoiceMailIdentifier(slotId: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2419,6 +2523,8 @@ getVoiceMailNumber(slotId: number, callback: AsyncCallback<string\>): void ...@@ -2419,6 +2523,8 @@ getVoiceMailNumber(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2464,6 +2570,8 @@ getVoiceMailNumber(slotId: number): Promise<string\> ...@@ -2464,6 +2570,8 @@ getVoiceMailNumber(slotId: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2509,6 +2617,8 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback: ...@@ -2509,6 +2617,8 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback:
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2523,8 +2633,8 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback: ...@@ -2523,8 +2633,8 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback:
**示例:** **示例:**
```js ```js
sim.setVoiceMailInfo(0, "mail", "xxx@xxx.com", (err, data) => { sim.setVoiceMailInfo(0, "mail", "xxx@xxx.com", (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2557,6 +2667,8 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string): Promise< ...@@ -2557,6 +2667,8 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string): Promise<
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2572,9 +2684,9 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string): Promise< ...@@ -2572,9 +2684,9 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string): Promise<
```js ```js
let promise = sim.setVoiceMailInfo(0, "mail", "xxx@xxx.com"); let promise = sim.setVoiceMailInfo(0, "mail", "xxx@xxx.com");
promise.then(data => { promise.then(() => {
console.log(`setVoiceMailInfo success, promise: data->${JSON.stringify(data)}`); console.log(`setVoiceMailInfo success.`);
}).catch(err => { }).catch((err) => {
console.log(`setVoiceMailInfo failed, promise: err->${JSON.stringify(err)}`); console.log(`setVoiceMailInfo failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -2600,6 +2712,8 @@ getSimTelephoneNumber(slotId: number, callback: AsyncCallback<string\>): void ...@@ -2600,6 +2712,8 @@ getSimTelephoneNumber(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2645,6 +2759,8 @@ getSimTelephoneNumber(slotId: number): Promise<string\> ...@@ -2645,6 +2759,8 @@ getSimTelephoneNumber(slotId: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2687,6 +2803,8 @@ getSimGid1(slotId: number, callback: AsyncCallback<string\>): void ...@@ -2687,6 +2803,8 @@ getSimGid1(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2732,6 +2850,8 @@ getSimGid1(slotId: number): Promise<string\> ...@@ -2732,6 +2850,8 @@ getSimGid1(slotId: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2774,6 +2894,8 @@ getIMSI(slotId: number, callback: AsyncCallback<string\>): void ...@@ -2774,6 +2894,8 @@ getIMSI(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2819,6 +2941,8 @@ getIMSI(slotId: number): Promise<string\> ...@@ -2819,6 +2941,8 @@ getIMSI(slotId: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2861,6 +2985,8 @@ getOperatorConfigs(slotId: number, callback: AsyncCallback<Array<OperatorConfig\ ...@@ -2861,6 +2985,8 @@ getOperatorConfigs(slotId: number, callback: AsyncCallback<Array<OperatorConfig\
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2906,6 +3032,8 @@ getOperatorConfigs(slotId: number): Promise<Array<OperatorConfig\>> ...@@ -2906,6 +3032,8 @@ getOperatorConfigs(slotId: number): Promise<Array<OperatorConfig\>>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2949,6 +3077,8 @@ queryIccDiallingNumbers(slotId: number, type: ContactType, callback: AsyncCallba ...@@ -2949,6 +3077,8 @@ queryIccDiallingNumbers(slotId: number, type: ContactType, callback: AsyncCallba
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -2996,6 +3126,8 @@ queryIccDiallingNumbers(slotId: number, type: ContactType): Promise<Array<Dialli ...@@ -2996,6 +3126,8 @@ queryIccDiallingNumbers(slotId: number, type: ContactType): Promise<Array<Dialli
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3041,6 +3173,8 @@ addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli ...@@ -3041,6 +3173,8 @@ addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3060,8 +3194,8 @@ let diallingNumbersInof = { ...@@ -3060,8 +3194,8 @@ let diallingNumbersInof = {
number: "138xxxxxxxx", number: "138xxxxxxxx",
pin2: "1234" pin2: "1234"
}; };
sim.addIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => { sim.addIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3094,6 +3228,8 @@ addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli ...@@ -3094,6 +3228,8 @@ addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3113,9 +3249,9 @@ let diallingNumbersInof = { ...@@ -3113,9 +3249,9 @@ let diallingNumbersInof = {
number: "138xxxxxxxx" number: "138xxxxxxxx"
}; };
let promise = sim.addIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof); let promise = sim.addIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof);
promise.then(data => { promise.then(() => {
console.log(`addIccDiallingNumbers success, promise: data->${JSON.stringify(data)}`); console.log(`addIccDiallingNumbers success.`);
}).catch(err => { }).catch((err) => {
console.log(`addIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`); console.log(`addIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3143,6 +3279,8 @@ delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli ...@@ -3143,6 +3279,8 @@ delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3163,8 +3301,8 @@ let diallingNumbersInof = { ...@@ -3163,8 +3301,8 @@ let diallingNumbersInof = {
recordNumber: 123, recordNumber: 123,
pin2: "1234" pin2: "1234"
}; };
sim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => { sim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3197,6 +3335,8 @@ delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli ...@@ -3197,6 +3335,8 @@ delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3216,9 +3356,9 @@ let diallingNumbersInof = { ...@@ -3216,9 +3356,9 @@ let diallingNumbersInof = {
number: "138xxxxxxxx" number: "138xxxxxxxx"
}; };
let promise = sim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof); let promise = sim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof);
promise.then(data => { promise.then(() => {
console.log(`delIccDiallingNumbers success, promise: data->${JSON.stringify(data)}`); console.log(`delIccDiallingNumbers success.`);
}).catch(err => { }).catch((err) => {
console.log(`delIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`); console.log(`delIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3246,6 +3386,8 @@ updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dia ...@@ -3246,6 +3386,8 @@ updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dia
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3266,8 +3408,8 @@ let diallingNumbersInof = { ...@@ -3266,8 +3408,8 @@ let diallingNumbersInof = {
recordNumber: 123, recordNumber: 123,
pin2: "1234" pin2: "1234"
}; };
sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => { sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3300,6 +3442,8 @@ updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dia ...@@ -3300,6 +3442,8 @@ updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dia
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3320,9 +3464,9 @@ let diallingNumbersInof = { ...@@ -3320,9 +3464,9 @@ let diallingNumbersInof = {
recordNumber: 123 recordNumber: 123
}; };
let promise = sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof); let promise = sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof);
promise.then(data => { promise.then(() => {
console.log(`updateIccDiallingNumbers success, promise: data->${JSON.stringify(data)}`); console.log(`updateIccDiallingNumbers success.`);
}).catch(err => { }).catch((err) => {
console.log(`updateIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`); console.log(`updateIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3349,6 +3493,8 @@ sendEnvelopeCmd(slotId: number, cmd: string, callback: AsyncCallback<void\>): vo ...@@ -3349,6 +3493,8 @@ sendEnvelopeCmd(slotId: number, cmd: string, callback: AsyncCallback<void\>): vo
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3362,8 +3508,8 @@ sendEnvelopeCmd(slotId: number, cmd: string, callback: AsyncCallback<void\>): vo ...@@ -3362,8 +3508,8 @@ sendEnvelopeCmd(slotId: number, cmd: string, callback: AsyncCallback<void\>): vo
**示例:** **示例:**
```js ```js
sim.sendEnvelopeCmd(0, "ls", (err, data) => { sim.sendEnvelopeCmd(0, "ls", (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3395,6 +3541,8 @@ sendEnvelopeCmd(slotId: number, cmd: string): Promise<void\> ...@@ -3395,6 +3541,8 @@ sendEnvelopeCmd(slotId: number, cmd: string): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3409,9 +3557,9 @@ sendEnvelopeCmd(slotId: number, cmd: string): Promise<void\> ...@@ -3409,9 +3557,9 @@ sendEnvelopeCmd(slotId: number, cmd: string): Promise<void\>
```js ```js
let promise = sim.sendEnvelopeCmd(0, "ls"); let promise = sim.sendEnvelopeCmd(0, "ls");
promise.then(data => { promise.then(() => {
console.log(`sendEnvelopeCmd success, promise: data->${JSON.stringify(data)}`); console.log(`sendEnvelopeCmd success.`);
}).catch(err => { }).catch((err) => {
console.log(`sendEnvelopeCmd failed, promise: err->${JSON.stringify(err)}`); console.log(`sendEnvelopeCmd failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3438,6 +3586,8 @@ sendTerminalResponseCmd(slotId: number, cmd: string, callback: AsyncCallback<voi ...@@ -3438,6 +3586,8 @@ sendTerminalResponseCmd(slotId: number, cmd: string, callback: AsyncCallback<voi
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3451,8 +3601,8 @@ sendTerminalResponseCmd(slotId: number, cmd: string, callback: AsyncCallback<voi ...@@ -3451,8 +3601,8 @@ sendTerminalResponseCmd(slotId: number, cmd: string, callback: AsyncCallback<voi
**示例:** **示例:**
```js ```js
sim.sendTerminalResponseCmd(0, "ls", (err, data) => { sim.sendTerminalResponseCmd(0, "ls", (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3484,6 +3634,8 @@ sendTerminalResponseCmd(slotId: number, cmd: string): Promise<void\> ...@@ -3484,6 +3634,8 @@ sendTerminalResponseCmd(slotId: number, cmd: string): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3498,9 +3650,9 @@ sendTerminalResponseCmd(slotId: number, cmd: string): Promise<void\> ...@@ -3498,9 +3650,9 @@ sendTerminalResponseCmd(slotId: number, cmd: string): Promise<void\>
```js ```js
let promise = sim.sendTerminalResponseCmd(0, "ls"); let promise = sim.sendTerminalResponseCmd(0, "ls");
promise.then(data => { promise.then(() => {
console.log(`sendTerminalResponseCmd success, promise: data->${JSON.stringify(data)}`); console.log(`sendTerminalResponseCmd success.`);
}).catch(err => { }).catch((err) => {
console.log(`sendTerminalResponseCmd failed, promise: err->${JSON.stringify(err)}`); console.log(`sendTerminalResponseCmd failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -3528,6 +3680,8 @@ unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<L ...@@ -3528,6 +3680,8 @@ unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<L
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3579,6 +3733,8 @@ unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise<LockStatusRespon ...@@ -3579,6 +3733,8 @@ unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise<LockStatusRespon
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -3622,6 +3778,8 @@ getOpKey(slotId: number, callback: AsyncCallback<string\>): void ...@@ -3622,6 +3778,8 @@ getOpKey(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3671,6 +3829,8 @@ getOpKey(slotId: number): Promise<string\> ...@@ -3671,6 +3829,8 @@ getOpKey(slotId: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3709,6 +3869,8 @@ getOpName(slotId: number, callback: AsyncCallback<string\>): void ...@@ -3709,6 +3869,8 @@ getOpName(slotId: number, callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3758,6 +3920,8 @@ getOpName(slotId: number): Promise<string\> ...@@ -3758,6 +3920,8 @@ getOpName(slotId: number): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -3847,17 +4011,17 @@ SIM卡状态。 ...@@ -3847,17 +4011,17 @@ SIM卡状态。
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
| 名称 | 值 | 说明 | | 名称 | 值 | 说明 |
| ------------ | ---- | ----------------------------------------------- | | ------------ | ---- | ------------------------------------------------ |
| PN_PIN_LOCK | 0 | 定制网络PIN锁*(参照 3GPP TS 22.022 [33])* | | PN_PIN_LOCK | 0 | 定制网络PIN锁(参照 3GPP TS 22.022 [33])。 |
| PN_PUK_LOCK | 1 | 定制网络PUk锁。 | | PN_PUK_LOCK | 1 | 定制网络PUk锁。 |
| PU_PIN_LOCK | 2 | 定制网络子集PIN锁*(参照 3GPP TS 22.022 [33])* | | PU_PIN_LOCK | 2 | 定制网络子集PIN锁(参照 3GPP TS 22.022 [33])。 |
| PU_PUK_LOCK | 3 | 定制网络子集PUK锁。 | | PU_PUK_LOCK | 3 | 定制网络子集PUK锁。 |
| PP_PIN_LOCK | 4 | 定制服务提供者PIN锁*(参照 3GPP TS 22.022 [33])* | | PP_PIN_LOCK | 4 | 定制服务提供者PIN锁(参照 3GPP TS 22.022 [33])。 |
| PP_PUK_LOCK | 5 | 定制服务提供者PUK锁。 | | PP_PUK_LOCK | 5 | 定制服务提供者PUK锁。 |
| PC_PIN_LOCK | 6 | 定制企业PIN锁*(参照 3GPP TS 22.022 [33])* | | PC_PIN_LOCK | 6 | 定制企业PIN锁(参照 3GPP TS 22.022 [33])。 |
| PC_PUK_LOCK | 7 | 定制企业Puk锁。 | | PC_PUK_LOCK | 7 | 定制企业Puk锁。 |
| SIM_PIN_LOCK | 8 | 定制SIM的PIN锁*(参照 3GPP TS 22.022 [33])* | | SIM_PIN_LOCK | 8 | 定制SIM的PIN锁(参照 3GPP TS 22.022 [33])。 |
| SIM_PUK_LOCK | 9 | 定制SIM的PUK锁。 | | SIM_PUK_LOCK | 9 | 定制SIM的PUK锁。 |
## LockStatusResponse<sup>7+</sup> ## LockStatusResponse<sup>7+</sup>
......
...@@ -91,6 +91,19 @@ sendMessage(options: SendMessageOptions): void ...@@ -91,6 +91,19 @@ sendMessage(options: SendMessageOptions): void
| ------- | ----------------------------------------- | ---- | ------------------------------------------------------------ | | ------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| options | [SendMessageOptions](#sendmessageoptions) | 是 | 发送短信的参数和回调,参考[SendMessageOptions](#sendmessageoptions)。 | | options | [SendMessageOptions](#sendmessageoptions) | 是 | 发送短信的参数和回调,参考[SendMessageOptions](#sendmessageoptions)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**示例:** **示例:**
```js ```js
...@@ -179,6 +192,8 @@ setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback&lt;void&gt;\): void ...@@ -179,6 +192,8 @@ setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback&lt;void&gt;\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -192,8 +207,8 @@ setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback&lt;void&gt;\): void ...@@ -192,8 +207,8 @@ setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback&lt;void&gt;\): void
**示例:** **示例:**
```js ```js
sms.setDefaultSmsSlotId(0, (err, data) => { sms.setDefaultSmsSlotId(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}.`);
}); });
``` ```
...@@ -224,6 +239,8 @@ setDefaultSmsSlotId\(slotId: number\): Promise&lt;void&gt; ...@@ -224,6 +239,8 @@ setDefaultSmsSlotId\(slotId: number\): Promise&lt;void&gt;
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -238,9 +255,9 @@ setDefaultSmsSlotId\(slotId: number\): Promise&lt;void&gt; ...@@ -238,9 +255,9 @@ setDefaultSmsSlotId\(slotId: number\): Promise&lt;void&gt;
```js ```js
let promise = sms.setDefaultSmsSlotId(0); let promise = sms.setDefaultSmsSlotId(0);
promise.then(data => { promise.then(() => {
console.log(`setDefaultSmsSlotId success, promise: data->${JSON.stringify(data)}`); console.log(`setDefaultSmsSlotId success.`);
}).catch(err => { }).catch((err) => {
console.error(`setDefaultSmsSlotId failed, promise: err->${JSON.stringify(err)}`); console.error(`setDefaultSmsSlotId failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -267,6 +284,8 @@ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\): ...@@ -267,6 +284,8 @@ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\):
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -281,8 +300,8 @@ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\): ...@@ -281,8 +300,8 @@ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\):
```js ```js
let slotId = 0; let slotId = 0;
let smscAddr = '+861xxxxxxxxxx'; let smscAddr = '+861xxxxxxxxxx';
sms.setSmscAddr(slotId, smscAddr, (err,data) => { sms.setSmscAddr(slotId, smscAddr, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -314,6 +333,8 @@ setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\> ...@@ -314,6 +333,8 @@ setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -329,9 +350,9 @@ setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\> ...@@ -329,9 +350,9 @@ setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\>
let slotId = 0; let slotId = 0;
let smscAddr = '+861xxxxxxxxxx'; let smscAddr = '+861xxxxxxxxxx';
let promise = sms.setSmscAddr(slotId, smscAddr); let promise = sms.setSmscAddr(slotId, smscAddr);
promise.then(data => { promise.then(() => {
console.log(`setSmscAddr success, promise: data->${JSON.stringify(data)}`); console.log(`setSmscAddr success.`);
}).catch(err => { }).catch((err) => {
console.error(`setSmscAddr failed, promise: err->${JSON.stringify(err)}`); console.error(`setSmscAddr failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -358,6 +379,8 @@ getSmscAddr\(slotId: number, callback: AsyncCallback<string\>\): void ...@@ -358,6 +379,8 @@ getSmscAddr\(slotId: number, callback: AsyncCallback<string\>\): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -403,6 +426,8 @@ getSmscAddr\(slotId: number\): Promise<string\> ...@@ -403,6 +426,8 @@ getSmscAddr\(slotId: number\): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -464,6 +489,8 @@ splitMessage(content: string, callback: AsyncCallback<Array<string\>>): void ...@@ -464,6 +489,8 @@ splitMessage(content: string, callback: AsyncCallback<Array<string\>>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -509,6 +536,8 @@ splitMessage(content: string): Promise<Array<string\>> ...@@ -509,6 +536,8 @@ splitMessage(content: string): Promise<Array<string\>>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -551,6 +580,8 @@ addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void\>): void ...@@ -551,6 +580,8 @@ addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -569,8 +600,8 @@ let simMessageOptions = { ...@@ -569,8 +600,8 @@ let simMessageOptions = {
pdu: "xxxxxx", pdu: "xxxxxx",
status: sms.SimMessageStatus.SIM_MESSAGE_STATUS_READ status: sms.SimMessageStatus.SIM_MESSAGE_STATUS_READ
}; };
sms.addSimMessage(simMessageOptions, (err, data) => { sms.addSimMessage(simMessageOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -601,6 +632,8 @@ addSimMessage(options: SimMessageOptions): Promise<void\> ...@@ -601,6 +632,8 @@ addSimMessage(options: SimMessageOptions): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -620,9 +653,9 @@ let simMessageOptions = { ...@@ -620,9 +653,9 @@ let simMessageOptions = {
status: sms.SimMessageStatus.SIM_MESSAGE_STATUS_READ status: sms.SimMessageStatus.SIM_MESSAGE_STATUS_READ
}; };
let promise = sms.addSimMessage(simMessageOptions); let promise = sms.addSimMessage(simMessageOptions);
promise.then(data => { promise.then(() => {
console.log(`addSimMessage success, promise: data->${JSON.stringify(data)}`); console.log(`addSimMessage success.`);
}).catch(err => { }).catch((err) => {
console.error(`addSimMessage failed, promise: err->${JSON.stringify(err)}`); console.error(`addSimMessage failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -649,6 +682,8 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>): ...@@ -649,6 +682,8 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>):
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -663,8 +698,8 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>): ...@@ -663,8 +698,8 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>):
```js ```js
let slotId = 0; let slotId = 0;
let msgIndex = 1; let msgIndex = 1;
sms.delSimMessage(slotId, msgIndex, (err, data) => { sms.delSimMessage(slotId, msgIndex, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -696,6 +731,8 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\> ...@@ -696,6 +731,8 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -711,9 +748,9 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\> ...@@ -711,9 +748,9 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\>
let slotId = 0; let slotId = 0;
let msgIndex = 1; let msgIndex = 1;
let promise = sms.delSimMessage(slotId, msgIndex); let promise = sms.delSimMessage(slotId, msgIndex);
promise.then(data => { promise.then(() => {
console.log(`delSimMessage success, promise: data->${JSON.stringify(data)}`); console.log(`delSimMessage success.`);
}).catch(err => { }).catch((err) => {
console.error(`delSimMessage failed, promise: err->${JSON.stringify(err)}`); console.error(`delSimMessage failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -739,6 +776,8 @@ updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void\ ...@@ -739,6 +776,8 @@ updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void\
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -758,8 +797,8 @@ let updateSimMessageOptions = { ...@@ -758,8 +797,8 @@ let updateSimMessageOptions = {
pdu: "xxxxxxx", pdu: "xxxxxxx",
smsc: "test" smsc: "test"
}; };
sms.updateSimMessage(updateSimMessageOptions, (err, data) => { sms.updateSimMessage(updateSimMessageOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -790,6 +829,8 @@ updateSimMessage(options: UpdateSimMessageOptions): Promise<void\> ...@@ -790,6 +829,8 @@ updateSimMessage(options: UpdateSimMessageOptions): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -810,9 +851,9 @@ let updateSimMessageOptions = { ...@@ -810,9 +851,9 @@ let updateSimMessageOptions = {
smsc: "test" smsc: "test"
}; };
let promise = sms.updateSimMessage(updateSimMessageOptions); let promise = sms.updateSimMessage(updateSimMessageOptions);
promise.then(data => { promise.then(() => {
console.log(`updateSimMessage success, promise: data->${JSON.stringify(data)}`); console.log(`updateSimMessage success.`);
}).catch(err => { }).catch((err) => {
console.error(`updateSimMessage failed, promise: err->${JSON.stringify(err)}`); console.error(`updateSimMessage failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -838,6 +879,8 @@ getAllSimMessages(slotId: number, callback: AsyncCallback<Array<SimShortMessage\ ...@@ -838,6 +879,8 @@ getAllSimMessages(slotId: number, callback: AsyncCallback<Array<SimShortMessage\
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -883,6 +926,8 @@ getAllSimMessages(slotId: number): Promise<Array<SimShortMessage\>> ...@@ -883,6 +926,8 @@ getAllSimMessages(slotId: number): Promise<Array<SimShortMessage\>>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -925,6 +970,8 @@ setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void\>): void ...@@ -925,6 +970,8 @@ setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -944,8 +991,8 @@ let cbConfigOptions = { ...@@ -944,8 +991,8 @@ let cbConfigOptions = {
endMessageId: 200, endMessageId: 200,
ranType: sms.RanType.TYPE_GSM ranType: sms.RanType.TYPE_GSM
}; };
sms.setCBConfig(cbConfigOptions, (err, data) => { sms.setCBConfig(cbConfigOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -976,6 +1023,8 @@ setCBConfig(options: CBConfigOptions): Promise<void\> ...@@ -976,6 +1023,8 @@ setCBConfig(options: CBConfigOptions): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -996,9 +1045,9 @@ let cbConfigOptions = { ...@@ -996,9 +1045,9 @@ let cbConfigOptions = {
ranType: sms.RanType.TYPE_GSM ranType: sms.RanType.TYPE_GSM
}; };
let promise = sms.setCBConfig(cbConfigOptions); let promise = sms.setCBConfig(cbConfigOptions);
promise.then(data => { promise.then(() => {
console.log(`setCBConfig success, promise: data->${JSON.stringify(data)}`); console.log(`setCBConfig success.`);
}).catch(err => { }).catch((err) => {
console.error(`setCBConfig failed, promise: err->${JSON.stringify(err)}`); console.error(`setCBConfig failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1024,6 +1073,8 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback ...@@ -1024,6 +1073,8 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1068,6 +1119,8 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise ...@@ -1068,6 +1119,8 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1107,6 +1160,8 @@ isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean\>): void ...@@ -1107,6 +1160,8 @@ isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1149,6 +1204,8 @@ isImsSmsSupported(slotId: number): Promise<boolean\> ...@@ -1149,6 +1204,8 @@ isImsSmsSupported(slotId: number): Promise<boolean\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1187,9 +1244,10 @@ getImsShortMessageFormat(callback: AsyncCallback<string\>): void ...@@ -1187,9 +1244,10 @@ getImsShortMessageFormat(callback: AsyncCallback<string\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. | | 401 | Parameter error. |
| 8300001 | Invalid parameter value. | | 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. | | 8300002 | Operation failed. Cannot connect to service. |
...@@ -1223,9 +1281,10 @@ getImsShortMessageFormat(): Promise<string\> ...@@ -1223,9 +1281,10 @@ getImsShortMessageFormat(): Promise<string\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. | | 401 | Parameter error. |
| 8300001 | Invalid parameter value. | | 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. | | 8300002 | Operation failed. Cannot connect to service. |
...@@ -1262,6 +1321,8 @@ decodeMms(mmsFilePathName: string | Array<number\>, callback: AsyncCallback<MmsI ...@@ -1262,6 +1321,8 @@ decodeMms(mmsFilePathName: string | Array<number\>, callback: AsyncCallback<MmsI
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1304,6 +1365,8 @@ decodeMms(mmsFilePathName: string | Array<number\>): Promise<MmsInformation\> ...@@ -1304,6 +1365,8 @@ decodeMms(mmsFilePathName: string | Array<number\>): Promise<MmsInformation\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1343,6 +1406,8 @@ encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number\>>): void ...@@ -1343,6 +1406,8 @@ encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number\>>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
...@@ -1393,6 +1458,8 @@ encodeMms(mms: MmsInformation): Promise<Array<number\>> ...@@ -1393,6 +1458,8 @@ encodeMms(mms: MmsInformation): Promise<Array<number\>>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 401 | Parameter error. | | 401 | Parameter error. |
......
...@@ -100,6 +100,8 @@ setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback\<void\>): v ...@@ -100,6 +100,8 @@ setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback\<void\>): v
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -114,8 +116,8 @@ setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback\<void\>): v ...@@ -114,8 +116,8 @@ setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback\<void\>): v
**示例:** **示例:**
```js ```js
data.setDefaultCellularDataSlotId(0, (err, data) => { data.setDefaultCellularDataSlotId(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}.`);
}); });
``` ```
...@@ -145,6 +147,8 @@ setDefaultCellularDataSlotId(slotId: number): Promise\<void\> ...@@ -145,6 +147,8 @@ setDefaultCellularDataSlotId(slotId: number): Promise\<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -160,8 +164,8 @@ setDefaultCellularDataSlotId(slotId: number): Promise\<void\> ...@@ -160,8 +164,8 @@ setDefaultCellularDataSlotId(slotId: number): Promise\<void\>
```js ```js
let promise = data.setDefaultCellularDataSlotId(0); let promise = data.setDefaultCellularDataSlotId(0);
promise.then((data) => { promise.then(() => {
console.log(`setDefaultCellularDataSlotId success, promise: data->${JSON.stringify(data)}`); console.log(`setDefaultCellularDataSlotId success.`);
}).catch((err) => { }).catch((err) => {
console.error(`setDefaultCellularDataSlotId fail, promise: err->${JSON.stringify(err)}`); console.error(`setDefaultCellularDataSlotId fail, promise: err->${JSON.stringify(err)}`);
}); });
...@@ -279,6 +283,8 @@ isCellularDataEnabled(callback: AsyncCallback\<boolean\>): void ...@@ -279,6 +283,8 @@ isCellularDataEnabled(callback: AsyncCallback\<boolean\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -314,6 +320,8 @@ isCellularDataEnabled(): Promise\<boolean\> ...@@ -314,6 +320,8 @@ isCellularDataEnabled(): Promise\<boolean\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -353,6 +361,8 @@ isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback\<boolean\>) ...@@ -353,6 +361,8 @@ isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback\<boolean\>)
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -394,6 +404,8 @@ isCellularDataRoamingEnabled(slotId: number): Promise\<boolean\> ...@@ -394,6 +404,8 @@ isCellularDataRoamingEnabled(slotId: number): Promise\<boolean\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -434,6 +446,8 @@ enableCellularData(callback: AsyncCallback<void\>): void ...@@ -434,6 +446,8 @@ enableCellularData(callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -446,8 +460,8 @@ enableCellularData(callback: AsyncCallback<void\>): void ...@@ -446,8 +460,8 @@ enableCellularData(callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
data.enableCellularData((err, data) => { data.enableCellularData((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -471,6 +485,8 @@ enableCellularData(): Promise<void\> ...@@ -471,6 +485,8 @@ enableCellularData(): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -484,8 +500,8 @@ enableCellularData(): Promise<void\> ...@@ -484,8 +500,8 @@ enableCellularData(): Promise<void\>
```js ```js
let promise = data.enableCellularData(); let promise = data.enableCellularData();
promise.then((data) => { promise.then(() => {
console.log(`enableCellularData success, promise: data->${JSON.stringify(data)}`); console.log(`enableCellularData success.`);
}).catch((err) => { }).catch((err) => {
console.error(`enableCellularData fail, promise: err->${JSON.stringify(err)}`); console.error(`enableCellularData fail, promise: err->${JSON.stringify(err)}`);
}); });
...@@ -511,6 +527,8 @@ disableCellularData(callback: AsyncCallback<void\>): void ...@@ -511,6 +527,8 @@ disableCellularData(callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -523,8 +541,8 @@ disableCellularData(callback: AsyncCallback<void\>): void ...@@ -523,8 +541,8 @@ disableCellularData(callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
data.disableCellularData((err, data) => { data.disableCellularData((err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -548,6 +566,8 @@ disableCellularData(): Promise<void\> ...@@ -548,6 +566,8 @@ disableCellularData(): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -561,8 +581,8 @@ disableCellularData(): Promise<void\> ...@@ -561,8 +581,8 @@ disableCellularData(): Promise<void\>
```js ```js
let promise = data.disableCellularData(); let promise = data.disableCellularData();
promise.then((data) => { promise.then(() => {
console.log(`disableCellularData success, promise: data->${JSON.stringify(data)}`); console.log(`disableCellularData success.`);
}).catch((err) => { }).catch((err) => {
console.error(`disableCellularData fail, promise: err->${JSON.stringify(err)}`); console.error(`disableCellularData fail, promise: err->${JSON.stringify(err)}`);
}); });
...@@ -589,6 +609,8 @@ enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void ...@@ -589,6 +609,8 @@ enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -601,8 +623,8 @@ enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void ...@@ -601,8 +623,8 @@ enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
data.enableCellularDataRoaming(0, (err, data) => { data.enableCellularDataRoaming(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -632,6 +654,8 @@ enableCellularDataRoaming(slotId: number): Promise<void\> ...@@ -632,6 +654,8 @@ enableCellularDataRoaming(slotId: number): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -645,8 +669,8 @@ enableCellularDataRoaming(slotId: number): Promise<void\> ...@@ -645,8 +669,8 @@ enableCellularDataRoaming(slotId: number): Promise<void\>
```js ```js
let promise = data.enableCellularDataRoaming(0); let promise = data.enableCellularDataRoaming(0);
promise.then((data) => { promise.then(() => {
console.log(`enableCellularDataRoaming success, promise: data->${JSON.stringify(data)}`); console.log(`enableCellularDataRoaming success.`);
}).catch((err) => { }).catch((err) => {
console.error(`enableCellularDataRoaming fail, promise: err->${JSON.stringify(err)}`); console.error(`enableCellularDataRoaming fail, promise: err->${JSON.stringify(err)}`);
}); });
...@@ -673,6 +697,8 @@ disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void ...@@ -673,6 +697,8 @@ disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -685,8 +711,8 @@ disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void ...@@ -685,8 +711,8 @@ disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
data.disableCellularDataRoaming(0, (err, data) => { data.disableCellularDataRoaming(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -716,6 +742,8 @@ disableCellularDataRoaming(slotId: number): Promise<void\> ...@@ -716,6 +742,8 @@ disableCellularDataRoaming(slotId: number): Promise<void\>
**错误码:** **错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| -------- | -------------------------------------------- | | -------- | -------------------------------------------- |
| 201 | Permission denied. | | 201 | Permission denied. |
...@@ -729,8 +757,8 @@ disableCellularDataRoaming(slotId: number): Promise<void\> ...@@ -729,8 +757,8 @@ disableCellularDataRoaming(slotId: number): Promise<void\>
```js ```js
let promise = data.disableCellularDataRoaming(0); let promise = data.disableCellularDataRoaming(0);
promise.then((data) => { promise.then(() => {
console.log(`disableCellularDataRoaming success, promise: data->${JSON.stringify(data)}`); console.log(`disableCellularDataRoaming success.`);
}).catch((err) => { }).catch((err) => {
console.error(`disableCellularDataRoaming fail, promise: err->${JSON.stringify(err)}`); console.error(`disableCellularDataRoaming fail, promise: err->${JSON.stringify(err)}`);
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册