• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 电话子系统ChangeLog
2
3
4
5## cl.telephony.1 sms模块SystemAPI接口入参变更
6
7已发布的部分电话子系统sms短信模块SystemAPI传入参数发生变化,不符合OpenHarmony接口规范。从API9开始做出以下变更:
8
9isImsSmsSupported接口新增一个传入参数slotId,表示卡槽号。
10
11
12
13**变更影响**
14
15基于此前版本开发的应用,需适配变更js接口的入参,否则会影响原有功能。
16
17
18
19**关键的接口/组件变更**
20
21- 涉及接口
22
23  isImsSmsSupported(callback: AsyncCallback<boolean>): void;
24  isImsSmsSupported(): Promise<boolean>;
25
26- 变更前:
27
28```js
29function isImsSmsSupported(callback: AsyncCallback<boolean>): void;
30function isImsSmsSupported(): Promise<boolean>;
31```
32
33- 变更后:
34
35```js
36function isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean>): void;
37function isImsSmsSupported(slotId: number): Promise<boolean>;
38```
39
40
41
42**适配指导**
43
44新增一个入参,示例代码如下:
45
46callback方式
47
48```js
49let slotId = 0;
50sms.isImsSmsSupported(slotId, (err, data) => {
51      console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
52});
53```
54
55promise方式
56
57```js
58let slotId = 0;
59let promise = sms.isImsSmsSupported(slotId);
60promise.then(data => {
61    console.log(`isImsSmsSupported success, promise: data->${JSON.stringify(data)}`);
62}).catch(err => {
63    console.error(`isImsSmsSupported failed, promise: err->${JSON.stringify(err)}`);
64});
65```
66