• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# JS API Changes of the Telephony Subsystem
2
3The table below lists the APIs changes of the Telephony subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
4
5## API Changes
6
7| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
8|---|---|---|---|
9| ohos.telephony.sms | sms | hasSmsCapability(): boolean; | Added|
10| ohos.telephony.sim | CardType | SINGLE_MODE_ISIM_CARD = 60 | Added|
11| ohos.telephony.sim | CardType | DUAL_MODE_UG_CARD = 50 | Added|
12| ohos.telephony.sim | CardType | DUAL_MODE_TELECOM_LTE_CARD = 43 | Added|
13| ohos.telephony.sim | CardType | CU_DUAL_MODE_CARD = 42 | Added|
14| ohos.telephony.sim | CardType | CT_NATIONAL_ROAMING_CARD = 41 | Added|
15| ohos.telephony.sim | CardType | DUAL_MODE_CG_CARD = 40 | Added|
16| ohos.telephony.sim | CardType | SINGLE_MODE_RUIM_CARD = 30 | Added|
17| ohos.telephony.sim | CardType | SINGLE_MODE_USIM_CARD = 20 | Added|
18| ohos.telephony.sim | CardType | SINGLE_MODE_SIM_CARD = 10 | Added|
19| ohos.telephony.sim | CardType | UNKNOWN_CARD = -1 | Added|
20| ohos.telephony.sim | sim | hasSimCard(slotId: number, callback: AsyncCallback\<boolean>): void;<br>hasSimCard(slotId: number): Promise\<boolean>; | Added|
21| ohos.telephony.sim | sim | getMaxSimCount(): number; | Added|
22| ohos.telephony.sim | sim | getCardType(slotId: number, callback: AsyncCallback\<CardType>): void;<br>getCardType(slotId: number): Promise\<CardType>; | Added|
23| ohos.telephony.sim | sim | hasOperatorPrivileges(slotId: number, callback: AsyncCallback\<boolean>): void;<br>hasOperatorPrivileges(slotId: number): Promise\<boolean>; | Added|
24| ohos.telephony.sim | sim | isSimActive(slotId: number, callback: AsyncCallback\<boolean>): void;<br>isSimActive(slotId: number): Promise\<boolean>; | Added|
25| ohos.telephony.radio | NetworkState | cfgTech: RadioTechnology; | Added|
26| ohos.telephony.radio | radio | getOperatorName(slotId: number, callback: AsyncCallback\<string>): void;<br>getOperatorName(slotId: number): Promise\<string>; | Added|
27| ohos.telephony.radio | radio | isNrSupported(): boolean;<br>isNrSupported(slotId: number): boolean; | Added|
28| ohos.telephony.radio | radio | getPrimarySlotId(callback: AsyncCallback\<number>): void;<br>getPrimarySlotId(): Promise\<number>; | Added|
29| ohos.telephony.observer | LockReason | SIM_SIM_PUK | Added|
30| ohos.telephony.observer | LockReason | SIM_SIM_PIN | Added|
31| ohos.telephony.observer | LockReason | SIM_PC_PUK | Added|
32| ohos.telephony.observer | LockReason | SIM_PC_PIN | Added|
33| ohos.telephony.observer | LockReason | SIM_PP_PUK | Added|
34| ohos.telephony.observer | LockReason | SIM_PP_PIN | Added|
35| ohos.telephony.observer | LockReason | SIM_PU_PUK | Added|
36| ohos.telephony.observer | LockReason | SIM_PU_PIN | Added|
37| ohos.telephony.observer | LockReason | SIM_PN_PUK | Added|
38| ohos.telephony.observer | LockReason | SIM_PN_PIN | Added|
39| ohos.telephony.observer | LockReason | SIM_PUK | Added|
40| ohos.telephony.observer | LockReason | SIM_PIN | Added|
41| ohos.telephony.observer | LockReason | SIM_NONE | Added|
42| ohos.telephony.observer | SimStateData | reason: LockReason; | Added|
43| ohos.telephony.observer | SimStateData | state: SimState; | Added|
44| ohos.telephony.observer | SimStateData | type: CardType; | Added|
45| ohos.telephony.observer | observer | off(type: 'simStateChange', callback?: Callback\<SimStateData>): void; | Added|
46| ohos.telephony.observer | observer | on(type: 'simStateChange', callback: Callback\<SimStateData>): void;<br>on(type: 'simStateChange', options: { slotId: number }, callback: Callback\<SimStateData>): void; | Added|
47| ohos.telephony.observer | observer | off(type: 'cellularDataFlowChange', callback?: Callback\<DataFlowType>): void; | Added|
48| ohos.telephony.observer | observer | on(type: 'cellularDataFlowChange', callback: Callback\<DataFlowType>): void;<br>on(type: 'cellularDataFlowChange', options: { slotId: number },callback: Callback\<DataFlowType>): void; | Added|
49| ohos.telephony.observer | observer | off(type: 'cellularDataConnectionStateChange',callback?: Callback\<{ state: DataConnectState, network: RatType }>): void; | Added|
50| ohos.telephony.observer | observer | on(type: 'cellularDataConnectionStateChange', callback: Callback\<{ state: DataConnectState, network: RatType }>): void;<br>on(type: 'cellularDataConnectionStateChange', options: { slotId: number }, callback: Callback\<{ state: DataConnectState, network: RatType }>): void; | Added|
51| ohos.telephony.data | DataConnectState | DATA_STATE_SUSPENDED = 3 | Added|
52| ohos.telephony.data | DataConnectState | DATA_STATE_CONNECTED = 2 | Added|
53| ohos.telephony.data | DataConnectState | DATA_STATE_CONNECTING = 1 | Added|
54| ohos.telephony.data | DataConnectState | DATA_STATE_DISCONNECTED = 0 | Added|
55| ohos.telephony.data | DataConnectState | DATA_STATE_UNKNOWN = -1 | Added|
56| ohos.telephony.data | DataFlowType | DATA_FLOW_TYPE_DORMANT = 4 | Added|
57| ohos.telephony.data | DataFlowType | DATA_FLOW_TYPE_UP_DOWN = 3 | Added|
58| ohos.telephony.data | DataFlowType | DATA_FLOW_TYPE_UP = 2 | Added|
59| ohos.telephony.data | DataFlowType | DATA_FLOW_TYPE_DOWN = 1 | Added|
60| ohos.telephony.data | DataFlowType | DATA_FLOW_TYPE_NONE = 0 | Added|
61| ohos.telephony.data | data | isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback\<boolean>): void;<br>isCellularDataRoamingEnabled(slotId: number): Promise\<boolean>; | Added|
62| ohos.telephony.data | data | isCellularDataEnabled(callback: AsyncCallback\<boolean>): void;<br>isCellularDataEnabled(): Promise\<boolean>; | Added|
63| ohos.telephony.data | data | getCellularDataState(callback: AsyncCallback\<DataConnectState>): void;<br>getCellularDataState(): Promise\<DataConnectState>; | Added|
64| ohos.telephony.data | data | getCellularDataFlowType(callback: AsyncCallback\<DataFlowType>): void;<br>getCellularDataFlowType(): Promise\<DataFlowType>; | Added|
65| ohos.telephony.data | data | getDefaultCellularDataSlotId(callback: AsyncCallback\<number>): void;<br>getDefaultCellularDataSlotId(): Promise\<number>; | Added|
66| ohos.telephony.call | call | hasVoiceCapability(): boolean; | Added|
67| ohos.telephony.call | call | makeCall(phoneNumber: string, callback: AsyncCallback\<void>): void;<br>makeCall(phoneNumber: string): Promise\<void>; | Added|
68| ohos.contact | Website | website: string | Added|
69| ohos.contact | SipAddress | labelId: number | Added|
70| ohos.contact | SipAddress | sipAddress: string | Added|
71| ohos.contact | SipAddress | labelName: string | Added|
72| ohos.contact | SipAddress | static readonly INVALID_LABEL_ID: -1 | Added|
73| ohos.contact | SipAddress | static readonly SIP_OTHER: 3 | Added|
74| ohos.contact | SipAddress | static readonly SIP_WORK: 2 | Added|
75| ohos.contact | SipAddress | static readonly SIP_HOME: 1 | Added|
76| ohos.contact | SipAddress | static readonly CUSTOM_LABEL: 0 | Added|
77| ohos.contact | Relation | labelId: number | Added|
78| ohos.contact | Relation | relationName: string | Added|
79| ohos.contact | Relation | labelName: string | Added|
80| ohos.contact | Relation | static readonly INVALID_LABEL_ID: -1 | Added|
81| ohos.contact | Relation | static readonly RELATION_SPOUSE: 14 | Added|
82| ohos.contact | Relation | static readonly RELATION_SISTER: 13 | Added|
83| ohos.contact | Relation | static readonly RELATION_RELATIVE: 12 | Added|
84| ohos.contact | Relation | static readonly RELATION_REFERRED_BY: 11 | Added|
85| ohos.contact | Relation | static readonly RELATION_PARTNER: 10 | Added|
86| ohos.contact | Relation | static readonly RELATION_PARENT: 9 | Added|
87| ohos.contact | Relation | static readonly RELATION_MOTHER: 8 | Added|
88| ohos.contact | Relation | static readonly RELATION_MANAGER: 7 | Added|
89| ohos.contact | Relation | static readonly RELATION_FRIEND: 6 | Added|
90| ohos.contact | Relation | static readonly RELATION_FATHER: 5 | Added|
91| ohos.contact | Relation | static readonly RELATION_DOMESTIC_PARTNER: 4 | Added|
92| ohos.contact | Relation | static readonly RELATION_CHILD: 3 | Added|
93| ohos.contact | Relation | static readonly RELATION_BROTHER: 2 | Added|
94| ohos.contact | Relation | static readonly RELATION_ASSISTANT: 1 | Added|
95| ohos.contact | Relation | static readonly CUSTOM_LABEL: 0 | Added|
96| ohos.contact | PostalAddress | labelId: number | Added|
97| ohos.contact | PostalAddress | street: string | Added|
98| ohos.contact | PostalAddress | region: string | Added|
99| ohos.contact | PostalAddress | postcode: string | Added|
100| ohos.contact | PostalAddress | postalAddress: string | Added|
101| ohos.contact | PostalAddress | pobox: string | Added|
102| ohos.contact | PostalAddress | neighborhood: string | Added|
103| ohos.contact | PostalAddress | labelName: string | Added|
104| ohos.contact | PostalAddress | country: string | Added|
105| ohos.contact | PostalAddress | city: string | Added|
106| ohos.contact | PostalAddress | static readonly INVALID_LABEL_ID: -1 | Added|
107| ohos.contact | PostalAddress | static readonly ADDR_OTHER: 3 | Added|
108| ohos.contact | PostalAddress | static readonly ADDR_WORK: 2 | Added|
109| ohos.contact | PostalAddress | static readonly ADDR_HOME: 1 | Added|
110| ohos.contact | PostalAddress | static readonly CUSTOM_LABEL: 0 | Added|
111| ohos.contact | Portrait | uri: string | Added|
112| ohos.contact | PhoneNumber | labelId: number | Added|
113| ohos.contact | PhoneNumber | phoneNumber: string | Added|
114| ohos.contact | PhoneNumber | labelName: string | Added|
115| ohos.contact | PhoneNumber | static readonly INVALID_LABEL_ID: -1 | Added|
116| ohos.contact | PhoneNumber | static readonly NUM_MMS: 20 | Added|
117| ohos.contact | PhoneNumber | static readonly NUM_ASSISTANT: 19 | Added|
118| ohos.contact | PhoneNumber | static readonly NUM_WORK_PAGER: 18 | Added|
119| ohos.contact | PhoneNumber | static readonly NUM_WORK_MOBILE: 17 | Added|
120| ohos.contact | PhoneNumber | static readonly NUM_TTY_TDD: 16 | Added|
121| ohos.contact | PhoneNumber | static readonly NUM_TELEX: 15 | Added|
122| ohos.contact | PhoneNumber | static readonly NUM_RADIO: 14 | Added|
123| ohos.contact | PhoneNumber | static readonly NUM_OTHER_FAX: 13 | Added|
124| ohos.contact | PhoneNumber | static readonly NUM_MAIN: 12 | Added|
125| ohos.contact | PhoneNumber | static readonly NUM_ISDN: 11 | Added|
126| ohos.contact | PhoneNumber | static readonly NUM_COMPANY_MAIN: 10 | Added|
127| ohos.contact | PhoneNumber | static readonly NUM_CAR: 9 | Added|
128| ohos.contact | PhoneNumber | static readonly NUM_CALLBACK: 8 | Added|
129| ohos.contact | PhoneNumber | static readonly NUM_OTHER: 7 | Added|
130| ohos.contact | PhoneNumber | static readonly NUM_PAGER: 6 | Added|
131| ohos.contact | PhoneNumber | static readonly NUM_FAX_HOME: 5 | Added|
132| ohos.contact | PhoneNumber | static readonly NUM_FAX_WORK: 4 | Added|
133| ohos.contact | PhoneNumber | static readonly NUM_WORK: 3 | Added|
134| ohos.contact | PhoneNumber | static readonly NUM_MOBILE: 2 | Added|
135| ohos.contact | PhoneNumber | static readonly NUM_HOME: 1 | Added|
136| ohos.contact | PhoneNumber | static readonly CUSTOM_LABEL: 0 | Added|
137| ohos.contact | Organization | title: string | Added|
138| ohos.contact | Organization | name: string | Added|
139| ohos.contact | Note | noteContent: string | Added|
140| ohos.contact | NickName | nickName: string | Added|
141| ohos.contact | Name | nameSuffix: string | Added|
142| ohos.contact | Name | namePrefix: string | Added|
143| ohos.contact | Name | middleNamePhonetic: string | Added|
144| ohos.contact | Name | middleName: string | Added|
145| ohos.contact | Name | givenNamePhonetic: string | Added|
146| ohos.contact | Name | givenName: string | Added|
147| ohos.contact | Name | fullName: string | Added|
148| ohos.contact | Name | familyNamePhonetic: string | Added|
149| ohos.contact | Name | familyName: string | Added|
150| ohos.contact | ImAddress | labelId: number | Added|
151| ohos.contact | ImAddress | labelName: string | Added|
152| ohos.contact | ImAddress | imAddress: string | Added|
153| ohos.contact | ImAddress | static readonly INVALID_LABEL_ID: -2 | Added|
154| ohos.contact | ImAddress | static readonly IM_JABBER: 7 | Added|
155| ohos.contact | ImAddress | static readonly IM_ICQ: 6 | Added|
156| ohos.contact | ImAddress | static readonly IM_QQ: 4 | Added|
157| ohos.contact | ImAddress | static readonly IM_SKYPE: 3 | Added|
158| ohos.contact | ImAddress | static readonly IM_YAHOO: 2 | Added|
159| ohos.contact | ImAddress | static readonly IM_MSN: 1 | Added|
160| ohos.contact | ImAddress | static readonly IM_AIM: 0 | Added|
161| ohos.contact | ImAddress | static readonly CUSTOM_LABEL: -1 | Added|
162| ohos.contact | Holder | holderId: number | Added|
163| ohos.contact | Holder | readonly displayName: string | Added|
164| ohos.contact | Holder | readonly bundleName: string | Added|
165| ohos.contact | Group | title: string | Added|
166| ohos.contact | Group | groupId: number | Added|
167| ohos.contact | Event | labelId: number | Added|
168| ohos.contact | Event | labelName: string | Added|
169| ohos.contact | Event | eventDate: string | Added|
170| ohos.contact | Event | static readonly INVALID_LABEL_ID: -1 | Added|
171| ohos.contact | Event | static readonly EVENT_BIRTHDAY: 3 | Added|
172| ohos.contact | Event | static readonly EVENT_OTHER: 2 | Added|
173| ohos.contact | Event | static readonly EVENT_ANNIVERSARY: 1 | Added|
174| ohos.contact | Event | static readonly CUSTOM_LABEL: 0 | Added|
175| ohos.contact | Email | labelId: number | Added|
176| ohos.contact | Email | displayName: string | Added|
177| ohos.contact | Email | labelName: string | Added|
178| ohos.contact | Email | email: string | Added|
179| ohos.contact | Email | static readonly INVALID_LABEL_ID: -1 | Added|
180| ohos.contact | Email | static readonly EMAIL_OTHER: 3 | Added|
181| ohos.contact | Email | static readonly EMAIL_WORK: 2 | Added|
182| ohos.contact | Email | static readonly EMAIL_HOME: 1 | Added|
183| ohos.contact | Email | static readonly CUSTOM_LABEL: 0 | Added|
184| ohos.contact | Attribute | ATTR_WEBSITE | Added|
185| ohos.contact | Attribute | ATTR_SIP_ADDRESS | Added|
186| ohos.contact | Attribute | ATTR_RELATION | Added|
187| ohos.contact | Attribute | ATTR_POSTAL_ADDRESS | Added|
188| ohos.contact | Attribute | ATTR_PORTRAIT | Added|
189| ohos.contact | Attribute | ATTR_PHONE | Added|
190| ohos.contact | Attribute | ATTR_ORGANIZATION | Added|
191| ohos.contact | Attribute | ATTR_NOTE | Added|
192| ohos.contact | Attribute | ATTR_NICKNAME | Added|
193| ohos.contact | Attribute | ATTR_NAME | Added|
194| ohos.contact | Attribute | ATTR_IM | Added|
195| ohos.contact | Attribute | ATTR_GROUP_MEMBERSHIP | Added|
196| ohos.contact | Attribute | ATTR_EMAIL | Added|
197| ohos.contact | Attribute | ATTR_CONTACT_EVENT | Added|
198| ohos.contact | ContactAttributes | attributes: Attribute[] | Added|
199| ohos.contact | Contact | organization: Organization | Added|
200| ohos.contact | Contact | note: Note | Added|
201| ohos.contact | Contact | nickName: NickName | Added|
202| ohos.contact | Contact | name: Name | Added|
203| ohos.contact | Contact | websites: Website[] | Added|
204| ohos.contact | Contact | sipAddresses: SipAddress[] | Added|
205| ohos.contact | Contact | relations: Relation[] | Added|
206| ohos.contact | Contact | postalAddresses: PostalAddress[] | Added|
207| ohos.contact | Contact | portrait: Portrait | Added|
208| ohos.contact | Contact | phoneNumbers: PhoneNumber[] | Added|
209| ohos.contact | Contact | imAddresses: ImAddress[] | Added|
210| ohos.contact | Contact | groups: Group[] | Added|
211| ohos.contact | Contact | events: Event[] | Added|
212| ohos.contact | Contact | emails: Email[] | Added|
213| ohos.contact | Contact | contactAttributes: ContactAttributes | Added|
214| ohos.contact | Contact | readonly key: string | Added|
215| ohos.contact | Contact | readonly id: number | Added|
216| ohos.contact | Contact | static readonly INVALID_CONTACT_ID: -1 | Added|
217| ohos.contact | contact | isMyCard(id: number, callback: AsyncCallback\<boolean>): void;<br>isMyCard(id: number): Promise\<boolean>; | Added|
218| ohos.contact | contact | isLocalContact(id: number, callback: AsyncCallback\<boolean>): void;<br>isLocalContact(id: number): Promise\<boolean>; | Added|
219| ohos.contact | contact | updateContact(contact: Contact, callback: AsyncCallback\<void>): void;<br>updateContact(contact: Contact, attrs: ContactAttributes, callback: AsyncCallback\<void>): void;<br>updateContact(contact: Contact, attrs?: ContactAttributes): Promise\<void>; | Added|
220| ohos.contact | contact | queryMyCard(callback: AsyncCallback\<Contact>): void;<br>queryMyCard(attrs: ContactAttributes, callback: AsyncCallback\<Contact>): void;<br>queryMyCard(attrs?: ContactAttributes): Promise\<Contact>; | Added|
221| ohos.contact | contact | queryKey(id: number, callback: AsyncCallback\<string>): void;<br>queryKey(id: number, holder: Holder, callback: AsyncCallback\<string>): void;<br>queryKey(id: number, holder?: Holder): Promise\<string>; | Added|
222| ohos.contact | contact | queryHolders(callback: AsyncCallback\<Array\<Holder>>): void;<br>queryHolders(): Promise\<Array\<Holder>>; | Added|
223| ohos.contact | contact | queryGroups(callback: AsyncCallback\<Array\<Group>>): void;<br>queryGroups(holder: Holder, callback: AsyncCallback\<Array\<Group>>): void;<br>queryGroups(holder?: Holder): Promise\<Array\<Group>>; | Added|
224| ohos.contact | contact | queryContactsByPhoneNumber(phoneNumber: string, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContactsByPhoneNumber(phoneNumber: string, attrs: ContactAttributes, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContactsByPhoneNumber(phoneNumber: string, holder?: Holder, attrs?: ContactAttributes): Promise\<Array\<Contact>>; | Added|
225| ohos.contact | contact | queryContactsByEmail(email: string, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContactsByEmail(email: string, holder: Holder, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContactsByEmail(email: string, attrs: ContactAttributes, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContactsByEmail(email: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContactsByEmail(email: string, holder?: Holder, attrs?: ContactAttributes): Promise\<Array\<Contact>>; | Added|
226| ohos.contact | contact | queryContacts(callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContacts(holder: Holder, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContacts(attrs: ContactAttributes, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContacts(holder: Holder, attrs: ContactAttributes, callback: AsyncCallback\<Array\<Contact>>): void;<br>queryContacts(holder?: Holder, attrs?: ContactAttributes): Promise\<Array\<Contact>>; | Added|
227| ohos.contact | contact | queryContact(key: string, callback: AsyncCallback\<Contact>): void;<br>queryContact(key: string, holder: Holder, callback: AsyncCallback\<Contact>): void;<br>queryContact(key: string, attrs: ContactAttributes, callback: AsyncCallback\<Contact>): void;<br>queryContact(key: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback\<Contact>): void;<br>queryContact(key: string, holder?: Holder, attrs?: ContactAttributes): Promise\<Contact>; | Added|
228| ohos.contact | contact | deleteContact(key: string, callback: AsyncCallback\<void>): void;<br>deleteContact(key: string): Promise\<void>; | Added|
229| ohos.contact | contact | selectContact(callback: AsyncCallback\<Array\<Contact>>): void;<br>selectContact(): Promise\<Array\<Contact>>; | Added|
230| ohos.contact | contact | addContact(contact: Contact, callback: AsyncCallback\<number>): void;<br>addContact(contact: Contact): Promise\<number>; | Added|
231