1/*
2 * Copyright (C) 2018 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.4;
18
19import @1.0::RadioResponseInfo;
20import @1.3::IRadioResponse;
21import @1.4::CardStatus;
22import @1.4::CarrierRestrictionsWithPriority;
23import @1.4::CellInfo;
24import @1.4::DataRegStateResult;
25import @1.4::RadioAccessFamily;
26import @1.4::SetupDataCallResult;
27import @1.4::SignalStrength;
28import @1.4::SimLockMultiSimPolicy;
29
30/**
31 * Interface declaring response functions to solicited radio requests.
32 */
33interface IRadioResponse extends @1.3::IRadioResponse {
34    /**
35     * @param info Response info struct containing response type, serial no. and error
36     *
37     * Valid errors returned:
38     *   RadioError:NONE
39     *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
40     *   RadioError:DIAL_MODIFIED_TO_USSD
41     *   RadioError:DIAL_MODIFIED_TO_SS
42     *   RadioError:DIAL_MODIFIED_TO_DIAL
43     *   RadioError:INVALID_ARGUMENTS
44     *   RadioError:NO_RESOURCES
45     *   RadioError:INTERNAL_ERR
46     *   RadioError:FDN_CHECK_FAILURE
47     *   RadioError:MODEM_ERR
48     *   RadioError:NO_SUBSCRIPTION
49     *   RadioError:NO_NETWORK_FOUND
50     *   RadioError:INVALID_CALL_ID
51     *   RadioError:DEVICE_IN_USE
52     *   RadioError:ABORTED
53     *   RadioError:INVALID_MODEM_STATE
54     */
55    oneway emergencyDialResponse(RadioResponseInfo info);
56
57    /**
58     * @param info Response info struct containing response type, serial no. and error
59     *
60     * Same API as @1.1::IRadioResponse.startNetworkScanResponse, except disallowing error codes
61     * OPERATION_NOT_ALLOWED and REQUEST_NOT_SUPPORTED.
62     *
63     * Valid errors returned:
64     *   RadioError:NONE
65     *   RadioError:RADIO_NOT_AVAILABLE
66     *   RadioError:DEVICE_IN_USE
67     *   RadioError:INTERNAL_ERR
68     *   RadioError:MODEM_ERR
69     *   RadioError:INVALID_ARGUMENTS
70     */
71    oneway startNetworkScanResponse_1_4(RadioResponseInfo info);
72
73    /**
74     * @param info Response info struct containing response type, serial no. and error
75     * @param cellInfo List of current cell information known to radio
76     *
77     * Valid errors returned:
78     *   RadioError:NONE
79     *   RadioError:RADIO_NOT_AVAILABLE
80     *   RadioError:INTERNAL_ERR
81     */
82    oneway getCellInfoListResponse_1_4(RadioResponseInfo info, vec<CellInfo> cellInfo);
83
84    /**
85     * @param info Response info struct containing response type, serial no. and error
86     * @param dataRegResponse Current Data registration response as defined by DataRegStateResult in
87     *        types.hal
88     *
89     * Valid errors returned:
90     *   RadioError:NONE
91     *   RadioError:RADIO_NOT_AVAILABLE
92     *   RadioError:INTERNAL_ERR
93     *   RadioError:NOT_PROVISIONED
94     */
95    oneway getDataRegistrationStateResponse_1_4(RadioResponseInfo info,
96            DataRegStateResult dataRegResponse);
97
98    /**
99     * @param info Response info struct containing response type, serial no. and error
100     * @param cardStatus ICC card status as defined by CardStatus in types.hal
101     *
102     * Valid errors returned:
103     *   RadioError:NONE
104     *   RadioError:RADIO_NOT_AVAILABLE
105     *   RadioError:INTERNAL_ERR
106     *   RadioError:NO_RESOURCES
107     *   RadioError:REQUEST_NOT_SUPPORTED
108     */
109    oneway getIccCardStatusResponse_1_4(RadioResponseInfo info, CardStatus cardStatus);
110
111    /**
112     * @param info Response info struct containing response type, serial no. and error
113     * @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily.
114     *
115     * Valid errors returned:
116     *   RadioError:NONE
117     *   RadioError:RADIO_NOT_AVAILABLE
118     *   RadioError:INTERNAL_ERR
119     *   RadioError:INVALID_ARGUMENTS
120     *   RadioError:MODEM_ERR
121     *   RadioError:REQUEST_NOT_SUPPORTED
122     *   RadioError:NO_RESOURCES
123     */
124    oneway getPreferredNetworkTypeBitmapResponse(RadioResponseInfo info,
125            bitfield<RadioAccessFamily> networkTypeBitmap);
126
127    /**
128     * Callback of IRadio.setPreferredNetworkTypeBitmap(int, bitfield<RadioAccessFamily>)
129     *
130     * @param info Response info struct containing response type, serial no. and error
131     *
132     * Valid errors returned:
133     *   RadioError:NONE
134     *   RadioError:RADIO_NOT_AVAILABLE
135     *   RadioError:OPERATION_NOT_ALLOWED
136     *   RadioError:MODE_NOT_SUPPORTED
137     *   RadioError:INTERNAL_ERR
138     *   RadioError:INVALID_ARGUMENTS
139     *   RadioError:MODEM_ERR
140     *   RadioError:REQUEST_NOT_SUPPORTED
141     *   RadioError:NO_RESOURCES
142     */
143    oneway setPreferredNetworkTypeBitmapResponse(RadioResponseInfo info);
144
145    /**
146     * @param info Response info struct containing response type, serial no. and error
147     * @param dcResponse List of DataCallResult as defined in types.hal
148     *
149     * Valid errors returned:
150     *   RadioError:NONE
151     *   RadioError:RADIO_NOT_AVAILABLE
152     *   RadioError:INTERNAL_ERR
153     *   RadioError:NO_RESOURCES
154     *   RadioError:REQUEST_NOT_SUPPORTED
155     *   RadioError:SIM_ABSENT
156     */
157    oneway getDataCallListResponse_1_4(RadioResponseInfo info, vec<SetupDataCallResult> dcResponse);
158
159    /**
160     * @param info Response info struct containing response type, serial no. and error
161     * @param dcResponse SetupDataCallResult defined in types.hal
162     *
163     * Valid errors returned:
164     *   RadioError:NONE must be returned on both success and failure of setup with the
165     *              DataCallResponse.status containing the actual status
166     *              For all other errors the DataCallResponse is ignored.
167     *   RadioError:RADIO_NOT_AVAILABLE
168     *   RadioError:OP_NOT_ALLOWED_BEFORE_REG_TO_NW
169     *   RadioError:OP_NOT_ALLOWED_DURING_VOICE_CALL
170     *   RadioError:REQUEST_NOT_SUPPORTED
171     *   RadioError:INVALID_ARGUMENTS
172     *   RadioError:INTERNAL_ERR
173     *   RadioError:NO_RESOURCES
174     *   RadioError:SIM_ABSENT
175     */
176    oneway setupDataCallResponse_1_4(RadioResponseInfo info, SetupDataCallResult dcResponse);
177
178    /**
179     * @param info Response info struct containing response type, serial no. and error
180     *
181     * Valid errors returned:
182     *   RadioError:NONE
183     *   RadioError:RADIO_NOT_AVAILABLE
184     *   RadioError:INVALID_ARGUMENTS
185     *   RadioError:REQUEST_NOT_SUPPORTED
186     */
187    oneway setAllowedCarriersResponse_1_4(RadioResponseInfo info);
188
189    /**
190     * Expected modem behavior:
191     *  Return list of allowed carriers, and if all carriers are allowed.
192     *
193     * @param info Response info struct containing response type, serial no. and error
194     * @param carriers Carrier restriction information.
195     * @param multiSimPolicy Policy used for devices with multiple SIM cards.
196     *
197     * Valid errors returned:
198     *   RadioError:NONE
199     *   RadioError:RADIO_NOT_AVAILABLE
200     *   RadioError:REQUEST_NOT_SUPPORTED
201     */
202    oneway getAllowedCarriersResponse_1_4(RadioResponseInfo info,
203            CarrierRestrictionsWithPriority carriers, SimLockMultiSimPolicy multiSimPolicy);
204
205    /**
206     * @param signalStrength Current signal strength
207     *
208     * Valid errors returned:
209     *   RadioError:NONE
210     *   RadioError:RADIO_NOT_AVAILABLE
211     *   RadioError:INTERNAL_ERR
212     */
213    oneway getSignalStrengthResponse_1_4(RadioResponseInfo info, SignalStrength signalStrength);
214};
215