blob: e770a5d26c0c4c5ebc419203cd73d2638146c698 [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
Daniel Bright85169ab2020-12-14 12:51:08 -0800120 * @param sliceInfo SliceInfo to be used for the data connection when a handover occurs from
121 * EPDG to 5G. It is valid only when accessNetwork is AccessNetwork:NGRAN. If the slice
122 * passed from EPDG is rejected, then the data failure cause must be DataCallFailCause:SLICE_REJECTED.
Hongbo Zeng5bd43602021-01-21 17:23:45 +0800123 * @param trafficDescriptor TrafficDescriptor for which data connection needs to be
124 * established. It is used for URSP traffic matching as described in TS 24.526
125 * Section 4.2.2. It includes an optional DNN which, if present, must be used for traffic
126 * matching -- it does not specify the end point to be used for the data call. The end
127 * point is specified by DataProfileInfo.apn; DataProfileInfo.apn must be used as the end
128 * point if one is not specified through URSP rules.
129 * @param matchAllRuleAllowed bool to indicate if using default match-all URSP rule for this
130 * request is allowed. If false, this request must not use the match-all URSP rule and if
131 * a non-match-all rule is not found (or if URSP rules are not available) it should return
132 * failure with cause DataCallFailCause:MATCH_ALL_RULE_NOT_ALLOWED. This is needed as some
133 * requests need to have a hard failure if the intention cannot be met, for example, a
134 * zero-rating slice.
Jayachandran C9bc276b2020-07-24 00:46:58 -0700135 *
136 * Response function is IRadioResponse.setupDataCallResponse_1_6()
137 *
138 * Note this API is the same as the 1.5
139 */
140 oneway setupDataCall_1_6(int32_t serial, AccessNetwork accessNetwork,
141 DataProfileInfo dataProfileInfo, bool roamingAllowed,
Daniel Bright3c72fba2020-11-03 14:56:23 -0800142 DataRequestReason reason, vec<LinkAddress> addresses, vec<string> dnses,
Hongbo Zeng5bd43602021-01-21 17:23:45 +0800143 int32_t pduSessionId, OptionalSliceInfo sliceInfo,
144 OptionalTrafficDescriptor trafficDescriptor, bool matchAllRuleAllowed);
allenwtsu1c3dcd32020-09-25 17:58:01 +0800145
146 /**
147 * Send an SMS message
148 *
149 * @param serial Serial number of request.
150 * @param message GsmSmsMessage as defined in types.hal
151 *
152 * Response function is IRadioResponse.sendSmsResponse_1_6()
153 *
154 * Note this API is the same as the 1.0
155 *
156 * Based on the return error, caller decides to resend if sending sms
157 * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
158 * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500)
159 */
160 oneway sendSms_1_6(int32_t serial, GsmSmsMessage message);
161
162 /**
163 * Send an SMS message. Identical to sendSms_1_6,
164 * except that more messages are expected to be sent soon. If possible,
165 * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
166 *
167 * @param serial Serial number of request.
168 * @param message GsmSmsMessage as defined in types.hal
169 *
170 * Response function is IRadioResponse.sendSMSExpectMoreResponse_1_6()
171 *
172 * Note this API is the same as the 1.0
173 *
174 * Based on the return error, caller decides to resend if sending sms
175 * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
176 * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500)
177 */
178 oneway sendSMSExpectMore_1_6(int32_t serial, GsmSmsMessage message);
179
180 /**
181 * Send a CDMA SMS message
182 *
183 * @param serial Serial number of request.
184 * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal
185 *
186 * Response callback is IRadioResponse.sendCdmaSmsResponse_1_6()
187 *
188 * Note this API is the same as the 1.0
189 *
190 */
191 oneway sendCdmaSms_1_6(int32_t serial, CdmaSmsMessage sms);
192
193 /**
194 * Send an SMS message. Identical to sendCdmaSms_1_6,
195 * except that more messages are expected to be sent soon.
196 *
197 * @param serial Serial number of request.
198 * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal
199 *
200 * Response callback is IRadioResponse.sendCdmaSMSExpectMoreResponse_1_6()
201 *
202 * Note this API is the same as the 1.5
203 *
204 */
205 oneway sendCdmaSmsExpectMore_1_6(int32_t serial, CdmaSmsMessage sms);
Sooraj Sasindrana9d461b2020-08-14 11:00:11 -0700206
207 /**
Jordan Liue4f5f022020-10-21 16:28:40 -0700208 * Set SIM card power state.
209 * Request is used to power off or power on the card. It should not generate
210 * a CardState.CARDSTATE_ABSENT indication, since the SIM is still physically
211 * inserted.
212 *
213 * @param serial Serial number of request
214 * @param powerUp POWER_DOWN if powering down the SIM card,
215 * POWER_UP if powering up the SIM card,
216 * POWER_UP_PASS_THROUGH if powering up the SIM card in
217 * pass through mode.
218 *
219 * When SIM card is in POWER_UP_PASS_THROUGH, the modem does not send
220 * any command to it (for example SELECT of MF, or TERMINAL
221 * CAPABILITY), and the SIM card is controlled completely by Telephony
222 * sending APDUs directly. The SIM card state must be
223 * RIL_CARDSTATE_PRESENT and the number of card apps will be 0.
224 * No new error code is generated. Emergency calls are supported in
225 * the same way as if the SIM card is absent.
226 * Pass-through mode is valid only for the specific card session where
227 * it is activated, and normal behavior occurs at the next SIM
228 * initialization, unless POWER_UP_PASS_THROUGH is requested again.
229 *
230 * The device is required to power down the SIM card before it can
231 * switch the mode between POWER_UP and POWER_UP_PASS_THROUGH.
232 * At device power up, the SIM interface is powered up automatically.
233 * Each subsequent request to this method is processed only after the
234 * completion of the previous one.
235 *
Jordan Liu8ca952e2020-11-09 15:47:21 -0800236 * When the SIM is in POWER_DOWN, the modem should send an empty vector of
237 * AppStatus in CardStatus.applications. If a SIM in the POWER_DOWN state
238 * is removed and a new SIM is inserted, the new SIM should be in POWER_UP
239 * mode by default. If the device is turned off or restarted while the SIM
240 * is in POWER_DOWN, then the SIM should turn on normally in POWER_UP mode
241 * when the device turns back on.
242 *
Jordan Liue4f5f022020-10-21 16:28:40 -0700243 * Response callback is IRadioResponse.setSimCardPowerResponse_1_6().
244 * Note that this differs from setSimCardPower_1_1 in that the response
245 * callback should only be sent once the device has finished executing
246 * the request (the SIM has finished powering on or off).
247 */
248 oneway setSimCardPower_1_6(int32_t serial, CardPowerState powerUp);
249
250 /**
Sooraj Sasindrana9d461b2020-08-14 11:00:11 -0700251 * Enable or disable E-UTRA-NR dual connectivity. If disabled then UE will not connect
252 * to secondary carrier.
253 *
254 * @param serial Serial number of request.
255 * @param nrDualConnectivityState expected NR dual connectivity state.
256 * 1. Enable NR dual connectivity {NrDualConnectivityState:ENABLE}
257 * 2. Disable NR dual connectivity {NrDualConnectivityState:DISABLE}
258 * 3. Disable NR dual connectivity and force secondary cell to be released
259 * {NrDualConnectivityState:DISABLE_IMMEDIATE}
260
Sooraj Sasindrane9525fd2020-11-03 20:46:57 -0800261 * Response callback is IRadioResponse.setNRDualConnectivityStateResponse()
Sooraj Sasindrana9d461b2020-08-14 11:00:11 -0700262 */
Sooraj Sasindrane9525fd2020-11-03 20:46:57 -0800263 oneway setNrDualConnectivityState(int32_t serial,
Sooraj Sasindrana9d461b2020-08-14 11:00:11 -0700264 NrDualConnectivityState nrDualConnectivityState);
265
266 /**
267 * Is E-UTRA-NR Dual Connectivity enabled
268 *
269 * @param serial Serial number of request.
270 * Response callback is IRadioResponse.isNRDualConnectivityEnabledResponse()
271 */
272 oneway isNrDualConnectivityEnabled(int32_t serial);
Daniel Bright15cc34a2020-10-26 11:34:53 -0700273
274 /**
275 * Reserves an unallocated pdu session id from the pool of ids.
276 *
277 * The allocated id is returned in the response.
278 *
279 * When the id is no longer needed, call releasePduSessionId to
280 * return it to the pool.
281 *
282 * Reference: 3GPP TS 24.007 section 11.2.3.1b
283 *
284 * @param serial Serial number of request.
285 *
286 * Response function is IRadioResponse.allocatePduSessionIdResponse()
287 */
288 oneway allocatePduSessionId(int32_t serial);
289
290 /**
291 * Releases a pdu session id that was previously allocated using
292 * allocatePduSessionId.
293 *
294 * Reference: 3GPP TS 24.007 section 11.2.3.1b
295 * @param serial Serial number of request.
296 * @param id Pdu session id to release.
297 *
298 * Response function is IRadioResponse.releasePduSessionIdResponse()
299 */
300 oneway releasePduSessionId(int32_t serial, int32_t id);
301
302 /**
303 * Indicates that a handover to the IWLAN transport has begun.
304 *
305 * Any resources being transferred to the IWlan transport cannot be released while a
306 * handover is underway. For example, if a pdu session id needs to be
307 * transferred to IWlan, then, the modem should not release the id while
308 * the handover is in progress.
309 *
310 * If a handover was unsuccessful, then the framework calls IRadio::cancelHandover.
311 * The modem retains ownership over any of the resources being transferred to IWlan.
312 *
313 * If a handover was successful, the framework calls IRadio::deactivateDataCall with reason
314 * HANDOVER. The IWlan transport now owns the transferred resources and is responsible for
315 * releasing them.
316 *
317 * @param serial Serial number of request.
318 * @param id callId The identifier of the data call which is provided in SetupDataCallResult
319 *
Daniel Bright3c72fba2020-11-03 14:56:23 -0800320 * Response function is IRadioResponse.startHandoverResponse()
Daniel Bright15cc34a2020-10-26 11:34:53 -0700321 */
Daniel Bright3c72fba2020-11-03 14:56:23 -0800322 oneway startHandover(int32_t serial, int32_t callId);
Daniel Bright15cc34a2020-10-26 11:34:53 -0700323
324 /**
Daniel Bright3c72fba2020-11-03 14:56:23 -0800325 * Indicates that a handover was cancelled after a call to IRadio::startHandover.
Daniel Bright15cc34a2020-10-26 11:34:53 -0700326 *
327 * Since the handover was unsuccessful, the modem retains ownership over any of the resources
328 * being transferred and is still responsible for releasing them.
329 *
330 * @param serial Serial number of request.
331 * @param id callId The identifier of the data call which is provided in SetupDataCallResult
332 *
333 * Response function is IRadioResponse.cancelHandoverResponse()
334 */
335 oneway cancelHandover(int32_t serial, int32_t callId);
Thiébaud Weksteen5ae16f32020-08-21 16:46:07 +0200336
337 /**
338 * Requests to set the network type for searching and registering.
339 *
SongFerngWang3512b3c2021-01-26 03:08:48 +0800340 * Instruct the radio to *only* accept the types of network provided.
341 * setPreferredNetworkType, setPreferredNetworkTypesBitmap will not be called anymore
342 * except for IRadio v1.5 or older devices.
Thiébaud Weksteen5ae16f32020-08-21 16:46:07 +0200343 *
344 * @param serial Serial number of request.
345 * @param networkTypeBitmap a 32-bit bearer bitmap of RadioAccessFamily
346 *
SongFerngWang3512b3c2021-01-26 03:08:48 +0800347 * Response callback is IRadioResponse.setAllowedNetworkTypesBitmapResponse()
Thiébaud Weksteen5ae16f32020-08-21 16:46:07 +0200348 */
SongFerngWang3512b3c2021-01-26 03:08:48 +0800349 oneway setAllowedNetworkTypesBitmap(
Thiébaud Weksteen5ae16f32020-08-21 16:46:07 +0200350 uint32_t serial, bitfield<RadioAccessFamily> networkTypeBitmap);
Jack Nudelman5cd94142020-09-24 14:23:35 -0700351
352 /**
Yomna Nasser5cc53ba2020-11-17 22:00:55 +0000353 * Requests bitmap representing the currently allowed network types.
354 *
SongFerngWang3512b3c2021-01-26 03:08:48 +0800355 * getPreferredNetworkType, getPreferredNetworkTypesBitmap will not be called anymore
356 * except for IRadio v1.5 or older devices.
Yomna Nasser5cc53ba2020-11-17 22:00:55 +0000357 *
358 * @param serial Serial number of request.
359 *
SongFerngWang3512b3c2021-01-26 03:08:48 +0800360 * Response callback is IRadioResponse.getAllowedNetworkTypesBitmapResponse()
Yomna Nasser5cc53ba2020-11-17 22:00:55 +0000361 */
SongFerngWang3512b3c2021-01-26 03:08:48 +0800362 oneway getAllowedNetworkTypesBitmap(uint32_t serial);
Yomna Nasser5cc53ba2020-11-17 22:00:55 +0000363
364 /**
Jack Nudelman5cd94142020-09-24 14:23:35 -0700365 * Control data throttling at modem.
366 * - DataThrottlingAction:NO_DATA_THROTTLING should clear any existing
367 * data throttling within the requested completion window.
368 * - DataThrottlingAction:THROTTLE_SECONDARY_CARRIER: Remove any existing
369 * throttling on anchor carrier and achieve maximum data throttling on
370 * secondary carrier within the requested completion window.
371 * - DataThrottlingAction:THROTTLE_ANCHOR_CARRIER: disable secondary
372 * carrier and achieve maximum data throttling on anchor carrier by
373 * requested completion window.
374 * - DataThrottlingAction:HOLD: Immediately hold on to current level of
375 * throttling.
376 *
377 * @param serial Serial number of request.
378 * @param dataThrottlingAction DataThrottlingAction as defined in types.hal
Jack Nudelman3f765542020-11-18 16:21:06 -0800379 * @param completionDurationMillis window, in milliseconds, in which the
380 * requested throttling action has to be achieved. This must be 0 when
Jack Nudelman5cd94142020-09-24 14:23:35 -0700381 * dataThrottlingAction is DataThrottlingAction:HOLD.
382 *
383 * Response function is IRadioResponse.setDataThrottlingResponse()
384 */
385 oneway setDataThrottling(int32_t serial,
386 DataThrottlingAction dataThrottlingAction,
Jack Nudelman3f765542020-11-18 16:21:06 -0800387 int64_t completionDurationMillis);
Sarah Chinf69abcf2020-11-18 13:40:15 -0800388
389 /**
390 * Get which bands the modem's background scan is acting on.
391 *
392 * @param serial Serial number of request.
393 *
394 * Response callback is IRadioResponse.getSystemSelectionChannelsResponse()
395 */
396 oneway getSystemSelectionChannels(int32_t serial);
Hui Wangfb202502020-11-13 04:30:18 +0000397
Mingming Caida0d9832020-11-05 17:56:57 -0800398 /**
399 * Request all of the current cell information known to the radio. The radio
400 * must return list of all current cells, including the neighboring cells. If for a particular
401 * cell information isn't known then the appropriate unknown value will be returned.
402 * This does not cause or change the rate of unsolicited cellInfoList().
403 *
404 * This is identitcal to getCellInfoList in V1.0, but it requests updated version of CellInfo.
405 *
406 * @param serial Serial number of request.
407 *
408 * Response callback is IRadioResponse.getCellInfoListResponse()
409 */
410 oneway getCellInfoList_1_6(int32_t serial);
411
Hui Wangfb202502020-11-13 04:30:18 +0000412 /**
413 * Request current voice registration state.
414 *
415 * @param serial Serial number of request.
416 *
417 * Response function is IRadioResponse.getVoiceRegistrationStateResponse_1_6()
418 */
419 oneway getVoiceRegistrationState_1_6(int32_t serial);
420
421 /**
Mingming Cai20a2f422020-12-03 12:18:48 -0800422 * Requests current signal strength and associated information. Must succeed if radio is on.
423 *
424 * @param serial Serial number of request.
425 *
426 * Response function is IRadioResponse.getSignalStrengthResponse_1_6()
427 */
428 oneway getSignalStrength_1_6(int32_t serial);
429
430 /**
Hui Wangfb202502020-11-13 04:30:18 +0000431 * Request current data registration state.
432 *
433 * @param serial Serial number of request.
434 *
435 * Response function is IRadioResponse.getDataRegistrationStateResponse_1_6()
436 */
437 oneway getDataRegistrationState_1_6(int32_t serial);
Shinsuke Ishiokaede1e952018-08-17 18:02:29 +0900438
439 /**
440 * Requests current call list
441 *
442 * @param serial Serial number of request.
443 *
444 * Response function is IRadioResponse.getCurrentCallsResponse_1_6()
445 */
446 oneway getCurrentCalls_1_6(int32_t serial);
Jayachandran C262b6062020-07-22 15:53:58 -0700447};