1# Telephony Subsystem Changelog
2
3
4
5## cl.telephony.1 VoNRState Enum Value Change of setVoNState
6
7Changed the **VoNRState** enum values of the **setVoNState** API. The values value of **VONR_STATE_ON** is changed from **0** to **1** and that of **VONR_STATE_OFF** is defined as **0** to keep consistency with boolean values.
8
9**Change Impact**
10
11The new **VoNRState** enum values need to be used when **setVoNState** is called. The API function remains unchanged.
12
13**Key API/Component Changes**
14
15Before change:
16
17```js
18function setVoNRState(slotId: number, state: VoNRState, callback: AsyncCallback<void>): void;
19
20/**
21 * @systemapi Hide this for inner system use.
22 * @since 10
23 */
24export enum VoNRState {
25    /** Indicates the VoNR switch is on */
26    VONR_STATE_ON = 0,
27}
28```
29
30After change:
31
32```js
33function setVoNRState(slotId: number, state: VoNRState, callback: AsyncCallback<void>): void;
34
35/**
36 * Indicates the VoNR state.
37 *
38 * @enum { number }
39 * @syscap SystemCapability.Telephony.CallManager
40 * @systemapi Hide this for inner system use.
41 * @since 10
42 */
43export enum VoNRState {
44    /**
45     * Indicates the VoNR switch is off.
46     *
47     * @syscap SystemCapability.Telephony.CallManager
48     * @systemapi Hide this for inner system use.
49     * @since 10
50     */
51    VONR_STATE_OFF = 0,
52
53    /**
54     * Indicates the VoNR switch is on.
55     *
56     * @syscap SystemCapability.Telephony.CallManager
57     * @systemapi Hide this for inner system use.
58     * @since 10
59     */
60    VONR_STATE_ON = 1,
61}
62```
63
64
65**Adaptation Guide**
66
67When calling **setVoNState**, use the new **VoNRState** enum values. The sample code is as follows:
68
69
70```js
71call.setVoNRState( 0, VONR_STATE_ON, (err) => {
72    if (err) {
73        console.log(`callback: err->${JSON.stringify(err)}`);
74    }
75
76});
77call.setVoNRState( 0, VONR_STATE_OFF, (err) => {
78    console.log(`callback: err->${JSON.stringify(err)}`);
79});
80```
81
82
83## cl.telephony.2 Callback Value Change of setVoNState
84
85Changed the callback value of **setVoNState** from a boolean value to **void**.
86
87**Change Impact**
88
89The callback value needs to be set to **void** when **setVoNState** is called.
90
91**Key API/Component Changes**
92
93Before change:
94
95```js
96function setVoNRState(slotId: number, state: VoNRState, callback: AsyncCallback<boolean>): void;
97function setVoNRState(slotId: number, state: VoNRState): Promise<boolean>;
98
99```
100
101After change:
102
103```js
104function setVoNRState(slotId: number, state: VoNRState, callback: AsyncCallback<void>): void;
105function setVoNRState(slotId: number, state: VoNRState): Promise<void>;
106```
107
108**Adaptation Guide**
109
110Set the callback value to **void** when calling **setVoNState**. The sample code is as follows:
111
112```js
113call.setVoNRState( 0, VONR_STATE_ON, (err) => {
114    if (err) {
115        console.log(`callback: err->${JSON.stringify(err)}`);
116    }
117
118});
119call.setVoNRState( 0, VONR_STATE_OFF, (err) => {
120    console.log(`callback: err->${JSON.stringify(err)}`);
121});
122```
123