1 /*
2  * Copyright (C) 2021 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 
17 package android.hardware.radio.modem;
18 
19 import android.hardware.radio.RadioResponseInfo;
20 import android.hardware.radio.modem.ActivityStatsInfo;
21 import android.hardware.radio.modem.HardwareConfig;
22 import android.hardware.radio.modem.ImeiInfo;
23 import android.hardware.radio.modem.RadioCapability;
24 
25 /**
26  * Interface declaring response functions to solicited radio requests for modem APIs.
27  * @hide
28  */
29 @VintfStability
30 oneway interface IRadioModemResponse {
31     /**
32      * Acknowledge the receipt of radio request sent to the vendor. This must be sent only for
33      * radio request which take long time to respond. For more details, refer
34      * https://source.android.com/devices/tech/connect/ril.html
35      *
36      * @param serial Serial no. of the request whose acknowledgement is sent.
37      */
acknowledgeRequest(in int serial)38     void acknowledgeRequest(in int serial);
39 
40     /**
41      * @param info Response info struct containing response type, serial no. and error
42      *
43      * Valid errors returned:
44      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
45      *   RadioError:NONE
46      *   RadioError:RADIO_NOT_AVAILABLE
47      *   RadioError:MODEM_ERR
48      *   RadioError:INVALID_STATE: this is for the case that the API is called in a single-sim
49      *              mode, or when there is only one modem available, as this API should only
50      *              be called in multi sim status.
51      */
enableModemResponse(in RadioResponseInfo info)52     void enableModemResponse(in RadioResponseInfo info);
53 
54     /**
55      * @param info Response info struct containing response type, serial no. and error
56      * @param version string containing version string for log reporting
57      *
58      * Valid errors returned:
59      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
60      *   RadioError:NONE
61      *   RadioError:RADIO_NOT_AVAILABLE
62      *   RadioError:EMPTY_RECORD
63      *   RadioError:NO_MEMORY
64      *   RadioError:INTERNAL_ERR
65      *   RadioError:SYSTEM_ERR
66      *   RadioError:MODEM_ERR
67      *   RadioError:NOT_PROVISIONED
68      *   RadioError:NO_RESOURCES
69      *   RadioError:CANCELLED
70      */
getBasebandVersionResponse(in RadioResponseInfo info, in String version)71     void getBasebandVersionResponse(in RadioResponseInfo info, in String version);
72 
73     /**
74      * @param info Response info struct containing response type, serial no. and error
75      * @param imei IMEI if GSM subscription is available
76      * @param imeisv IMEISV if GSM subscription is available
77      * @param esn ESN if CDMA subscription is available
78      * @param meid MEID if CDMA subscription is available
79      *
80      * If a empty string value is returned for any of the device id, it means that there was error
81      * accessing the device.
82      *
83      * Valid errors returned:
84      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
85      *   RadioError:NONE
86      *   RadioError:RADIO_NOT_AVAILABLE
87      *   RadioError:NO_MEMORY
88      *   RadioError:INTERNAL_ERR
89      *   RadioError:SYSTEM_ERR
90      *   RadioError:INVALID_ARGUMENTS
91      *   RadioError:MODEM_ERR
92      *   RadioError:NOT_PROVISIONED
93      *   RadioError:NO_RESOURCES
94      *   RadioError:CANCELLED
95      *   RadioError:REQUEST_NOT_SUPPORTED
96      * @deprecated use getImeiResponse(RadioResponseInfo responseInfo, ImeiInfo imeiInfo)
97      */
getDeviceIdentityResponse(in RadioResponseInfo info, in String imei, in String imeisv, in String esn, in String meid)98     void getDeviceIdentityResponse(in RadioResponseInfo info, in String imei, in String imeisv,
99             in String esn, in String meid);
100 
101     /**
102      * @param info Response info struct containing response type, serial no. and error
103      * @param config Array of HardwareConfig of the radio.
104      *
105      * Valid errors returned:
106      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
107      *   RadioError:NONE
108      *   RadioError:RADIO_NOT_AVAILABLE
109      */
getHardwareConfigResponse(in RadioResponseInfo info, in HardwareConfig[] config)110     void getHardwareConfigResponse(in RadioResponseInfo info, in HardwareConfig[] config);
111 
112     /**
113      * @param info Response info struct containing response type, serial no. and error
114      * @param activityInfo modem activity information
115      *
116      * Valid errors returned:
117      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
118      *                                    defined
119      *   RadioError:NONE
120      *   RadioError:RADIO_NOT_AVAILABLE
121      *   RadioError:NO_MEMORY
122      *   RadioError:INTERNAL_ERR
123      *   RadioError:SYSTEM_ERR
124      *   RadioError:MODEM_ERR
125      *   RadioError:NOT_PROVISIONED
126      *   RadioError:NO_RESOURCES
127      *   RadioError:CANCELLED
128      */
getModemActivityInfoResponse(in RadioResponseInfo info, in ActivityStatsInfo activityInfo)129     void getModemActivityInfoResponse(in RadioResponseInfo info, in ActivityStatsInfo activityInfo);
130 
131     /**
132      * @param info Response info struct containing response type, serial no. and error
133      *
134      * Valid errors returned:
135      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
136      *   RadioError:NONE
137      *   RadioError:RADIO_NOT_AVAILABLE
138      *   RadioError:MODEM_ERR
139      */
getModemStackStatusResponse(in RadioResponseInfo info, in boolean isEnabled)140     void getModemStackStatusResponse(in RadioResponseInfo info, in boolean isEnabled);
141 
142     /**
143      * @param info Response info struct containing response type, serial no. and error
144      * @param rc Radio capability as defined by RadioCapability in types.hal
145      *
146      * Valid errors returned:
147      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
148      *                                    defined
149      *   RadioError:NONE
150      *   RadioError:RADIO_NOT_AVAILABLE
151      *   RadioError:OPERATION_NOT_ALLOWED
152      *   RadioError:INVALID_STATE
153      *   RadioError:INTERNAL_ERR
154      *   RadioError:NO_MEMORY
155      *   RadioError:NO_RESOURCES
156      *   RadioError:CANCELLED
157      */
getRadioCapabilityResponse(in RadioResponseInfo info, in RadioCapability rc)158     void getRadioCapabilityResponse(in RadioResponseInfo info, in RadioCapability rc);
159 
160     /**
161      * @param info Response info struct containing response type, serial no. and error
162      * @param result string containing the contents of the NV item
163      *
164      * Valid errors returned:
165      *   RadioError:NONE
166      *   RadioError:RADIO_NOT_AVAILABLE
167      *
168      * @deprecated NV APIs are deprecated starting from Android U.
169      */
nvReadItemResponse(in RadioResponseInfo info, in String result)170     void nvReadItemResponse(in RadioResponseInfo info, in String result);
171 
172     /**
173      * @param info Response info struct containing response type, serial no. and error
174      *
175      * Valid errors returned:
176      *   RadioError:NONE
177      *   RadioError:RADIO_NOT_AVAILABLE
178      *
179      * Note: This will be deprecated in favor of a rebootModemResponse API in Android U.
180      */
nvResetConfigResponse(in RadioResponseInfo info)181     void nvResetConfigResponse(in RadioResponseInfo info);
182 
183     /**
184      * @param info Response info struct containing response type, serial no. and error
185      *
186      * Valid errors returned:
187      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
188      *   RadioError:NONE
189      *   RadioError:RADIO_NOT_AVAILABLE
190      *
191      * @deprecated NV APIs are deprecated starting from Android U.
192      */
nvWriteCdmaPrlResponse(in RadioResponseInfo info)193     void nvWriteCdmaPrlResponse(in RadioResponseInfo info);
194 
195     /**
196      * @param info Response info struct containing response type, serial no. and error
197      *
198      * Valid errors returned:
199      *   RadioError:NONE
200      *   RadioError:RADIO_NOT_AVAILABLE
201      *
202      * @deprecated NV APIs are deprecated starting from Android U.
203      */
nvWriteItemResponse(in RadioResponseInfo info)204     void nvWriteItemResponse(in RadioResponseInfo info);
205 
206     /**
207      * @param info Response info struct containing response type, serial no. and error
208      *
209      * Valid errors returned:
210      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
211      *                                    defined
212      *   RadioError:NONE
213      *   RadioError:RADIO_NOT_AVAILABLE
214      *   RadioError:OPERATION_NOT_ALLOWED
215      *   RadioError:NO_MEMORY
216      *   RadioError:INTERNAL_ERR
217      *   RadioError:SYSTEM_ERR
218      *   RadioError:NO_RESOURCES
219      *   RadioError:CANCELLED
220      */
requestShutdownResponse(in RadioResponseInfo info)221     void requestShutdownResponse(in RadioResponseInfo info);
222 
223     /**
224      * @param info Response info struct containing response type, serial no. and error
225      *
226      * Valid errors returned:
227      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
228      *   RadioError:NONE
229      *   RadioError:RADIO_NOT_AVAILABLE
230      *   RadioError:NO_MEMORY
231      *   RadioError:INTERNAL_ERR
232      *   RadioError:SYSTEM_ERR
233      *   RadioError:INVALID_ARGUMENTS
234      *   RadioError:NO_RESOURCES
235      *   RadioError:CANCELLED
236      */
sendDeviceStateResponse(in RadioResponseInfo info)237     void sendDeviceStateResponse(in RadioResponseInfo info);
238 
239     /**
240      * @param info Response info struct containing response type, serial no. and error
241      * @param rc Radio capability as defined by RadioCapability in types.hal used to
242      *        feedback return status
243      *
244      * Valid errors returned:
245      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
246      *                                    defined
247      *   RadioError:NONE means a unsol radioCapability() will be sent within 30 seconds.
248      *   RadioError:RADIO_NOT_AVAILABLE
249      *   RadioError:OPERATION_NOT_ALLOWED
250      *   RadioError:NO_MEMORY
251      *   RadioError:INTERNAL_ERR
252      *   RadioError:SYSTEM_ERR
253      *   RadioError:INVALID_ARGUMENTS
254      *   RadioError:MODEM_ERR
255      *   RadioError:INVALID_STATE
256      *   RadioError:NO_RESOURCES
257      *   RadioError:CANCELLED
258      */
setRadioCapabilityResponse(in RadioResponseInfo info, in RadioCapability rc)259     void setRadioCapabilityResponse(in RadioResponseInfo info, in RadioCapability rc);
260 
261     /**
262      * @param info Response info struct containing response type, serial no. and error
263      *
264      * Valid errors returned:
265      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
266      *                                    defined
267      *   RadioError:NONE
268      *   RadioError:INTERNAL_ERR
269      *   RadioError:INVALID_ARGUMENTS
270      *   RadioError:RF_HARDWARE_ISSUE
271      *   RadioError:NO_RF_CALIBRATION_INFO
272      */
setRadioPowerResponse(in RadioResponseInfo info)273     void setRadioPowerResponse(in RadioResponseInfo info);
274 
275     /**
276      * ImeiInfo to encapsulate the IMEI information from modem. When the return error code
277      * is {@code RadioError:NONE}, {@code imeiInfo} must be non-null, and a valid IMEITYPE,
278      * IMEI and SVN must be filled in {@code imeiInfo}. When the error code is not
279      * {@code RadioError:NONE}, {@code imeiInfo} must be {@code null}.
280      *
281      * @param responseInfo Response info struct containing response type, serial no. and error
282      * @param imeiInfo IMEI information
283      *
284      * Valid errors returned:
285      *   RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.gsm is not defined
286      *   RadioError:NONE
287      *   RadioError:RADIO_NOT_AVAILABLE
288      *   RadioError:MODEM_ERR
289      */
getImeiResponse(in RadioResponseInfo responseInfo, in @nullable ImeiInfo imeiInfo)290     void getImeiResponse(in RadioResponseInfo responseInfo, in @nullable ImeiInfo imeiInfo);
291 }
292