blob: d3790a8948729618be3b55308866a48fa99c1bd1 [file] [log] [blame]
Jayachandran C262b6062020-07-22 15:53:58 -07001/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.radio@1.6;
18
allenwtsu1c3dcd32020-09-25 17:58:01 +080019
20import @1.0::CdmaSmsMessage;
21import @1.0::GsmSmsMessage;
Jordan Liue4f5f022020-10-21 16:28:40 -070022import @1.1::CardPowerState;
Jayachandran C9bc276b2020-07-24 00:46:58 -070023import @1.2::DataRequestReason;
ThiƩbaud Weksteen5ae16f32020-08-21 16:46:07 +020024import @1.4::RadioAccessFamily;
Jayachandran C262b6062020-07-22 15:53:58 -070025import @1.5::IRadio;
Jayachandran C9bc276b2020-07-24 00:46:58 -070026import @1.5::AccessNetwork;
27import @1.5::DataProfileInfo;
28import @1.5::LinkAddress;
Jayachandran C262b6062020-07-22 15:53:58 -070029
30/**
31 * This interface is used by telephony and telecom to talk to cellular radio.
32 * All the functions have minimum one parameter:
33 * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the
34 * duration of a method call. If clients provide colliding serials (including passing the same
35 * serial to different methods), multiple responses (one for each method call) must still be served.
Jayachandran C9bc276b2020-07-24 00:46:58 -070036 * setResponseFunctions must work with @1.6::IRadioResponse and @1.6::IRadioIndication.
Jayachandran C262b6062020-07-22 15:53:58 -070037 */
38interface IRadio extends @1.5::IRadio {
Jayachandran C9bc276b2020-07-24 00:46:58 -070039 /**
Tim Line29df602020-09-26 22:43:24 +080040 * Toggle radio on and off (for "airplane" mode)
41 * If the radio is turned off/on the radio modem subsystem
42 * is expected return to an initialized state. For instance,
43 * any voice and data calls must be terminated and all associated
44 * lists emptied.
45 *
46 * When setting radio power on to exit from airplane mode to place an emergency call on this
47 * logical modem, powerOn, forEmergencyCall and preferredForEmergencyCall must be true. In
48 * this case, this modem is optimized to scan only emergency call bands, until:
49 * 1) Emergency call is completed; or
50 * 2) Another setRadioPower_1_5 is issued with forEmergencyCall being false or
51 * preferredForEmergencyCall being false; or
52 * 3) Timeout after 30 seconds if dial or emergencyDial is not called.
53 * Once one of these conditions is reached, the modem should move into normal operation.
54 *
55 * @param serial Serial number of request.
56 * @param powerOn To turn on radio -> on = true, to turn off radio -> on = false.
57 * @param forEmergencyCall To indication to radio if this request is due to emergency call.
58 * No effect if powerOn is false.
59 * @param preferredForEmergencyCall indicate whether the following emergency call will be sent
60 * on this modem or not. No effect if forEmergencyCall is false, or powerOn is false.
61 *
62 * Response callback is IRadioConfigResponse. setRadioPowerResponse_1_6.
63
64 * Note this API is the same as the 1.5
65 */
66 oneway setRadioPower_1_6(int32_t serial, bool powerOn, bool forEmergencyCall,
67 bool preferredForEmergencyCall);
68
69 /**
Jayachandran C9bc276b2020-07-24 00:46:58 -070070 * Returns the data call list. An entry is added when a setupDataCall() is issued and removed
71 * on a deactivateDataCall(). The list is emptied when setRadioPower() off/on issued or when
72 * the vendor HAL or modem crashes.
73 *
74 * @param serial Serial number of request.
75 *
76 * Response function is IRadioResponse.getDataCallListResponse_1_6()
77 */
78 oneway getDataCallList_1_6(int32_t serial);
79
80 /**
81 * Setup a packet data connection. If DataCallResponse.status returns DataCallFailCause:NONE,
82 * the data connection must be added to data calls and a unsolDataCallListChanged() must be
83 * sent. The call remains until removed by subsequent unsolDataCallIstChanged(). It may be
84 * lost due to many factors, including deactivateDataCall() being issued, the radio powered
85 * off, reception lost or even transient factors like congestion. This data call list is
86 * returned by getDataCallList() and dataCallListChanged().
87 *
88 * The Radio is expected to:
89 * - Create one data call context.
90 * - Create and configure a dedicated interface for the context.
91 * - The interface must be point to point.
92 * - The interface is configured with one or more addresses and is capable of sending and
93 * receiving packets. The format is IP address with optional "/" prefix length
94 * (The format is defined in RFC-4291 section 2.3). For example, "192.0.1.3",
95 * "192.0.1.11/16", or "2001:db8::1/64". Typically one IPv4 or one IPv6 or one of each. If
96 * the prefix length is absent, then the addresses are assumed to be point to point with
97 * IPv4 with prefix length 32 or IPv6 with prefix length 128.
98 * - Must not modify routing configuration related to this interface; routing management is
99 * exclusively within the purview of the Android OS.
100 * - Support simultaneous data call contexts up to DataRegStateResult.maxDataCalls specified
101 * in the response of getDataRegistrationState.
102 *
103 * @param serial Serial number of request.
104 * @param accessNetwork The access network to setup the data call. If the data connection cannot
105 * be established on the specified access network then it should be responded with an error.
106 * @param dataProfileInfo Data profile info.
107 * @param roamingAllowed Indicates whether or not data roaming is allowed by the user.
108 * @param reason The request reason. Must be DataRequestReason:NORMAL or
109 * DataRequestReason:HANDOVER.
110 * @param addresses If the reason is DataRequestReason:HANDOVER, this indicates the list of link
111 * addresses of the existing data connection. This parameter must be ignored unless reason
112 * is DataRequestReason:HANDOVER.
113 * @param dnses If the reason is DataRequestReason:HANDOVER, this indicates the list of DNS
114 * addresses of the existing data connection. The format is defined in RFC-4291 section 2.2.
115 * For example, "192.0.1.3" or "2001:db8::1". This parameter must be ignored unless reason
116 * is DataRequestReason:HANDOVER.
Daniel Bright3c72fba2020-11-03 14:56:23 -0800117 * @param pduSessionId The pdu session id to be used for this data call. A value of 0 means
118 * no pdu session id was attached to this call.
119 * Reference: 3GPP TS 24.007 section 11.2.3.1b
Jayachandran C9bc276b2020-07-24 00:46:58 -0700120 *
121 * Response function is IRadioResponse.setupDataCallResponse_1_6()
122 *
123 * Note this API is the same as the 1.5
124 */
125 oneway setupDataCall_1_6(int32_t serial, AccessNetwork accessNetwork,
126 DataProfileInfo dataProfileInfo, bool roamingAllowed,
Daniel Bright3c72fba2020-11-03 14:56:23 -0800127 DataRequestReason reason, vec<LinkAddress> addresses, vec<string> dnses,
128 int32_t pduSessionId);
allenwtsu1c3dcd32020-09-25 17:58:01 +0800129
130 /**
131 * Send an SMS message
132 *
133 * @param serial Serial number of request.
134 * @param message GsmSmsMessage as defined in types.hal
135 *
136 * Response function is IRadioResponse.sendSmsResponse_1_6()
137 *
138 * Note this API is the same as the 1.0
139 *
140 * Based on the return error, caller decides to resend if sending sms
141 * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
142 * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500)
143 */
144 oneway sendSms_1_6(int32_t serial, GsmSmsMessage message);
145
146 /**
147 * Send an SMS message. Identical to sendSms_1_6,
148 * except that more messages are expected to be sent soon. If possible,
149 * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
150 *
151 * @param serial Serial number of request.
152 * @param message GsmSmsMessage as defined in types.hal
153 *
154 * Response function is IRadioResponse.sendSMSExpectMoreResponse_1_6()
155 *
156 * Note this API is the same as the 1.0
157 *
158 * Based on the return error, caller decides to resend if sending sms
159 * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
160 * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500)
161 */
162 oneway sendSMSExpectMore_1_6(int32_t serial, GsmSmsMessage message);
163
164 /**
165 * Send a CDMA SMS message
166 *
167 * @param serial Serial number of request.
168 * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal
169 *
170 * Response callback is IRadioResponse.sendCdmaSmsResponse_1_6()
171 *
172 * Note this API is the same as the 1.0
173 *
174 */
175 oneway sendCdmaSms_1_6(int32_t serial, CdmaSmsMessage sms);
176
177 /**
178 * Send an SMS message. Identical to sendCdmaSms_1_6,
179 * except that more messages are expected to be sent soon.
180 *
181 * @param serial Serial number of request.
182 * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal
183 *
184 * Response callback is IRadioResponse.sendCdmaSMSExpectMoreResponse_1_6()
185 *
186 * Note this API is the same as the 1.5
187 *
188 */
189 oneway sendCdmaSmsExpectMore_1_6(int32_t serial, CdmaSmsMessage sms);
Sooraj Sasindrana9d461b2020-08-14 11:00:11 -0700190
191 /**
Jordan Liue4f5f022020-10-21 16:28:40 -0700192 * Set SIM card power state.
193 * Request is used to power off or power on the card. It should not generate
194 * a CardState.CARDSTATE_ABSENT indication, since the SIM is still physically
195 * inserted.
196 *
197 * @param serial Serial number of request
198 * @param powerUp POWER_DOWN if powering down the SIM card,
199 * POWER_UP if powering up the SIM card,
200 * POWER_UP_PASS_THROUGH if powering up the SIM card in
201 * pass through mode.
202 *
203 * When SIM card is in POWER_UP_PASS_THROUGH, the modem does not send
204 * any command to it (for example SELECT of MF, or TERMINAL
205 * CAPABILITY), and the SIM card is controlled completely by Telephony
206 * sending APDUs directly. The SIM card state must be
207 * RIL_CARDSTATE_PRESENT and the number of card apps will be 0.
208 * No new error code is generated. Emergency calls are supported in
209 * the same way as if the SIM card is absent.
210 * Pass-through mode is valid only for the specific card session where
211 * it is activated, and normal behavior occurs at the next SIM
212 * initialization, unless POWER_UP_PASS_THROUGH is requested again.
213 *
214 * The device is required to power down the SIM card before it can
215 * switch the mode between POWER_UP and POWER_UP_PASS_THROUGH.
216 * At device power up, the SIM interface is powered up automatically.
217 * Each subsequent request to this method is processed only after the
218 * completion of the previous one.
219 *
220 * Response callback is IRadioResponse.setSimCardPowerResponse_1_6().
221 * Note that this differs from setSimCardPower_1_1 in that the response
222 * callback should only be sent once the device has finished executing
223 * the request (the SIM has finished powering on or off).
224 */
225 oneway setSimCardPower_1_6(int32_t serial, CardPowerState powerUp);
226
227 /**
Sooraj Sasindrana9d461b2020-08-14 11:00:11 -0700228 * Enable or disable E-UTRA-NR dual connectivity. If disabled then UE will not connect
229 * to secondary carrier.
230 *
231 * @param serial Serial number of request.
232 * @param nrDualConnectivityState expected NR dual connectivity state.
233 * 1. Enable NR dual connectivity {NrDualConnectivityState:ENABLE}
234 * 2. Disable NR dual connectivity {NrDualConnectivityState:DISABLE}
235 * 3. Disable NR dual connectivity and force secondary cell to be released
236 * {NrDualConnectivityState:DISABLE_IMMEDIATE}
237
Sooraj Sasindrane9525fd2020-11-03 20:46:57 -0800238 * Response callback is IRadioResponse.setNRDualConnectivityStateResponse()
Sooraj Sasindrana9d461b2020-08-14 11:00:11 -0700239 */
Sooraj Sasindrane9525fd2020-11-03 20:46:57 -0800240 oneway setNrDualConnectivityState(int32_t serial,
Sooraj Sasindrana9d461b2020-08-14 11:00:11 -0700241 NrDualConnectivityState nrDualConnectivityState);
242
243 /**
244 * Is E-UTRA-NR Dual Connectivity enabled
245 *
246 * @param serial Serial number of request.
247 * Response callback is IRadioResponse.isNRDualConnectivityEnabledResponse()
248 */
249 oneway isNrDualConnectivityEnabled(int32_t serial);
Daniel Bright15cc34a2020-10-26 11:34:53 -0700250
251 /**
252 * Reserves an unallocated pdu session id from the pool of ids.
253 *
254 * The allocated id is returned in the response.
255 *
256 * When the id is no longer needed, call releasePduSessionId to
257 * return it to the pool.
258 *
259 * Reference: 3GPP TS 24.007 section 11.2.3.1b
260 *
261 * @param serial Serial number of request.
262 *
263 * Response function is IRadioResponse.allocatePduSessionIdResponse()
264 */
265 oneway allocatePduSessionId(int32_t serial);
266
267 /**
268 * Releases a pdu session id that was previously allocated using
269 * allocatePduSessionId.
270 *
271 * Reference: 3GPP TS 24.007 section 11.2.3.1b
272 * @param serial Serial number of request.
273 * @param id Pdu session id to release.
274 *
275 * Response function is IRadioResponse.releasePduSessionIdResponse()
276 */
277 oneway releasePduSessionId(int32_t serial, int32_t id);
278
279 /**
280 * Indicates that a handover to the IWLAN transport has begun.
281 *
282 * Any resources being transferred to the IWlan transport cannot be released while a
283 * handover is underway. For example, if a pdu session id needs to be
284 * transferred to IWlan, then, the modem should not release the id while
285 * the handover is in progress.
286 *
287 * If a handover was unsuccessful, then the framework calls IRadio::cancelHandover.
288 * The modem retains ownership over any of the resources being transferred to IWlan.
289 *
290 * If a handover was successful, the framework calls IRadio::deactivateDataCall with reason
291 * HANDOVER. The IWlan transport now owns the transferred resources and is responsible for
292 * releasing them.
293 *
294 * @param serial Serial number of request.
295 * @param id callId The identifier of the data call which is provided in SetupDataCallResult
296 *
Daniel Bright3c72fba2020-11-03 14:56:23 -0800297 * Response function is IRadioResponse.startHandoverResponse()
Daniel Bright15cc34a2020-10-26 11:34:53 -0700298 */
Daniel Bright3c72fba2020-11-03 14:56:23 -0800299 oneway startHandover(int32_t serial, int32_t callId);
Daniel Bright15cc34a2020-10-26 11:34:53 -0700300
301 /**
Daniel Bright3c72fba2020-11-03 14:56:23 -0800302 * Indicates that a handover was cancelled after a call to IRadio::startHandover.
Daniel Bright15cc34a2020-10-26 11:34:53 -0700303 *
304 * Since the handover was unsuccessful, the modem retains ownership over any of the resources
305 * being transferred and is still responsible for releasing them.
306 *
307 * @param serial Serial number of request.
308 * @param id callId The identifier of the data call which is provided in SetupDataCallResult
309 *
310 * Response function is IRadioResponse.cancelHandoverResponse()
311 */
312 oneway cancelHandover(int32_t serial, int32_t callId);
ThiƩbaud Weksteen5ae16f32020-08-21 16:46:07 +0200313
314 /**
315 * Requests to set the network type for searching and registering.
316 *
317 * Instruct the radio to *only* accept the types of network provided. This
318 * is stronger than setPreferredNetworkType which is a suggestion.
319 *
320 * @param serial Serial number of request.
321 * @param networkTypeBitmap a 32-bit bearer bitmap of RadioAccessFamily
322 *
323 * Response callbask is IRadioResponse.setNetworkTypeBitmapResponse()
324 */
325 oneway setAllowedNetworkTypeBitmap(
326 uint32_t serial, bitfield<RadioAccessFamily> networkTypeBitmap);
Jayachandran C262b6062020-07-22 15:53:58 -0700327};