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.network;
18 
19 import android.hardware.radio.RadioIndicationType;
20 import android.hardware.radio.RadioTechnology;
21 import android.hardware.radio.network.BarringInfo;
22 import android.hardware.radio.network.CellIdentity;
23 import android.hardware.radio.network.CellInfo;
24 import android.hardware.radio.network.CellularIdentifierDisclosure;
25 import android.hardware.radio.network.EmergencyRegResult;
26 import android.hardware.radio.network.LinkCapacityEstimate;
27 import android.hardware.radio.network.NetworkScanResult;
28 import android.hardware.radio.network.PhoneRestrictedState;
29 import android.hardware.radio.network.PhysicalChannelConfig;
30 import android.hardware.radio.network.SecurityAlgorithmUpdate;
31 import android.hardware.radio.network.SignalStrength;
32 import android.hardware.radio.network.SuppSvcNotification;
33 
34 /**
35  * Interface declaring unsolicited radio indications for network APIs.
36  * @hide
37  */
38 @VintfStability
39 oneway interface IRadioNetworkIndication {
40     /**
41      * Indicate barring information for the user’s access category / access class and PLMN.
42      *
43      * <p>Provide information about the barring status of the cell for the user. The information
44      * provided should describe all barring configurations that are applicable to the current user,
45      * even if the user is not currently barred (due to conditional barring). This informs Android
46      * of likely future (statistical) barring for specific services.
47      *
48      * <p>This indication should be sent whenever the cell’s barring config changes for the current
49      * user, or if the user’s conditional barring status changes due to re-evaluation of the
50      * barring conditions. Barring status will likely change when the device camps for service,
51      * when PLMN selection is completed, when the device attempts to access a conditionally barred
52      * service, and when the System Information including barring info for a camped cell is updated.
53      *
54      * @param type Type of radio indication
55      * @param cellIdentity cellIdentity for the barring infos
56      * @param barringInfos a vector of BarringInfos for all barring service types
57      */
barringInfoChanged(in RadioIndicationType type, in CellIdentity cellIdentity, in BarringInfo[] barringInfos)58     void barringInfoChanged(in RadioIndicationType type, in CellIdentity cellIdentity,
59             in BarringInfo[] barringInfos);
60 
61     /**
62      * Indicates when PRL (preferred roaming list) changes.
63      *
64      * @param type Type of radio indication
65      * @param version PRL version after PRL changes
66      */
cdmaPrlChanged(in RadioIndicationType type, in int version)67     void cdmaPrlChanged(in RadioIndicationType type, in int version);
68 
69     /**
70      * Report all of the current cell information known to the radio.
71      *
72      * @param type Type of radio indication
73      * @param records Current cell information
74      */
cellInfoList(in RadioIndicationType type, in CellInfo[] records)75     void cellInfoList(in RadioIndicationType type, in CellInfo[] records);
76 
77     /**
78      * Indicates current link capacity estimate. This indication is sent whenever the reporting
79      * criteria, as set by IRadioNetwork.setLinkCapacityReportingCriteria(), are met and the
80      * indication is not suppressed by IRadioNetwork.setIndicationFilter().
81      *
82      * @param type Type of radio indication
83      * @param lce LinkCapacityEstimate
84      */
currentLinkCapacityEstimate(in RadioIndicationType type, in LinkCapacityEstimate lce)85     void currentLinkCapacityEstimate(in RadioIndicationType type, in LinkCapacityEstimate lce);
86 
87     /**
88      * Indicates physical channel configurations. An empty configs list shall be returned when the
89      * radio is in idle mode (i.e. RRC idle).
90      *
91      * @param type Type of radio indication
92      * @param configs Vector of PhysicalChannelConfigs
93      */
currentPhysicalChannelConfigs( in RadioIndicationType type, in PhysicalChannelConfig[] configs)94     void currentPhysicalChannelConfigs(
95             in RadioIndicationType type, in PhysicalChannelConfig[] configs);
96 
97     /**
98      * Indicates current signal strength of the radio.
99      *
100      * @param type Type of radio indication
101      * @param signalStrength SignalStrength information
102      */
currentSignalStrength(in RadioIndicationType type, in SignalStrength signalStrength)103     void currentSignalStrength(in RadioIndicationType type, in SignalStrength signalStrength);
104 
105     /**
106      * Indicates when IMS registration state has changed. To get IMS registration state and IMS SMS
107      * format, callee needs to invoke getImsRegistrationState().
108      *
109      * @param type Type of radio indication
110      */
imsNetworkStateChanged(in RadioIndicationType type)111     void imsNetworkStateChanged(in RadioIndicationType type);
112 
113     /**
114      * Incremental network scan results.
115      *
116      * @param type Type of radio indication
117      * @param result the result of the network scan
118      */
networkScanResult(in RadioIndicationType type, in NetworkScanResult result)119     void networkScanResult(in RadioIndicationType type, in NetworkScanResult result);
120 
121     /**
122      * Indicates when voice or data network state changed. Callee must invoke
123      * IRadioNetwork.getVoiceRegistrationState(), IRadioNetwork.getDataRegistrationState(), and
124      * IRadioNetwork.getOperator()
125      *
126      * @param type Type of radio indication
127      */
networkStateChanged(in RadioIndicationType type)128     void networkStateChanged(in RadioIndicationType type);
129 
130     /**
131      * Indicates when radio has received a NITZ time message.
132      *
133      * @param type Type of radio indication
134      * @param nitzTime NITZ time string in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
135      * @param receivedTimeMs time (in milliseconds since boot) at which RIL sent the NITZ time to
136      *        the framework
137      * @param ageMs time in milliseconds indicating how long NITZ was cached in RIL and modem.
138      *        This must track true age and therefore must be calculated using clocks that
139      *        include the time spend in sleep / low power states. If it can not be guaranteed,
140      *        there must not be any caching done at the modem and should fill in 0 for ageMs
141      */
nitzTimeReceived( in RadioIndicationType type, in String nitzTime, in long receivedTimeMs, in long ageMs)142     void nitzTimeReceived(
143             in RadioIndicationType type, in String nitzTime, in long receivedTimeMs, in long ageMs);
144 
145     /**
146      * Report that Registration or a Location/Routing/Tracking Area update has failed.
147      *
148      * <p>Indicate whenever a registration procedure, including a location, routing, or tracking
149      * area update fails. This includes procedures that do not necessarily result in a change of
150      * the modem's registration status. If the modem's registration status changes, that is
151      * reflected in the onNetworkStateChanged() and subsequent get{Voice/Data}RegistrationState().
152      *
153      * @param cellIdentity the CellIdentity, which must include the globally unique identifier for
154      *        the cell (for example, all components of the CGI or ECGI).
155      * @param chosenPlmn a 5 or 6 digit alphanumeric PLMN (MCC|MNC) among those broadcast by the
156      *        cell that was chosen for the failed registration attempt.
157      * @param domain Domain::CS, Domain::PS, or both in case of a combined procedure.
158      * @param causeCode the primary failure cause code of the procedure.
159      *        For GSM/UMTS (MM), values are in TS 24.008 Sec 10.5.95
160      *        For GSM/UMTS (GMM), values are in TS 24.008 Sec 10.5.147
161      *        For LTE (EMM), cause codes are TS 24.301 Sec 9.9.3.9
162      *        For NR (5GMM), cause codes are TS 24.501 Sec 9.11.3.2
163      *        MAX_INT if this value is unused.
164      * @param additionalCauseCode the cause code of any secondary/combined procedure if appropriate.
165      *        For UMTS, if a combined attach succeeds for PS only, then the GMM cause code shall be
166      *        included as an additionalCauseCode.
167      *        For LTE (ESM), cause codes are in TS 24.301 9.9.4.4
168      *        MAX_INT if this value is unused.
169      */
registrationFailed(in RadioIndicationType type, in CellIdentity cellIdentity, in String chosenPlmn, in int domain, in int causeCode, in int additionalCauseCode)170     void registrationFailed(in RadioIndicationType type, in CellIdentity cellIdentity,
171             in String chosenPlmn, in int domain, in int causeCode, in int additionalCauseCode);
172 
173     /**
174      * Indicates a restricted state change (eg, for Domain Specific Access Control).
175      * Radio must send this msg after radio off/on cycle no matter it is changed or not.
176      *
177      * @param type Type of radio indication
178      * @param state Bitmask of restricted state as defined by PhoneRestrictedState
179      */
restrictedStateChanged(in RadioIndicationType type, in PhoneRestrictedState state)180     void restrictedStateChanged(in RadioIndicationType type, in PhoneRestrictedState state);
181 
182     /**
183      * Reports supplementary service related notification from the network.
184      *
185      * @param type Type of radio indication
186      * @param suppSvc SuppSvcNotification
187      */
suppSvcNotify(in RadioIndicationType type, in SuppSvcNotification suppSvc)188     void suppSvcNotify(in RadioIndicationType type, in SuppSvcNotification suppSvc);
189 
190     /**
191      * Indicates that voice technology has changed. Responds with new rat.
192      *
193      * @param type Type of radio indication
194      * @param rat Current new voice rat
195      */
voiceRadioTechChanged(in RadioIndicationType type, in RadioTechnology rat)196     void voiceRadioTechChanged(in RadioIndicationType type, in RadioTechnology rat);
197 
198     /**
199      * Emergency Scan Results.
200      *
201      * @param type Type of radio indication
202      * @param result the result of the Emergency Network Scan
203      */
emergencyNetworkScanResult(in RadioIndicationType type, in EmergencyRegResult result)204     void emergencyNetworkScanResult(in RadioIndicationType type, in EmergencyRegResult result);
205 
206     /**
207      * Report a cellular identifier disclosure event. See
208      * IRadioNetwork.setCellularIdnetifierTransparencyEnabled for more details.
209      *
210      * A non-exhaustive list of when this method should be called follows:
211      *
212      * - If a device attempts an IMSI attach to the network.
213      * - If a device includes an IMSI in the IDENTITY_RESPONSE message on the NAS and a security
214      * context has not yet been established.
215      * - If a device includes an IMSI in a DETACH_REQUEST message sent on the NAS and the message is
216      * sent before a security context has been established.
217      * - If a device includes an IMSI in a TRACKING_AREA_UPDATE message sent on the NAS and the
218      * message is sent before a security context has been established.
219      * - If a device uses a 2G network to send a LOCATION_UPDATE_REQUEST message on the NAS that
220      * includes an IMSI or IMEI.
221      * - If a device uses a 2G network to send a AUTHENTICATION_AND_CIPHERING_RESPONSE message on
222      * the NAS and the message includes an IMEISV.
223      *
224      * @param type Type of radio indication
225      * @param disclosure A CellularIdentifierDisclosure as specified by
226      *         IRadioNetwork.setCellularIdentifierTransparencyEnabled.
227      *
228      */
cellularIdentifierDisclosed( in RadioIndicationType type, in CellularIdentifierDisclosure disclosure)229     void cellularIdentifierDisclosed(
230             in RadioIndicationType type, in CellularIdentifierDisclosure disclosure);
231 
232     /*
233      * Indicates that a new ciphering or integrity algorithm was used for a particular voice,
234      * signaling, or data connection for a given PLMN and/or access network. Due to power
235      * concerns, once a connection type has been reported on, follow-up reports about that
236      * connection type are only generated if there is any change to the most-recently reported
237      * encryption or integrity, or if the value of SecurityAlgorithmUpdate#isUnprotectedEmergency
238      * changes. A change only in cell ID should not trigger an update, as the design is intended
239      * to be agnostic to dual connectivity ("secondary serving cells").
240      *
241      * Sample scenario to further clarify "most-recently reported":
242      *
243      * 1. Modem reports user is connected to a null-ciphered 3G network.
244      * 2. User then moves and connects to a well-ciphered 5G network, and modem reports this.
245      * 3. User returns to original location and reconnects to the null-ciphered 3G network. Modem
246      *    should report this as it's different than the most-recently reported data from step (2).
247      *
248      * State is reset when (1) RadioState is transitioned to ON from any other state (e.g. radio
249      * is turned on during device boot, or modem boot), and (2) when CardState is transitioned
250      * to PRESENT from any other state (e.g. when SIM is inserted), or (3) if there is a change in
251      * access network (PLMN).
252      *
253      * @param type Type of radio indication
254      * @param securityAlgorithmUpdate SecurityAlgorithmUpdate encapsulates details of security
255      *         algorithm updates
256      */
securityAlgorithmsUpdated( in RadioIndicationType type, in SecurityAlgorithmUpdate securityAlgorithmUpdate)257     void securityAlgorithmsUpdated(
258             in RadioIndicationType type, in SecurityAlgorithmUpdate securityAlgorithmUpdate);
259 }
260