提交 74125b5e 编写于 作者: D dingxiaochen

fix docs.

Signed-off-by: Ndingxiaochen <dingxiaochen@huawei.com>
上级 16fab2c2
......@@ -133,11 +133,12 @@ dialCall\(phoneNumber: string, callback: AsyncCallback<void\>\): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | ---------------------------- | ---- | --------------------------------------- |
| ----------- | ---------------------------- | ---- | -------------------------------------- |
| phoneNumber | string | 是 | 电话号码。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 以callback形式异步返回拨打电话的结果。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 以callback形式异步返回拨打电话的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -152,8 +153,8 @@ dialCall\(phoneNumber: string, callback: AsyncCallback<void\>\): void
**示例:**
```js
call.dialCall("138xxxxxxxx", (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.dialCall("138xxxxxxxx", (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -173,12 +174,13 @@ dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | ----------------------------------- | ---- | ------------------------------------ |
| ----------- | ----------------------------------- | ---- | ----------------------------------- |
| phoneNumber | string | 是 | 电话号码。 |
| options | [DialCallOptions](#dialcalloptions9)| 是 | 通话参数,携带呼叫的其他配置信息。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 以callback形式异步返回拨打电话的结果 |
| callback | AsyncCallback&lt;void&gt; | 是 | 以callback形式异步返回拨打电话的结果|
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -198,8 +200,8 @@ call.dialCall("138xxxxxxxx", {
videoState: 0,
dialScene: 0,
dialType: 0,
}, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -218,18 +220,19 @@ dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise<void\>
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | ----------------------------------- | ---- |-------------------|
| phoneNumber | string | 是 | 电话号码。 |
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | ----------------------------------- | ---- | -------------------------------------- |
| phoneNumber | string | 是 | 电话号码。 |
| options | [DialCallOptions](#dialcalloptions9)| 否 | 通话参数,携带呼叫的其他配置信息。 |
**返回值:**
| 类型 | 说明 |
| ---------------------- | ------------------------------------------------------------ |
| Promise&lt;void&gt; | 以Promise形式返回拨打电话的结果。 |
| 类型 | 说明 |
| ---------------------- | ---------------------------- |
| Promise&lt;void&gt; | 以Promise形式异步返回拨号结果。|
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -245,20 +248,15 @@ dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise<void\>
```js
let promise = call.dialCall("138xxxxxxxx", {
call.dialCall('138xxxxxxxx');
accountId: 0,
videoState: 0,
dialScene: 0,
dialType: 0,
});
promise.then(data => {
console.log(`dialCall success, promise: data->${JSON.stringify(data)}`);
console.log(`dialCall success, promise: data->${JSON.stringify(data)}`);
} catch (error) {
}).catch(err => {
console.log(`dialCall fail, promise: err->${JSON.stringify(error)}`);
promise.then(() => {
console.log(`dialCall success.`);
}).catch((err) => {
console.error(`dialCall fail, promise: err->${JSON.stringify(err)}`);
}
});
```
......@@ -279,6 +277,7 @@ makeCall(phoneNumber: string, callback: AsyncCallback\<void\>): void
| callback | AsyncCallback&lt;void&gt; | 是 | 以callback形式异步返回跳转拨号界面的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -319,6 +318,7 @@ makeCall(phoneNumber: string): Promise\<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回拨号的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -472,6 +472,7 @@ isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback<boolean\>\)
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调函数。返回true表示是紧急电话号码,返回false表示不是紧急电话号码。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -508,6 +509,7 @@ isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, ca
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调函数。返回true表示是紧急电话号码,返回false表示不是紧急电话号码。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -549,6 +551,7 @@ isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\):
| Promise&lt;boolean&gt; | 以Promise形式异步返回判断是否是紧急电话号码的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -588,6 +591,7 @@ formatPhoneNumber\(phoneNumber: string, callback: AsyncCallback<string\>\): void
| callback | AsyncCallback&lt;string&gt; | 是 | 回调函数,返回格式化电话号码的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -625,6 +629,7 @@ formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback:
| callback | AsyncCallback&lt;string&gt; | 是 | 回调函数,返回格式化电话号码的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -670,6 +675,7 @@ formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise
| Promise&lt;string&gt; | 以Promise形式异步返回格式化电话号码的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -712,6 +718,7 @@ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: Asy
| callback | AsyncCallback&lt;string&gt; | 是 | 回调函数,返回将电话号码格式化为E.164表示形式的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -757,6 +764,7 @@ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise<str
| Promise&lt;string&gt; | 以Promise形式异步返回将电话号码格式化为E.164表示形式的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -797,10 +805,12 @@ muteRinger\(callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[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. |
......@@ -810,8 +820,8 @@ muteRinger\(callback: AsyncCallback<void\>\): void
**示例:**
```js
call.muteRinger((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.muteRinger((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -835,13 +845,12 @@ muteRinger\(\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[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. |
......@@ -849,10 +858,9 @@ muteRinger\(\): Promise<void\>
**示例:**
```js
let promise = call.muteRinger();
promise.then(data => {
console.log(`muteRinger success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.muteRinger().then(() => {
console.log(`muteRinger success.`);
}).catch((err) => {
console.error(`muteRinger fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -878,6 +886,7 @@ answerCall\(callId: number, callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -892,8 +901,8 @@ answerCall\(callId: number, callback: AsyncCallback<void\>\): void
**示例:**
```js
call.answerCall(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.answerCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -923,6 +932,7 @@ answerCall(callId?: number\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -937,10 +947,9 @@ answerCall(callId?: number\): Promise<void\>
**示例:**
```js
let promise = call.answerCall(1);
promise.then(data => {
console.log(`answerCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.answerCall(1).then(() => {
console.log(`answerCall success.`);
}).catch((err) => {
console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -965,6 +974,7 @@ answerCall\(callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -979,8 +989,8 @@ answerCall\(callback: AsyncCallback<void\>\): void
**示例:**
```js
call.answerCall((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.answerCall((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1005,6 +1015,7 @@ hangUpCall\(callId: number, callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1019,8 +1030,8 @@ hangUpCall\(callId: number, callback: AsyncCallback<void\>\): void
**示例:**
```js
call.hangUpCall(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.hangUpCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1050,6 +1061,7 @@ hangUpCall\(callId?: number\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1064,10 +1076,9 @@ hangUpCall\(callId?: number\): Promise<void\>
**示例:**
```js
let promise = call.hangUpCall(1);
promise.then(data => {
console.log(`hangUpCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.hangUpCall(1).then(() => {
console.log(`hangUpCall success.`);
}).catch((err) => {
console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1092,6 +1103,7 @@ hangUpCall\(callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1107,13 +1119,13 @@ hangUpCall\(callback: AsyncCallback<void\>\): void
**示例:**
```js
call.hangUpCall((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.hangUpCall((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
## call.rejectCall<sup>7+</sup>
## call.rejectCall<sup>9+</sup>
rejectCall(callId: number, callback: AsyncCallback\<void>): void
......@@ -1133,6 +1145,7 @@ rejectCall(callId: number, callback: AsyncCallback\<void>): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1148,8 +1161,8 @@ rejectCall(callId: number, callback: AsyncCallback\<void>): void
**示例:**
```js
call.rejectCall(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.rejectCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1175,6 +1188,7 @@ rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallba
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1192,8 +1206,8 @@ rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallba
let rejectMessageOptions={
messageContent: "拦截陌生号码"
}
call.rejectCall(1, rejectMessageOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.rejectCall(1, rejectMessageOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1224,6 +1238,7 @@ rejectCall(callId?: number, options?: RejectMessageOptions\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1241,11 +1256,10 @@ rejectCall(callId?: number, options?: RejectMessageOptions\): Promise<void\>
let rejectMessageOptions={
messageContent: "拦截陌生号码"
}
let promise = call.rejectCall(1, rejectMessageOptions);
promise.then(data => {
console.log(`rejectCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`);
call.reject(1, rejectMessageOptions).then(() => {
console.log(`reject success.`);
}).catch((err) => {
console.error(`reject fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1269,6 +1283,7 @@ rejectCall\(callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1283,8 +1298,8 @@ rejectCall\(callback: AsyncCallback<void\>\): void
**示例:**
```js
call.rejectCall((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.rejectCall((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1309,6 +1324,7 @@ rejectCall\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): voi
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1326,8 +1342,8 @@ rejectCall\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): voi
let rejectMessageOptions={
messageContent: "拦截陌生号码"
}
call.rejectCall(rejectMessageOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.rejectCall(rejectMessageOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1352,6 +1368,7 @@ holdCall\(callId: number, callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1366,8 +1383,8 @@ holdCall\(callId: number, callback: AsyncCallback<void\>\): void
**示例:**
```js
call.holdCall(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.holdCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1397,6 +1414,7 @@ holdCall\(callId: number\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1411,10 +1429,9 @@ holdCall\(callId: number\): Promise<void\>
**示例:**
```js
let promise = call.holdCall(1);
promise.then(data => {
console.log(`holdCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.holdCall(1).then(() => {
console.log(`holdCall success.`);
}).catch((err) => {
console.error(`holdCall fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1439,6 +1456,7 @@ unHoldCall\(callId: number, callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1453,8 +1471,8 @@ unHoldCall\(callId: number, callback: AsyncCallback<void\>\): void
**示例:**
```js
call.unHoldCall(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.unHoldCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1484,6 +1502,7 @@ unHoldCall\(callId: number\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1498,10 +1517,9 @@ unHoldCall\(callId: number\): Promise<void\>
**示例:**
```js
let promise = call.unHoldCall(1);
promise.then(data => {
console.log(`unHoldCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.unHoldCall(1).then(() => {
console.log(`unHoldCall success.`);
}).catch((err) => {
console.error(`unHoldCall fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1526,6 +1544,7 @@ switchCall\(callId: number, callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1540,8 +1559,8 @@ switchCall\(callId: number, callback: AsyncCallback<void\>\): void
**示例:**
```js
call.switchCall(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.switchCall(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1571,6 +1590,7 @@ switchCall\(callId: number\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1585,10 +1605,9 @@ switchCall\(callId: number\): Promise<void\>
**示例:**
```js
let promise = call.switchCall(1);
promise.then(data => {
console.log(`switchCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.switchCall(1).then(() => {
console.log(`switchCall success.`);
}).catch((err) => {
console.error(`switchCall fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1611,6 +1630,7 @@ combineConference\(callId: number, callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1624,8 +1644,8 @@ combineConference\(callId: number, callback: AsyncCallback<void\>\): void
**示例:**
```js
call.combineConference(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.combineConference(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1653,6 +1673,7 @@ combineConference\(callId: number\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1666,10 +1687,9 @@ combineConference\(callId: number\): Promise<void\>
**示例:**
```js
let promise = call.combineConference(1);
promise.then(data => {
console.log(`combineConference success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.combineConference(1).then(() => {
console.log(`combineConference success.`);
}).catch((err) => {
console.error(`combineConference fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1692,6 +1712,7 @@ getMainCallId\(callId: number, callback: AsyncCallback<number\>\): void
| callback | AsyncCallback&lt;number&gt; | 是 | 回调函数。返回主呼叫Id。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1735,6 +1756,7 @@ getMainCallId\(callId: number\): Promise<number\>
| Promise&lt;void&gt; | 以Promise形式异步返回主呼叫Id。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1774,6 +1796,7 @@ getSubCallIdList\(callId: number, callback: AsyncCallback<Array<string\>\>\): vo
| callback | AsyncCallback<Array<string\>\> | 是 | 回调函数。返回子呼叫Id列表。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1816,6 +1839,7 @@ getSubCallIdList\(callId: number\): Promise<Array<string\>\>
| Promise&lt;Array<string\>&gt; | 以Promise形式异步返回子呼叫Id列表。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1855,6 +1879,7 @@ getCallIdListForConference\(callId: number, callback: AsyncCallback<Array<string
| callback | AsyncCallback&lt;Array<string\>&gt; | 是 | 回调函数。返回会议的呼叫Id列表。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1897,6 +1922,7 @@ getCallIdListForConference\(callId: number\): Promise<Array<string\>\>
| Promise&lt;Array<string\>&gt; | 以Promise形式异步返回会议的呼叫Id列表。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1938,6 +1964,7 @@ getCallWaitingStatus\(slotId: number, callback: AsyncCallback<CallWaitingStatus\
| callback | AsyncCallback&lt;[CallWaitingStatus](#callwaitingstatus7)\> | 是 | 回调函数。<br/>返回呼叫等待状态。<br/>- 0:禁用呼叫等待 <br/>- 1:启用呼叫等待 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1983,6 +2010,7 @@ getCallWaitingStatus\(slotId: number\): Promise<CallWaitingStatus\>
| Promise&lt;[CallWaitingStatus](#callwaitingstatus7)&gt; | 以Promise形式异步返回呼叫等待状态。<br/>- 0:禁用呼叫等待 <br/>- 1:启用呼叫等待 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2026,6 +2054,7 @@ setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback<void\
| callback | AsyncCallback<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2040,8 +2069,8 @@ setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback<void\
**示例:**
```js
call.setCallWaiting(0, true, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.setCallWaiting(0, true, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -2072,6 +2101,7 @@ setCallWaiting\(slotId: number, activate: boolean\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2086,10 +2116,9 @@ setCallWaiting\(slotId: number, activate: boolean\): Promise<void\>
**示例:**
```js
let promise = call.setCallWaiting(0, true);
promise.then(data => {
console.log(`setCallWaiting success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.setCallWaiting(0, true).then(() => {
console.log(`setCallWaiting success.`);
}).catch((err) => {
console.error(`setCallWaiting fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -2113,6 +2142,7 @@ startDTMF\(callId: number, character: string, callback: AsyncCallback<void\>\):
| callback | AsyncCallback<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2126,8 +2156,8 @@ startDTMF\(callId: number, character: string, callback: AsyncCallback<void\>\):
**示例:**
```js
call.startDTMF(1, "0", (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.startDTMF(1, "0", (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -2156,6 +2186,7 @@ startDTMF\(callId: number, character: string\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2169,10 +2200,9 @@ startDTMF\(callId: number, character: string\): Promise<void\>
**示例:**
```js
let promise = call.startDTMF(1, "0");
promise.then(data => {
console.log(`startDTMF success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.startDTMF(1, "0").then(() => {
console.log(`startDTMF success.`);
}).catch((err) => {
console.error(`startDTMF fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -2195,6 +2225,7 @@ stopDTMF\(callId: number, callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2208,8 +2239,8 @@ stopDTMF\(callId: number, callback: AsyncCallback<void\>\): void
**示例:**
```js
call.stopDTMF(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.stopDTMF(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -2237,6 +2268,7 @@ stopDTMF\(callId: number\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2250,10 +2282,9 @@ stopDTMF\(callId: number\): Promise<void\>
**示例:**
```js
let promise = call.stopDTMF(1);
promise.then(data => {
console.log(`stopDTMF success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.stopDTMF(1).then(() => {
console.log(`stopDTMF success.`);
}).catch((err) => {
console.error(`stopDTMF fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -2277,6 +2308,7 @@ isInEmergencyCall\(callback: AsyncCallback<boolean\>\): void
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2316,6 +2348,7 @@ isInEmergencyCall\(\): Promise<boolean\>
| Promise&lt;boolean&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2354,10 +2387,11 @@ on\(type: 'callDetailsChange', callback: Callback<CallAttributeOptions\>\): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------- | ---- | -------------------------- |
| type | string | 是 | 通话时监听通话详情的变化。 |
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | 是 | 回调函数。 |
| type | string | 是 | 通话时监听通话详情的变化,参数固定为'callDetailsChange'。 |
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2393,10 +2427,11 @@ on\(type: 'callEventChange', callback: Callback<CallEventOptions\>\): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------ | ---- | -------------------------- |
| type | string | 是 | 通话时监听通话事件的变化。 |
| type | string | 是 | 通话时监听通话事件的变化,参数固定为'callEventChange'。 |
| callback | Callback<[CallEventOptions](#calleventoptions8)> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2432,10 +2467,11 @@ on\(type: 'callDisconnectedCause', callback: Callback<DisconnectedDetails\>): vo
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------ | ---- | -------------------------- |
| type | string | 是 | 通话时监听断开连接的原因。 |
| type | string | 是 | 通话时监听断开连接的原因,参数固定为'callDisconnectedCause'。 |
| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2471,10 +2507,11 @@ on\(type: 'mmiCodeResult', callback: Callback<MmiCodeResults\>\): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------------------------------- | ---- | --------------------- |
| type | string | 是 | 通话时监听MMI码结果。 |
| type | string | 是 | 通话时监听MMI码结果,参数固定为'mmiCodeResult'。 |
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2510,10 +2547,11 @@ off\(type: 'callDetailsChange', callback?: Callback<CallAttributeOptions\>\): vo
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------------------------------------------- | ---- | ---------------------------------- |
| type | string | 是 | 通话结束时取消监听通话详情的变化。 |
| type | string | 是 | 通话结束时取消监听通话详情的变化,参数固定为'callDetailsChange'。 |
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | 否 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2549,10 +2587,11 @@ off\(type: 'callEventChange', callback?: Callback<CallEventOptions\>\): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------ | ---- | ---------------------------------- |
| type | string | 是 | 通话结束时取消监听通话事件的变化。 |
| type | string | 是 | 通话结束时取消监听通话事件的变化,参数固定为'callEventChange'。 |
| callback | Callback<[CallEventOptions](#calleventoptions8)> | 否 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2587,11 +2626,12 @@ off\(type: 'callDisconnectedCause', callback?: Callback<DisconnectedDetails\>\):
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------------------------- | ---- | -------------------- |
| type | 'callDisconnectedCause' | 是 | 调用断开连接的原因。 |
| callback | Callback**<**[DisconnectedDetails](#disconnecteddetails9)> | 否 | 回调函数。 |
| -------- | ---------------------------------------------------------- | ---- | ------------------- |
| type | string | 是 | 调用断开连接的原因,参数固定为'callDisconnectedCause'。 |
| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | 否 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2625,12 +2665,13 @@ off\(type: 'mmiCodeResult', callback?: Callback<MmiCodeResults\>\): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------ | ---- | ----------- |
| type | 'mmiCodeResult' | 是 | MMI码结果。 |
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | 否 | 回调函数。 |
| type | string | 是 | MMI码结果,参数固定为'mmiCodeResult'。 |
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | 否 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2667,6 +2708,7 @@ isNewCallAllowed\(callback: AsyncCallback<boolean\>\): void
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2703,6 +2745,7 @@ isNewCallAllowed\(\): Promise<boolean\>
| Promise&lt;boolean&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2742,6 +2785,7 @@ separateConference\(callId: number, callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2755,8 +2799,8 @@ separateConference\(callId: number, callback: AsyncCallback<void\>\): void
**示例:**
```js
call.separateConference(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.separateConference(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -2784,6 +2828,7 @@ separateConference\(callId: number\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2797,10 +2842,9 @@ separateConference\(callId: number\): Promise<void\>
**示例:**
```js
let promise = call.separateConference(1);
promise.then(data => {
console.log(`separateConference success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.separateConference(1).then(() => {
console.log(`separateConference success.`);
}).catch((err) => {
console.error(`separateConference fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -2826,6 +2870,7 @@ getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: A
| callback | AsyncCallback&lt;[RestrictionStatus](#restrictionstatus8)&gt; | 是 | 回调函数。返回限制状态。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2872,6 +2917,7 @@ getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise<R
| Promise&lt;[RestrictionStatus](#restrictionstatus8)&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2915,6 +2961,7 @@ setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCa
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2934,8 +2981,8 @@ let callRestrictionInfo={
password: "123456",
mode: 1
}
call.setCallRestriction(0, callRestrictionInfo, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.setCallRestriction(0, callRestrictionInfo, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -2966,6 +3013,7 @@ setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2985,10 +3033,9 @@ let callRestrictionInfo={
password: "123456",
mode: 1
}
let promise = call.setCallRestriction(0, callRestrictionInfo);
promise.then(data => {
console.log(`setCallRestriction success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.setCallRestriction(0, callRestrictionInfo).then(() => {
console.log(`setCallRestriction success.`);
}).catch((err) => {
console.error(`setCallRestriction fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3014,6 +3061,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCall
| callback | AsyncCallback&lt;[CallTransferResult](#calltransferresult8)&gt; | 是 | 回调函数。返回呼叫转移信息。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3060,6 +3108,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType): Promise<CallTransf
| Promise&lt;[CallTransferResult](#calltransferresult8)&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3103,6 +3152,7 @@ setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3122,8 +3172,8 @@ let callTransferInfo={
type: 1,
settingType: 1
}
call.setCallTransfer(0, callTransferInfo, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.setCallTransfer(0, callTransferInfo, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3154,6 +3204,7 @@ setCallTransfer\(slotId: number, info: CallTransferInfo): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3173,10 +3224,9 @@ let callTransferInfo={
type: 1,
settingType: 1
}
let promise = call.setCallTransfer(0, callTransferInfo);
promise.then(data => {
console.log(`setCallTransfer success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.setCallTransfer(0, callTransferInfo).then(() => {
console.log(`setCallTransfer success.`);
}).catch((err) => {
console.error(`setCallTransfer fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3200,6 +3250,7 @@ isRinging\(callback: AsyncCallback<boolean\>\): void
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3239,6 +3290,7 @@ isRinging\(\): Promise<boolean\>
| Promise&lt;boolean&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3278,6 +3330,7 @@ setMuted\(callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3291,8 +3344,8 @@ setMuted\(callback: AsyncCallback<void\>\): void
**示例:**
```js
call.setMuted((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.setMuted((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3314,6 +3367,7 @@ setMuted\(\): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3327,10 +3381,9 @@ setMuted\(\): Promise<void\>
**示例:**
```js
let promise = call.setMuted();
promise.then(data => {
console.log(`setMuted success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.setMuted().then(() => {
console.log(`setMuted success.`);
}).catch((err) => {
console.error(`setMuted fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3352,6 +3405,7 @@ cancelMuted(callback: AsyncCallback<void\>): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3365,8 +3419,8 @@ cancelMuted(callback: AsyncCallback<void\>): void
**示例:**
```js
call.cancelMuted((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.cancelMuted((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3388,6 +3442,7 @@ cancelMuted(): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3401,10 +3456,9 @@ cancelMuted(): Promise<void\>
**示例:**
```js
let promise = call.cancelMuted();
promise.then(data => {
console.log(`cancelMuted success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.cancelMuted().then(() => {
console.log(`cancelMuted success.`);
}).catch((err) => {
console.error(`cancelMuted fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3427,6 +3481,7 @@ setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3440,8 +3495,8 @@ setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void
**示例:**
```js
call.setAudioDevice(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.setAudioDevice(1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3465,6 +3520,7 @@ setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: Asyn
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3481,8 +3537,8 @@ setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: Asyn
let audioDeviceOptions={
bluetoothAddress: "IEEE 802-2014"
}
call.setAudioDevice(1, audioDeviceOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.setAudioDevice(1, audioDeviceOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3511,6 +3567,7 @@ setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise<void\
| Promise&lt;void&gt; | 以Promise形式异步返回设置结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3527,10 +3584,9 @@ setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise<void\
let audioDeviceOptions={
bluetoothAddress: "IEEE 802-2014"
}
let promise = call.setAudioDevice(1, audioDeviceOptions);
promise.then(data => {
console.log(`setAudioDevice success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.setAudioDevice(1, audioDeviceOptions).then(() => {
console.log(`setAudioDevice success.`);
}).catch((err) => {
console.error(`setAudioDevice fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3554,6 +3610,7 @@ joinConference(mainCallId: number, callNumberList: Array<string\>, callback: Asy
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3570,8 +3627,8 @@ joinConference(mainCallId: number, callNumberList: Array<string\>, callback: Asy
let callNumberList: Array<string> = [
"138XXXXXXXX"
];
call.joinConference(1, callNumberList, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.joinConference(1, callNumberList, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3599,6 +3656,7 @@ joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3615,10 +3673,9 @@ joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void
let callNumberList: Array<string> = [
"138XXXXXXXX"
];
let promise = call.joinConference(1, callNumberList);
promise.then(data => {
console.log(`joinConference success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.joinConference(1, callNumberList).then(() => {
console.log(`joinConference success.`);
}).catch((err) => {
console.error(`joinConference fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3642,6 +3699,7 @@ updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback<voi
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3655,8 +3713,8 @@ updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback<voi
**示例:**
```js
call.updateImsCallMode(1, 1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.updateImsCallMode(1, 1, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3684,6 +3742,7 @@ updateImsCallMode(callId: number, mode: ImsCallMode): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3697,10 +3756,9 @@ updateImsCallMode(callId: number, mode: ImsCallMode): Promise<void\>
**示例:**
```js
let promise = call.updateImsCallMode(1, 1);
promise.then(data => {
console.log(`updateImsCallMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.updateImsCallMode(1, 1).then(() => {
console.log(`updateImsCallMode success.`);
}).catch((err) => {
console.error(`updateImsCallMode fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3725,6 +3783,7 @@ enableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3739,8 +3798,8 @@ enableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void
**示例:**
```js
call.enableImsSwitch(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.enableImsSwitch(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3769,6 +3828,7 @@ enableImsSwitch(slotId: number): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3783,10 +3843,9 @@ enableImsSwitch(slotId: number): Promise<void\>
**示例:**
```js
let promise = call.enableImsSwitch(0);
promise.then(data => {
console.log(`enableImsSwitch success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.enableImsSwitch(0).then(() => {
console.log(`enableImsSwitch success.`);
}).catch((err) => {
console.error(`enableImsSwitch fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3811,6 +3870,7 @@ disableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3825,8 +3885,8 @@ disableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void
**示例:**
```js
call.disableImsSwitch(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
call.disableImsSwitch(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3844,20 +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形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
......@@ -3869,10 +3930,9 @@ disableImsSwitch(slotId: number): Promise<void\>
**示例:**
```js
let promise = call.disableImsSwitch(0);
promise.then(data => {
console.log(`disableImsSwitch success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
call.disableImsSwitch(0).then(() => {
console.log(`disableImsSwitch success.`);
}).catch((err) => {
console.error(`disableImsSwitch fail, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3895,6 +3955,7 @@ isImsSwitchEnabled(slotId: number, callback: AsyncCallback<boolean\>): void
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3936,6 +3997,7 @@ isImsSwitchEnabled(slotId: number): Promise<boolean\>
| Promise&lt;void&gt; | 以Promise形式异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......
......@@ -25,12 +25,13 @@ on\(type: \'networkStateChange\', callback: Callback<NetworkState\>\): void;
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | 是 | 网络状态变化事件 |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | 是 | 回调函数。参考radio的[NetworkState](js-apis-radio.md#networkstate) |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------------------- | ---- | ---------------------------------------------------------------- |
| type | string | 是 | 网络状态变化事件,参数固定为'networkStateChange'。 |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | 是 | 回调函数。参考radio的[NetworkState](js-apis-radio.md#networkstate)|
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -63,13 +64,14 @@ on\(type: \'networkStateChange\', options: { slotId: number }, callback: Callbac
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | -------------------------------------- |
| type | string | 是 | 网络状态变化事件 |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------------------- | ---- | ---------------------------------------------------------------- |
| type | string | 是 | 网络状态变化事件,参数固定为'networkStateChange'。 |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | 是 | 回调函数。参考radio的[NetworkState](js-apis-radio.md#networkstate) |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -106,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) |
| 错误码ID | 错误信息 |
......@@ -140,11 +142,12 @@ 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) |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -175,13 +178,14 @@ on\(type: \'signalInfoChange\', options: { slotId: number }, callback: Callback<
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | -------------------------------------- |
| type | string | 是 | 信号状态变化事件 |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | string | 是 | 信号状态变化事件,参数固定为'signalInfoChange'。 |
| 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) |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -218,10 +222,11 @@ 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) |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -260,7 +265,7 @@ on\(type: \'cellInfoChange\', callback: Callback<CellInformation\>\): void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------------------- | ---- |------------------------------------------------------------|
| type | string | 是 | 小区信息变化事件,固定为'cellInfoChange'。 |
| type | string | 是 | 小区信息变化事件,固定为'cellInfoChange'。 |
| callback | Callback\<[CellInformation](js-apis-radio.md#cellinformation8)\> | 是 | 回调函数。|
**错误码:**
......@@ -375,11 +380,12 @@ 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:电话号码 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -410,12 +416,13 @@ on(type: 'callStateChange', options: { slotId: number }, callback: Callback<{ st
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 通话状态变化事件 |
| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | string | 是 | 通话状态变化事件,参数固定为'callStateChange'。 |
| 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:电话号码 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -450,11 +457,12 @@ 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:电话号码 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -490,10 +498,11 @@ 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)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -525,11 +534,12 @@ on\(type: 'cellularDataConnectionStateChange', options: { slotId: number }, call
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 蜂窝数据链路连接状态事件 |
| type | string | 是 | 蜂窝数据链路连接状态事件,参数固定为'cellularDataConnectionStateChange'。|
| 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)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -565,10 +575,11 @@ 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)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -604,10 +615,11 @@ 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)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -639,11 +651,12 @@ on\(type: 'cellularDataFlowChange', options: { slotId: number }, callback: Call
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 蜂窝数据业务的上下行数据流状态事件 |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| type | string | 是 | 蜂窝数据业务的上下行数据流状态状态事件,参数固定为'cellularDataFlowChange'。 |
| 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)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -677,12 +690,13 @@ 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)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -717,11 +731,12 @@ on\(type: 'simStateChange', callback: Callback\<SimStateData\>\): void;
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | sim状态更改事件 |
| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------------- |
| type | string | 是 | sim状态更改事件,参数固定为'simStateChange'。 |
| callback | Callback\<[SimStateData](#simstatedata7)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -753,11 +768,12 @@ 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 |
| callback | Callback\<[SimStateData](#simstatedata7)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -793,10 +809,11 @@ off\(type: 'simStateChange', callback?: Callback\<SimStateData\>\): void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | sim状态更改事件 |
| type | string | 是 | sim状态更改事件,参数固定为'simStateChange'。 |
| callback | Callback\<[SimStateData](#simstatedata7)\> | 否 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -854,4 +871,3 @@ SIM卡类型和状态。
| type | [CardType](js-apis-sim.md#cardtype7) | 是 | SIM卡类型。 |
| state | [SimState](js-apis-sim.md#simstate) | 是 | SIM卡状态。 |
| reason<sup>8+</sup> | [LockReason](#lockreason8) | 是 | SIM卡锁类型。 |
......@@ -31,6 +31,7 @@ getRadioTech\(slotId: number, callback: AsyncCallback<\{psRadioTech: RadioTechno
| callback | AsyncCallback\<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech:[RadioTechnology](#radiotechnology)}\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -75,6 +76,7 @@ getRadioTech\(slotId: number\): Promise<\{psRadioTech: RadioTechnology, csRadioT
| Promise<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech: [RadioTechnology](#radiotechnology)}> | 以Promise形式返回获取当前接入的CS域和PS域技术。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -116,6 +118,7 @@ getNetworkState\(callback: AsyncCallback<NetworkState\>\): void
| callback | AsyncCallback\<[NetworkState](#networkstate)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -154,6 +157,7 @@ getNetworkState\(slotId: number, callback: AsyncCallback<NetworkState\>\): void
| callback | AsyncCallback\<[NetworkState](#networkstate)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -198,6 +202,7 @@ getNetworkState\(slotId?: number\): Promise<NetworkState\>
| Promise\<[NetworkState](#networkstate)\> | 以Promise形式返回网络状态。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -238,6 +243,7 @@ getNetworkSelectionMode\(slotId: number, callback: AsyncCallback<NetworkSelectio
| callback | AsyncCallback\<[NetworkSelectionMode](#networkselectionmode)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -279,6 +285,7 @@ getNetworkSelectionMode\(slotId: number\): Promise<NetworkSelectionMode\>
| Promise\<[NetworkSelectionMode](#networkselectionmode)\> | 以Promise形式返回当前选网模式。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -318,6 +325,7 @@ getISOCountryCodeForNetwork\(slotId: number, callback: AsyncCallback<string\>\):
| callback | AsyncCallback\<string\> | 是 | 回调函数。返回国家码,例如:CN(中国)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -359,6 +367,7 @@ getISOCountryCodeForNetwork\(slotId: number\): Promise<string\>
| Promise\<string\> | 以Promise形式返回注册网络所在国家的ISO国家码,例如CN(中国)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -397,6 +406,7 @@ getPrimarySlotId\(callback: AsyncCallback\<number\>\): void
| callback | AsyncCallback\<number\> | 是 | 回调函数 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -431,6 +441,7 @@ getPrimarySlotId\(\): Promise\<number\>
| Promise\<number\> | 以Promise形式返回获取设备主卡所在卡槽的索引号的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -469,6 +480,7 @@ getSignalInformation\(slotId: number, callback: AsyncCallback<Array<SignalInform
| callback | AsyncCallback\<Array\<[SignalInformation](#signalinformation)\>\> | 是 | 回调函数,返回[SignalInformation](#signalinformation)对象的数组。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -510,6 +522,7 @@ getSignalInformation\(slotId: number\): Promise<Array<SignalInformation\>\>
| Promise\<Array\<[SignalInformation](#signalinformation)\>\> | 以Promise形式返回网络信号强度[SignalInformation](#signalinformation)对象的数组。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -658,6 +671,7 @@ isRadioOn\(callback: AsyncCallback<boolean\>\): void
| callback | AsyncCallback\<boolean\> | 是 | 回调函数。<br/>- true:Radio打开<br/>- false:Radio关闭 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -696,6 +710,7 @@ isRadioOn\(slotId: number, callback: AsyncCallback<boolean\>\): void
| callback | AsyncCallback\<boolean\> | 是 | 回调函数。<br/>- true:Radio打开<br/>- false:Radio关闭 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -740,6 +755,7 @@ isRadioOn\(slotId?: number\): Promise<boolean\>
| Promise\<boolean\> | 以Promise形式返回判断Radio是否打开的结果。<br/>- true:Radio打开<br/>- false:Radio关闭 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -780,6 +796,7 @@ getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void
| callback | AsyncCallback\<string\> | 是 | 回调函数,返回运营商名称,例如:中国移动。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -821,6 +838,7 @@ getOperatorName\(slotId: number\): Promise<string\>
| Promise\<string\> | 以Promise形式返回运营商名称,例如:中国移动。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -863,6 +881,7 @@ setPrimarySlotId(slotId: number, callback: AsyncCallback<void\>): void
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -879,8 +898,8 @@ setPrimarySlotId(slotId: number, callback: AsyncCallback<void\>): void
```js
let slotId = 0;
radio.setPrimarySlotId(slotId, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
radio.setPrimarySlotId(slotId, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -910,6 +929,7 @@ setPrimarySlotId\(slotId: number\): Promise\<void\>
| Promise\<void\> | 以Promise形式异步返回设置结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -927,9 +947,9 @@ setPrimarySlotId\(slotId: number\): Promise\<void\>
```js
let slotId = 0;
let promise = radio.setPrimarySlotId(slotId);
promise.then(data => {
console.log(`setPrimarySlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`setPrimarySlotId success.`);
}).catch((err) => {
console.log(`setPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -953,6 +973,7 @@ getIMEI(callback: AsyncCallback<string\>): void
| callback | AsyncCallback\<string\> | 是 | 回调函数,如果IMEI不存在,则返回空字符串。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -993,6 +1014,7 @@ getIMEI(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback\<string\> | 是 | 回调函数,如果IMEI不存在,则返回空字符串。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1039,6 +1061,7 @@ getIMEI(slotId?: number): Promise<string\>
| Promise\<string\> | 以Promise形式异步返回IMEI;如果IMEI不存在,则返回空字符串。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1081,6 +1104,7 @@ getMEID(callback: AsyncCallback<string\>): void
| callback | AsyncCallback\<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1121,6 +1145,7 @@ getMEID(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback\<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1167,6 +1192,7 @@ getMEID(slotId?: number): Promise<string\>
| Promise\<string\> | 以Promise形式返回设备的指定卡槽的MEID。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1209,6 +1235,7 @@ getUniqueDeviceId(callback: AsyncCallback<string\>): void
| callback | AsyncCallback\<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1249,6 +1276,7 @@ getUniqueDeviceId(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback\<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1295,6 +1323,7 @@ getUniqueDeviceId(slotId?: number): Promise<string\>
| Promise\<string\> | 以Promise形式返回设备的指定卡槽的唯一设备ID。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1337,6 +1366,7 @@ sendUpdateCellLocationRequest\(callback: AsyncCallback<void\>\): void
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1351,8 +1381,8 @@ sendUpdateCellLocationRequest\(callback: AsyncCallback<void\>\): void
**示例:**
```js
radio.sendUpdateCellLocationRequest((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
radio.sendUpdateCellLocationRequest((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1376,6 +1406,7 @@ sendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback<void\>\):
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1391,8 +1422,8 @@ sendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback<void\>\):
```js
let slotId = 0;
radio.sendUpdateCellLocationRequest(slotId, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
radio.sendUpdateCellLocationRequest(slotId, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1421,6 +1452,7 @@ sendUpdateCellLocationRequest\(slotId?: number): Promise<void\>
| Promise\<void\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1436,10 +1468,9 @@ sendUpdateCellLocationRequest\(slotId?: number): Promise<void\>
```js
let slotId = 0;
let promise = radio.sendUpdateCellLocationRequest(slotId);
promise.then(data => {
console.log(`sendUpdateCellLocationRequest success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
radio.sendUpdateCellLocationRequest(slotId).then(() => {
console.log(`sendUpdateCellLocationRequest success.`);
}).catch((err) => {
console.log(`sendUpdateCellLocationRequest failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1463,6 +1494,7 @@ getCellInformation(callback: AsyncCallback<Array<CellInformation\>>): void
| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1503,6 +1535,7 @@ getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation
| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1549,6 +1582,7 @@ getCellInformation(slotId?: number): Promise<Array<CellInformation\>\>
| Promise\<Array<[CellInformation](#cellinformation8)\>\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1592,6 +1626,7 @@ setNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCa
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1618,8 +1653,8 @@ let networkSelectionModeOptions={
networkInformation: networkInformation,
resumeSelection: true
}
radio.setNetworkSelectionMode(networkSelectionModeOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
radio.setNetworkSelectionMode(networkSelectionModeOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1648,6 +1683,7 @@ setNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise<void\>
| Promise\<void\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1675,9 +1711,9 @@ let networkSelectionModeOptions={
resumeSelection: true
}
let promise = radio.setNetworkSelectionMode(networkSelectionModeOptions);
promise.then(data => {
console.log(`setNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`setNetworkSelectionMode success.`);
}).catch((err) => {
console.log(`setNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1702,6 +1738,7 @@ getNetworkSearchInformation\(slotId: number, callback: AsyncCallback<NetworkSear
| callback | AsyncCallback\<[NetworkSearchResult](#networksearchresult)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1746,6 +1783,7 @@ getNetworkSearchInformation\(slotId: number\): Promise<NetworkSearchResult\>
| Promise\<[NetworkSearchResult](#networksearchresult)\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1785,6 +1823,7 @@ getNrOptionMode(callback: AsyncCallback<NrOptionMode\>): void
| callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1822,6 +1861,7 @@ getNrOptionMode(slotId: number, callback: AsyncCallback<NrOptionMode\>): void
| callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1865,6 +1905,7 @@ getNrOptionMode(slotId?: number): Promise<NrOptionMode\>
| Promise\<[NrOptionMode](#nroptionmode8)\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1906,6 +1947,7 @@ turnOnRadio(callback: AsyncCallback<void\>): void
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1920,8 +1962,8 @@ turnOnRadio(callback: AsyncCallback<void\>): void
**示例:**
```js
radio.turnOnRadio((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
radio.turnOnRadio((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1946,6 +1988,7 @@ turnOnRadio(slotId: number, callback: AsyncCallback<void\>): void
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1961,8 +2004,8 @@ turnOnRadio(slotId: number, callback: AsyncCallback<void\>): void
```js
let slotId = 0;
radio.turnOnRadio(slotId, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
radio.turnOnRadio(slotId, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1992,6 +2035,7 @@ turnOnRadio(slotId?: number): Promise<void\>
| Promise\<void\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2007,10 +2051,9 @@ turnOnRadio(slotId?: number): Promise<void\>
```js
let slotId = 0;
let promise = radio.turnOnRadio(slotId);
promise.then(data => {
console.log(`turnOnRadio success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
radio.turnOnRadio(slotId).then(() => {
console.log(`turnOnRadio success.`);
}).catch((err) => {
console.error(`turnOnRadio failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -2034,6 +2077,7 @@ turnOffRadio(callback: AsyncCallback<void\>): void
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2048,8 +2092,8 @@ turnOffRadio(callback: AsyncCallback<void\>): void
**示例:**
```js
radio.turnOffRadio((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
radio.turnOffRadio((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -2074,6 +2118,7 @@ turnOffRadio(slotId: number, callback: AsyncCallback<void\>): void
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2089,8 +2134,8 @@ turnOffRadio(slotId: number, callback: AsyncCallback<void\>): void
```js
let slotId = 0;
radio.turnOffRadio(slotId, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
radio.turnOffRadio(slotId, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -2120,6 +2165,7 @@ turnOffRadio(slotId?: number): Promise<void\>
| Promise\<void\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2135,10 +2181,9 @@ turnOffRadio(slotId?: number): Promise<void\>
```js
let slotId = 0;
let promise = radio.turnOffRadio(slotId);
promise.then(data => {
console.log(`turnOffRadio success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
radio.turnOffRadio(slotId).then(() => {
console.log(`turnOffRadio success.`);
}).catch((err) => {
console.error(`turnOffRadio failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -2164,6 +2209,7 @@ setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2178,8 +2224,9 @@ setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback
**示例:**
```js
radio.setPreferredNetwork(0, 1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
let slotId = 0;
radio.setPreferredNetwork(slotId, radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -2209,9 +2256,10 @@ setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<
| Promise\<void\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
......@@ -2223,10 +2271,10 @@ setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<
**示例:**
```js
let promise = radio.setPreferredNetwork(0, 1);
promise.then(data => {
console.log(`setPreferredNetwork success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
let slotId = 0;
radio.setPreferredNetwork(slotId, radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM).then(() => {
console.log(`setPreferredNetwork success.`);
}).catch((err) => {
console.log(`setPreferredNetwork failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -2251,6 +2299,7 @@ getPreferredNetwork\(slotId: number, callback: AsyncCallback<PreferredNetworkMod
| callback | AsyncCallback\<[PreferredNetworkMode](#preferrednetworkmode8)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2295,6 +2344,7 @@ getPreferredNetwork(slotId: number): Promise<PreferredNetworkMode\>
| Promise\<void\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2338,6 +2388,7 @@ getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<I
| callback | AsyncCallback<[ImsRegInfo](#imsreginfo9)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2383,6 +2434,7 @@ getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo\>
| Promise\<[ImsRegInfo](#imsreginfo9)\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2427,6 +2479,7 @@ on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback:
| callback | Callback<[ImsRegInfo](#imsreginfo9)> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2468,6 +2521,7 @@ off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback
| callback | Callback<[ImsRegInfo](#imsreginfo9)> | 否 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......
......@@ -133,6 +133,7 @@ hasOperatorPrivileges(slotId: number, callback: AsyncCallback\<boolean\>): void
| callback | AsyncCallback\<boolean\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -173,6 +174,7 @@ hasOperatorPrivileges(slotId: number): Promise<boolean\>
| Promise\<boolean\> | 以Promise形式返回检查应用(调用者)是否已被授予运营商权限。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -211,6 +213,7 @@ getISOCountryCodeForSim\(slotId: number, callback: AsyncCallback<string\>\): voi
| callback | AsyncCallback\<string\> | 是 | 回调函数。返回国家码,例如:CN(中国)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -252,6 +255,7 @@ getISOCountryCodeForSim\(slotId: number\): Promise<string\>
| Promise\<string\> | 以Promise形式返回获取指定卡槽SIM卡的ISO国家码,例如:CN(中国)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -291,6 +295,7 @@ getSimOperatorNumeric\(slotId: number, callback: AsyncCallback<string\>\): void
| callback | AsyncCallback\<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -332,6 +337,7 @@ getSimOperatorNumeric\(slotId: number\): Promise<string\>
| Promise\<string\> | 以Promise形式返回获取指定卡槽SIM卡的归属PLMN号。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -371,6 +377,7 @@ getSimSpn\(slotId: number, callback: AsyncCallback<string\>\): void
| callback | AsyncCallback\<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -412,6 +419,7 @@ getSimSpn\(slotId: number\): Promise<string\>
| Promise\<string\> | 以Promise形式返回获取指定卡槽SIM卡的SPN。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -451,6 +459,7 @@ getSimState\(slotId: number, callback: AsyncCallback<SimState\>\): void
| callback | AsyncCallback\<[SimState](#simstate)\> | 是 | 回调函数。参考[SimState](#simstate)。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -492,6 +501,7 @@ getSimState\(slotId: number\): Promise<SimState\>
| Promise\<[SimState](#simstate)\> | 以Promise形式返回获取指定卡槽的SIM卡状态。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -530,6 +540,7 @@ getCardType\(slotId: number, callback: AsyncCallback<CardType\>\): void
| callback | AsyncCallback\<[CardType](#cardtype7)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -571,6 +582,7 @@ getCardType\(slotId: number\): Promise<CardType\>
| Promise\<[CardType](#cardtype7)\> | 以Promise形式返回指定卡槽SIM卡的卡类型。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -610,6 +622,7 @@ hasSimCard\(slotId: number, callback: AsyncCallback<boolean\>\): void
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -651,6 +664,7 @@ hasSimCard\(slotId: number\): Promise<boolean\>
| Promise&lt;boolean&gt; | 以Promise形式返回指定卡槽是否插卡,如果插卡返回true。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -693,6 +707,7 @@ getSimAccountInfo(slotId: number, callback: AsyncCallback<IccAccountInfo\>): voi
| callback | AsyncCallback\<[IccAccountInfo](#iccaccountinfo7)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -740,6 +755,7 @@ getSimAccountInfo(slotId: number): Promise<IccAccountInfo\>
| Promise<[IccAccountInfo](#iccaccountinfo7)\> | 以Promise形式返回指定卡槽SIM卡的账户信息。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -783,6 +799,7 @@ getActiveSimAccountInfoList(callback: AsyncCallback<Array<IccAccountInfo\>>): vo
| callback | AsyncCallback\<Array<[IccAccountInfo](#iccaccountinfo7)\>\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -823,6 +840,7 @@ getActiveSimAccountInfoList(): Promise<Array<IccAccountInfo\>>;
| Promise<Array<[IccAccountInfo](#iccaccountinfo7)\>\> | 以Promise形式返回活跃卡槽SIM卡的账户信息列表。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -866,6 +884,7 @@ setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback<void\>): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -882,8 +901,8 @@ setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback<void\>): void
**示例:**
```js
sim.setDefaultVoiceSlotId(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.setDefaultVoiceSlotId(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -913,6 +932,7 @@ setDefaultVoiceSlotId(slotId: number): Promise\<void\>
| Promise\<void\> | 以Promise形式异步返回设置结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -930,9 +950,9 @@ setDefaultVoiceSlotId(slotId: number): Promise\<void\>
```js
let promise = sim.setDefaultVoiceSlotId(0);
promise.then(data => {
console.log(`setDefaultVoiceSlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`setDefaultVoiceSlotId success.`);
}).catch((err) => {
console.log(`setDefaultVoiceSlotId failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -958,6 +978,7 @@ setShowName\(slotId: number, name: string, callback: AsyncCallback<void\>\): voi
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -974,8 +995,8 @@ setShowName\(slotId: number, name: string, callback: AsyncCallback<void\>\): voi
```js
let name = "ShowName";
sim.setShowName(0, name, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.setShowName(0, name, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1005,6 +1026,7 @@ setShowName\(slotId: number, name: string\): Promise\<void\>
| Promise\<void\> | 以Promise形式异步返回设置结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1022,9 +1044,9 @@ setShowName\(slotId: number, name: string\): Promise\<void\>
```js
let name = "ShowName";
let promise = sim.setShowName(0, name);
promise.then(data => {
console.log(`setShowName success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`setShowName success.`);
}).catch((err) => {
console.log(`setShowName failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1049,6 +1071,7 @@ getShowName(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback&lt;string&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1095,6 +1118,7 @@ getShowName(slotId: number): Promise<string\>
| Promise&lt;string&gt; | 以Promise形式返回指定卡槽SIM卡的名称。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1139,6 +1163,7 @@ setShowNumber\(slotId: number, number: string, callback: AsyncCallback<void\>\):
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1155,8 +1180,8 @@ setShowNumber\(slotId: number, number: string, callback: AsyncCallback<void\>\):
```js
let number = '+861xxxxxxxxxx';
sim.setShowNumber(0, number, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.setShowNumber(0, number, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1187,6 +1212,7 @@ setShowNumber\(slotId: number, number: string\): Promise\<void\>
| Promise<void\> | 以Promise形式异步返回设置结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1204,9 +1230,9 @@ setShowNumber\(slotId: number, number: string\): Promise\<void\>
```js
let number = '+861xxxxxxxxxx';
let promise = sim.setShowNumber(0, number);
promise.then(data => {
console.log(`setShowNumber success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`setShowNumber success.`);
}).catch((err) => {
console.log(`setShowNumber failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1231,6 +1257,7 @@ getShowNumber(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback&lt;string&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1277,6 +1304,7 @@ getShowNumber(slotId: number): Promise<string\>
| Promise&lt;string&gt; | 以Promise形式返回指定卡槽的号码。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1320,6 +1348,7 @@ activateSim(slotId: number, callback: AsyncCallback<void\>): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1335,8 +1364,8 @@ activateSim(slotId: number, callback: AsyncCallback<void\>): void
**示例:**
```js
sim.activateSim(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.activateSim(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1366,6 +1395,7 @@ activateSim(slotId: number): Promise\<void\>
| Promise\<void\> | 以Promise形式异步返回设置结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1382,9 +1412,9 @@ activateSim(slotId: number): Promise\<void\>
```js
let promise = sim.activateSim(0);
promise.then(data => {
console.log(`activateSim success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`activateSim success.`);
}).catch((err) => {
console.log(`activateSim failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1409,6 +1439,7 @@ deactivateSim(slotId: number, callback: AsyncCallback<void\>): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1424,8 +1455,8 @@ deactivateSim(slotId: number, callback: AsyncCallback<void\>): void
**示例:**
```js
sim.deactivateSim(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.deactivateSim(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -1455,6 +1486,7 @@ deactivateSim(slotId: number): Promise\<void\>
| Promise\<void\> | 以Promise形式异步返回设置结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1471,9 +1503,9 @@ deactivateSim(slotId: number): Promise\<void\>
```js
let promise = sim.deactivateSim(0);
promise.then(data => {
console.log(`deactivateSim success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`deactivateSim success.`);
}).catch((err) => {
console.log(`deactivateSim failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1499,6 +1531,7 @@ setLockState(slotId: number, options: LockInfo, callback: AsyncCallback<LockStat
| options | [LockInfo](#lockinfo8) | 是 | 锁信息。<br/>- lockType: [LockType](#locktype8)<br/>- password: string<br/>- state: [LockState](#lockstate8) |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1552,6 +1585,7 @@ setLockState(slotId: number, options: LockInfo): Promise<LockStatusResponse\>
| Promise<[LockStatusResponse](#lockstatusresponse7)\> | 以Promise形式返回获取指定卡槽SIM卡的锁状态。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1602,6 +1636,7 @@ getLockState(slotId: number, lockType: LockType, callback: AsyncCallback<LockSta
| options | [LockType](#locktype8) | 是 | 锁类型。<br/>- 1: PIN锁<br/>- 2: PIN2锁 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1650,6 +1685,7 @@ getLockState(slotId: number, lockType: LockType): Promise<LockState\>
| Promise<[LockState](#lockstate8)\> | 以Promise形式返回获取指定卡槽SIM卡的锁状态。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1696,6 +1732,7 @@ alterPin(slotId: number, newPin: string, oldPin: string, callback: AsyncCallback
| oldPin | string | 是 | 旧密码。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1745,6 +1782,7 @@ alterPin(slotId: number, newPin: string, oldPin: string): Promise<LockStatusResp
| Promise<[LockStatusResponse](#lockstatusresponse7)\> | 以Promise形式返回指定卡槽SIM卡的Pin是否成功。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1791,6 +1829,7 @@ alterPin2(slotId: number, newPin2: string, oldPin2: string, callback: AsyncCallb
| oldPin2 | string | 是 | 旧密码。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1840,6 +1879,7 @@ alterPin2(slotId: number, newPin2: string, oldPin2: string): Promise<LockStatusR
| Promise<[LockStatusResponse](#lockstatusresponse7)\> | 以Promise形式返回指定卡槽SIM卡的Pin是否成功。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1885,6 +1925,7 @@ unlockPin(slotId: number, pin: string, callback: AsyncCallback<LockStatusRespons
| callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1934,6 +1975,7 @@ unlockPin(slotId: number, pin: string): Promise&lt;LockStatusResponse\>
| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | 以Promise形式返回获取指定卡槽的SIM卡锁状态的响应。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1981,6 +2023,7 @@ unlockPuk(slotId: number, newPin: string, puk: string, callback: AsyncCallback<L
| callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2032,6 +2075,7 @@ unlockPuk(slotId: number, newPin: string, puk: string): Promise&lt;LockStatusRes
| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | 以Promise形式返回获取指定卡槽的SIM卡锁状态的响应。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2079,6 +2123,7 @@ unlockPin2(slotId: number, pin2: string, callback: AsyncCallback<LockStatusRespo
| callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2128,6 +2173,7 @@ unlockPin2(slotId: number, pin2: string): Promise&lt;LockStatusResponse\>
| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | 以Promise形式返回获取指定卡槽的SIM卡锁状态的响应。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2175,6 +2221,7 @@ unlockPuk2(slotId: number, newPin2: string, puk2: string, callback: AsyncCallbac
| callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2226,6 +2273,7 @@ unlockPuk2(slotId: number, newPin2: string, puk2: string): Promise&lt;LockStatus
| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | 以Promise形式返回获取指定卡槽的SIM卡锁状态的响应。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2292,6 +2340,7 @@ getSimIccId(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2338,6 +2387,7 @@ getSimIccId(slotId: number): Promise<string\>
| Promise<string\> | 以Promise形式返回获取指定卡槽SIM卡的ICCID。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2381,6 +2431,7 @@ getVoiceMailIdentifier(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2427,6 +2478,7 @@ getVoiceMailIdentifier(slotId: number): Promise<string\>
| Promise<string\> | 以Promise形式返回获取指定卡槽SIM卡的alpha标识符。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2470,6 +2522,7 @@ getVoiceMailNumber(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2516,6 +2569,7 @@ getVoiceMailNumber(slotId: number): Promise<string\>
| Promise<string\> | 以Promise形式返回获取指定卡槽SIM卡的语音信箱号。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2562,6 +2616,7 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback:
| callback | AsyncCallback<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2578,8 +2633,8 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback:
**示例:**
```js
sim.setVoiceMailInfo(0, "mail", "xxx@xxx.com", (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.setVoiceMailInfo(0, "mail", "xxx@xxx.com", (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -2611,6 +2666,7 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string): Promise<
| Promise<void\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2628,9 +2684,9 @@ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string): Promise<
```js
let promise = sim.setVoiceMailInfo(0, "mail", "xxx@xxx.com");
promise.then(data => {
console.log(`setVoiceMailInfo success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`setVoiceMailInfo success.`);
}).catch((err) => {
console.log(`setVoiceMailInfo failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -2655,6 +2711,7 @@ getSimTelephoneNumber(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2701,6 +2758,7 @@ getSimTelephoneNumber(slotId: number): Promise<string\>
| Promise<string\> | 以Promise形式返回获取指定卡槽SIM卡的MSISDN。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2744,6 +2802,7 @@ getSimGid1(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback\<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2790,6 +2849,7 @@ getSimGid1(slotId: number): Promise<string\>
| Promise<string\> | 以Promise形式返回获取指定卡槽SIM卡的标识符级别1。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2833,6 +2893,7 @@ getIMSI(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback\<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2879,6 +2940,7 @@ getIMSI(slotId: number): Promise<string\>
| Promise<string\> | 以Promise形式返回获取的国际移动用户识别码。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2922,6 +2984,7 @@ getOperatorConfigs(slotId: number, callback: AsyncCallback<Array<OperatorConfig\
| callback | AsyncCallback<Array<[OperatorConfig](#operatorconfig8)\>> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -2968,6 +3031,7 @@ getOperatorConfigs(slotId: number): Promise<Array<OperatorConfig\>>
| Promise<Array<[OperatorConfig](#operatorconfig8)\>> | 以Promise形式返回运营商配置。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3012,6 +3076,7 @@ queryIccDiallingNumbers(slotId: number, type: ContactType, callback: AsyncCallba
| callback | AsyncCallback<Array<[DiallingNumbersInfo](#diallingnumbersinfo8)\>> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3060,6 +3125,7 @@ queryIccDiallingNumbers(slotId: number, type: ContactType): Promise<Array<Dialli
| Promise<Array<[DiallingNumbersInfo](#diallingnumbersinfo8)\>> | 以Promise形式返回Icc拨号号码。|
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3106,6 +3172,7 @@ addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
| callback | AsyncCallback<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3127,8 +3194,8 @@ let diallingNumbersInof = {
number: "138xxxxxxxx",
pin2: "1234"
};
sim.addIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.addIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3160,6 +3227,7 @@ addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
| Promise<void\> | 以Promise形式返回添加结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3181,9 +3249,9 @@ let diallingNumbersInof = {
number: "138xxxxxxxx"
};
let promise = sim.addIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof);
promise.then(data => {
console.log(`addIccDiallingNumbers success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`addIccDiallingNumbers success.`);
}).catch((err) => {
console.log(`addIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3210,6 +3278,7 @@ delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
| callback | AsyncCallback<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3232,8 +3301,8 @@ let diallingNumbersInof = {
recordNumber: 123,
pin2: "1234"
};
sim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3265,6 +3334,7 @@ delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dialli
| Promise<void\> | 以Promise形式返回删除结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3286,9 +3356,9 @@ let diallingNumbersInof = {
number: "138xxxxxxxx"
};
let promise = sim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof);
promise.then(data => {
console.log(`delIccDiallingNumbers success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`delIccDiallingNumbers success.`);
}).catch((err) => {
console.log(`delIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3315,6 +3385,7 @@ updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dia
| callback | AsyncCallback<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3337,8 +3408,8 @@ let diallingNumbersInof = {
recordNumber: 123,
pin2: "1234"
};
sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3370,6 +3441,7 @@ updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: Dia
| Promise<void\> | 以Promise形式返回更新的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3392,9 +3464,9 @@ let diallingNumbersInof = {
recordNumber: 123
};
let promise = sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof);
promise.then(data => {
console.log(`updateIccDiallingNumbers success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`updateIccDiallingNumbers success.`);
}).catch((err) => {
console.log(`updateIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3420,6 +3492,7 @@ sendEnvelopeCmd(slotId: number, cmd: string, callback: AsyncCallback<void\>): vo
| callback | AsyncCallback<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3435,8 +3508,8 @@ sendEnvelopeCmd(slotId: number, cmd: string, callback: AsyncCallback<void\>): vo
**示例:**
```js
sim.sendEnvelopeCmd(0, "ls", (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.sendEnvelopeCmd(0, "ls", (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3467,6 +3540,7 @@ sendEnvelopeCmd(slotId: number, cmd: string): Promise<void\>
| Promise<void\> | 以Promise形式返回发送结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3483,9 +3557,9 @@ sendEnvelopeCmd(slotId: number, cmd: string): Promise<void\>
```js
let promise = sim.sendEnvelopeCmd(0, "ls");
promise.then(data => {
console.log(`sendEnvelopeCmd success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`sendEnvelopeCmd success.`);
}).catch((err) => {
console.log(`sendEnvelopeCmd failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3511,6 +3585,7 @@ sendTerminalResponseCmd(slotId: number, cmd: string, callback: AsyncCallback<voi
| callback | AsyncCallback<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3526,8 +3601,8 @@ sendTerminalResponseCmd(slotId: number, cmd: string, callback: AsyncCallback<voi
**示例:**
```js
sim.sendTerminalResponseCmd(0, "ls", (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sim.sendTerminalResponseCmd(0, "ls", (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -3558,6 +3633,7 @@ sendTerminalResponseCmd(slotId: number, cmd: string): Promise<void\>
| Promise<void\> | 以Promise形式返回发送结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3574,9 +3650,9 @@ sendTerminalResponseCmd(slotId: number, cmd: string): Promise<void\>
```js
let promise = sim.sendTerminalResponseCmd(0, "ls");
promise.then(data => {
console.log(`sendTerminalResponseCmd success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`sendTerminalResponseCmd success.`);
}).catch((err) => {
console.log(`sendTerminalResponseCmd failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -3603,6 +3679,7 @@ unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<L
| callback | AsyncCallback<[LockStatusResponse](#lockstatusresponse7)\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3655,6 +3732,7 @@ unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise<LockStatusRespon
| Promise<[LockStatusResponse](#lockstatusresponse7)\> | 以Promise形式返回锁状态。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3699,6 +3777,7 @@ getOpKey(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3749,6 +3828,7 @@ getOpKey(slotId: number): Promise<string\>
| Promise<string\> | 以Promise形式返回指定卡槽中SIM卡的opkey。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3788,6 +3868,7 @@ getOpName(slotId: number, callback: AsyncCallback<string\>): void
| callback | AsyncCallback<string\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3838,6 +3919,7 @@ getOpName(slotId: number): Promise<string\>
| Promise<string\> | 以Promise形式返回指定卡槽中SIM卡的OpName。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -3929,17 +4011,17 @@ SIM卡状态。
**系统能力**: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锁。 |
| 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锁。 |
| 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锁。 |
| 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锁。 |
| 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锁。 |
## LockStatusResponse<sup>7+</sup>
......
......@@ -2,7 +2,7 @@
短信服务提供了管理短信的一些基础能力,包括创建、发送短信,获取、设置发送短信的默认SIM卡槽ID,获取、设置短信服务中心(SMSC)地址,以及检查当前设备是否具备短信发送和接收能力等。
>**说明:**
>**说明:**
>
>本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......@@ -91,6 +91,19 @@ sendMessage(options: SendMessageOptions): void
| ------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| 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
......@@ -178,6 +191,7 @@ setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback&lt;void&gt;\): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -193,8 +207,8 @@ setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback&lt;void&gt;\): void
**示例:**
```js
sms.setDefaultSmsSlotId(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sms.setDefaultSmsSlotId(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}.`);
});
```
......@@ -224,6 +238,7 @@ setDefaultSmsSlotId\(slotId: number\): Promise&lt;void&gt;
| Promise\<void\> | 以Promise形式异步返回设置结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -240,9 +255,9 @@ setDefaultSmsSlotId\(slotId: number\): Promise&lt;void&gt;
```js
let promise = sms.setDefaultSmsSlotId(0);
promise.then(data => {
console.log(`setDefaultSmsSlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`setDefaultSmsSlotId success.`);
}).catch((err) => {
console.error(`setDefaultSmsSlotId failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -268,6 +283,7 @@ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\):
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -284,8 +300,8 @@ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\):
```js
let slotId = 0;
let smscAddr = '+861xxxxxxxxxx';
sms.setSmscAddr(slotId, smscAddr, (err,data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sms.setSmscAddr(slotId, smscAddr, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -316,6 +332,7 @@ setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\>
| Promise&lt;void&gt; | 以Promise形式异步返回设置结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -333,9 +350,9 @@ setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\>
let slotId = 0;
let smscAddr = '+861xxxxxxxxxx';
let promise = sms.setSmscAddr(slotId, smscAddr);
promise.then(data => {
console.log(`setSmscAddr success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`setSmscAddr success.`);
}).catch((err) => {
console.error(`setSmscAddr failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -361,6 +378,7 @@ getSmscAddr\(slotId: number, callback: AsyncCallback<string\>\): void
| callback | AsyncCallback&lt;string&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -407,6 +425,7 @@ getSmscAddr\(slotId: number\): Promise<string\>
| Promise&lt;string&gt; | 以Promise形式返回获取短信服务中心地址的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -469,6 +488,7 @@ splitMessage(content: string, callback: AsyncCallback<Array<string\>>): void
| callback | AsyncCallback<Array<string\>> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -515,6 +535,7 @@ splitMessage(content: string): Promise<Array<string\>>
| Promise<Array<string\>> | 以Promise形式返回多个片段的的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -558,6 +579,7 @@ addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void\>): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -578,8 +600,8 @@ let simMessageOptions = {
pdu: "xxxxxx",
status: sms.SimMessageStatus.SIM_MESSAGE_STATUS_READ
};
sms.addSimMessage(simMessageOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sms.addSimMessage(simMessageOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -609,6 +631,7 @@ addSimMessage(options: SimMessageOptions): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式返回添加的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -630,9 +653,9 @@ let simMessageOptions = {
status: sms.SimMessageStatus.SIM_MESSAGE_STATUS_READ
};
let promise = sms.addSimMessage(simMessageOptions);
promise.then(data => {
console.log(`addSimMessage success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`addSimMessage success.`);
}).catch((err) => {
console.error(`addSimMessage failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -658,6 +681,7 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>):
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -674,8 +698,8 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>):
```js
let slotId = 0;
let msgIndex = 1;
sms.delSimMessage(slotId, msgIndex, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sms.delSimMessage(slotId, msgIndex, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -706,6 +730,7 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式返回删除的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -723,9 +748,9 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\>
let slotId = 0;
let msgIndex = 1;
let promise = sms.delSimMessage(slotId, msgIndex);
promise.then(data => {
console.log(`delSimMessage success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`delSimMessage success.`);
}).catch((err) => {
console.error(`delSimMessage failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -750,6 +775,7 @@ updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void\
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -771,8 +797,8 @@ let updateSimMessageOptions = {
pdu: "xxxxxxx",
smsc: "test"
};
sms.updateSimMessage(updateSimMessageOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sms.updateSimMessage(updateSimMessageOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -802,6 +828,7 @@ updateSimMessage(options: UpdateSimMessageOptions): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式返回更新的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -824,9 +851,9 @@ let updateSimMessageOptions = {
smsc: "test"
};
let promise = sms.updateSimMessage(updateSimMessageOptions);
promise.then(data => {
console.log(`updateSimMessage success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`updateSimMessage success.`);
}).catch((err) => {
console.error(`updateSimMessage failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -851,6 +878,7 @@ getAllSimMessages(slotId: number, callback: AsyncCallback<Array<SimShortMessage\
| callback | AsyncCallback<Array<[SimShortMessage](#simshortmessage7)\>> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -897,6 +925,7 @@ getAllSimMessages(slotId: number): Promise<Array<SimShortMessage\>>
| PromiseArray<[SimShortMessage](#simshortmessage7)\>&gt; | 以Promise形式返回获取的SIM短消息。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -940,6 +969,7 @@ setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void\>): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -961,8 +991,8 @@ let cbConfigOptions = {
endMessageId: 200,
ranType: sms.RanType.TYPE_GSM
};
sms.setCBConfig(cbConfigOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
sms.setCBConfig(cbConfigOptions, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -992,6 +1022,7 @@ setCBConfig(options: CBConfigOptions): Promise<void\>
| Promise&lt;void&gt; | 以Promise形式返回设置的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1014,9 +1045,9 @@ let cbConfigOptions = {
ranType: sms.RanType.TYPE_GSM
};
let promise = sms.setCBConfig(cbConfigOptions);
promise.then(data => {
console.log(`setCBConfig success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
promise.then(() => {
console.log(`setCBConfig success.`);
}).catch((err) => {
console.error(`setCBConfig failed, promise: err->${JSON.stringify(err)}`);
});
```
......@@ -1041,6 +1072,7 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback
| callback | AsyncCallback&lt;[SmsSegmentsInfo](#smssegmentsinfo8)&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1086,6 +1118,7 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise
| Promise&lt;[SmsSegmentsInfo](#smssegmentsinfo8)&gt; | 以Promise形式返回短信段信息。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1126,6 +1159,7 @@ isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean\>): void
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1169,6 +1203,7 @@ isImsSmsSupported(slotId: number): Promise<boolean\>
| Promise&lt;boolean&gt; | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1208,11 +1243,11 @@ getImsShortMessageFormat(callback: AsyncCallback<string\>): void
| callback | AsyncCallback&lt;string&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[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. |
......@@ -1245,11 +1280,11 @@ getImsShortMessageFormat(): Promise<string\>
| Promise&lt;string&gt; | 以Promise形式返回SMS格式。 |
**错误码:**
以下错误码的详细介绍请参见[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. |
......@@ -1285,6 +1320,7 @@ decodeMms(mmsFilePathName: string | Array<number\>, callback: AsyncCallback<MmsI
| callback | AsyncCallback&lt;[MmsInformation](#mmsinformation8)&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1328,6 +1364,7 @@ decodeMms(mmsFilePathName: string | Array<number\>): Promise<MmsInformation\>
| Promise&lt;&lt;[MmsInformation](#mmsinformation8)&gt;&gt; | 以Promise形式返回彩信信息。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1368,6 +1405,7 @@ encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number\>>): void
| callback | AsyncCallback&lt;Array<number\>&gt; | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -1419,6 +1457,7 @@ encodeMms(mms: MmsInformation): Promise<Array<number\>>
| Promise&lt;Array<number\>&gt; | 以Promise形式返回彩信编码后的结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......
......@@ -99,6 +99,7 @@ setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback\<void\>): v
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -115,8 +116,8 @@ setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback\<void\>): v
**示例:**
```js
data.setDefaultCellularDataSlotId(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
data.setDefaultCellularDataSlotId(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}.`);
});
```
......@@ -145,6 +146,7 @@ setDefaultCellularDataSlotId(slotId: number): Promise\<void\>
| Promise\<void\> | 以Promise形式异步返回设置结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -162,8 +164,8 @@ setDefaultCellularDataSlotId(slotId: number): Promise\<void\>
```js
let promise = data.setDefaultCellularDataSlotId(0);
promise.then((data) => {
console.log(`setDefaultCellularDataSlotId success, promise: data->${JSON.stringify(data)}`);
promise.then(() => {
console.log(`setDefaultCellularDataSlotId success.`);
}).catch((err) => {
console.error(`setDefaultCellularDataSlotId fail, promise: err->${JSON.stringify(err)}`);
});
......@@ -280,6 +282,7 @@ isCellularDataEnabled(callback: AsyncCallback\<boolean\>): void
| callback | AsyncCallback\<boolean\> | 是 | 回调函数。<br />true:蜂窝数据业务已启用。<br />false:蜂窝数据业务已禁用。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -316,6 +319,7 @@ isCellularDataEnabled(): Promise\<boolean\>
| Promise\<boolean\> | 以Promise形式返回检查蜂窝数据业务是否启用。<br />true:蜂窝数据业务已启用。<br />false:蜂窝数据业务已禁用。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -356,6 +360,7 @@ isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback\<boolean\>)
| callback | AsyncCallback\<boolean\> | 是 | 回调函数。<br />true:蜂窝数据业务已启用漫游。<br />false:蜂窝数据业务已禁用漫游。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -398,6 +403,7 @@ isCellularDataRoamingEnabled(slotId: number): Promise\<boolean\>
| Promise\<boolean\> | 以Promise形式返回检查蜂窝数据业务是否启用漫游。<br />true:蜂窝数据业务已启用漫游。<br />false:蜂窝数据业务已禁用漫游。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -439,6 +445,7 @@ enableCellularData(callback: AsyncCallback<void\>): void
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -453,8 +460,8 @@ enableCellularData(callback: AsyncCallback<void\>): void
**示例:**
```js
data.enableCellularData((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
data.enableCellularData((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -477,6 +484,7 @@ enableCellularData(): Promise<void\>
| Promise\<void\> | 以Promise形式返回结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -492,8 +500,8 @@ enableCellularData(): Promise<void\>
```js
let promise = data.enableCellularData();
promise.then((data) => {
console.log(`enableCellularData success, promise: data->${JSON.stringify(data)}`);
promise.then(() => {
console.log(`enableCellularData success.`);
}).catch((err) => {
console.error(`enableCellularData fail, promise: err->${JSON.stringify(err)}`);
});
......@@ -518,6 +526,7 @@ disableCellularData(callback: AsyncCallback<void\>): void
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -532,8 +541,8 @@ disableCellularData(callback: AsyncCallback<void\>): void
**示例:**
```js
data.disableCellularData((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
data.disableCellularData((err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -556,6 +565,7 @@ disableCellularData(): Promise<void\>
| Promise\<void\> | 以Promise形式返回禁用结果。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -571,8 +581,8 @@ disableCellularData(): Promise<void\>
```js
let promise = data.disableCellularData();
promise.then((data) => {
console.log(`disableCellularData success, promise: data->${JSON.stringify(data)}`);
promise.then(() => {
console.log(`disableCellularData success.`);
}).catch((err) => {
console.error(`disableCellularData fail, promise: err->${JSON.stringify(err)}`);
});
......@@ -598,6 +608,7 @@ enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -612,8 +623,8 @@ enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
**示例:**
```js
data.enableCellularDataRoaming(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
data.enableCellularDataRoaming(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -642,6 +653,7 @@ enableCellularDataRoaming(slotId: number): Promise<void\>
| Promise\<void\> | 以Promise形式返回启用结果 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -657,8 +669,8 @@ enableCellularDataRoaming(slotId: number): Promise<void\>
```js
let promise = data.enableCellularDataRoaming(0);
promise.then((data) => {
console.log(`enableCellularDataRoaming success, promise: data->${JSON.stringify(data)}`);
promise.then(() => {
console.log(`enableCellularDataRoaming success.`);
}).catch((err) => {
console.error(`enableCellularDataRoaming fail, promise: err->${JSON.stringify(err)}`);
});
......@@ -684,6 +696,7 @@ disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
| callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -698,8 +711,8 @@ disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
**示例:**
```js
data.disableCellularDataRoaming(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
data.disableCellularDataRoaming(0, (err) => {
console.log(`callback: err->${JSON.stringify(err)}`);
});
```
......@@ -728,6 +741,7 @@ disableCellularDataRoaming(slotId: number): Promise<void\>
| Promise\<void\> | 以Promise形式返回禁用结果 |
**错误码:**
以下错误码的详细介绍请参见[ohos.telephony(电话子系统)错误码](../../reference/errorcodes/errorcode-telephony.md)错误码。
| 错误码ID | 错误信息 |
......@@ -743,8 +757,8 @@ disableCellularDataRoaming(slotId: number): Promise<void\>
```js
let promise = data.disableCellularDataRoaming(0);
promise.then((data) => {
console.log(`disableCellularDataRoaming success, promise: data->${JSON.stringify(data)}`);
promise.then(() => {
console.log(`disableCellularDataRoaming success.`);
}).catch((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.
先完成此消息的编辑!
想要评论请 注册