1 /*
2  * Copyright (C) 2016 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 com.android.internal.telephony;
18 
19 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CALL_RING;
20 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION;
21 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_CALL_WAITING;
22 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_INFO_REC;
23 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_OTA_PROVISION_STATUS;
24 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL;
25 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED;
26 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CELL_INFO_LIST;
27 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_DATA_CALL_LIST_CHANGED;
28 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_EMERGENCY_NUMBER_LIST;
29 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE;
30 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE;
31 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_HARDWARE_CONFIG_CHANGED;
32 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_KEEPALIVE_STATUS;
33 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_LCEDATA_RECV;
34 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_MODEM_RESTART;
35 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_NETWORK_SCAN_RESULT;
36 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_NITZ_TIME_RECEIVED;
37 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_ON_SS;
38 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_ON_USSD;
39 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_PCO_DATA;
40 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_PHYSICAL_CHANNEL_CONFIG;
41 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RADIO_CAPABILITY;
42 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESEND_INCALL_MUTE;
43 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED;
44 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_CDMA_NEW_SMS;
45 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED;
46 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED;
47 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS;
48 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS;
49 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM;
50 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT;
51 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED;
52 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_SIM_PHONEBOOK_CHANGED;
53 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_SIM_PHONEBOOK_RECORDS_RECEIVED;
54 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED;
55 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESTRICTED_STATE_CHANGED;
56 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RIL_CONNECTED;
57 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RINGBACK_TONE;
58 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_SIGNAL_STRENGTH;
59 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_SIM_REFRESH;
60 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_SIM_SMS_STORAGE_FULL;
61 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_SRVCC_STATE_NOTIFY;
62 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_CALL_SETUP;
63 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_CC_ALPHA_NOTIFY;
64 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_EVENT_NOTIFY;
65 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_PROACTIVE_COMMAND;
66 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_STK_SESSION_END;
67 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_SUPP_SVC_NOTIFICATION;
68 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UICC_APPLICATIONS_ENABLEMENT_CHANGED;
69 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED;
70 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UNTHROTTLE_APN;
71 import static com.android.internal.telephony.RILConstants.RIL_UNSOL_VOICE_RADIO_TECH_CHANGED;
72 import static com.android.internal.telephony.RILConstants.RIL_UNSOl_CDMA_PRL_CHANGED;
73 
74 import android.hardware.radio.V1_0.CdmaCallWaiting;
75 import android.hardware.radio.V1_0.CdmaInformationRecord;
76 import android.hardware.radio.V1_0.CdmaLineControlInfoRecord;
77 import android.hardware.radio.V1_0.CdmaNumberInfoRecord;
78 import android.hardware.radio.V1_0.CdmaRedirectingNumberInfoRecord;
79 import android.hardware.radio.V1_0.CdmaSignalInfoRecord;
80 import android.hardware.radio.V1_0.CdmaSmsMessage;
81 import android.hardware.radio.V1_0.CdmaT53AudioControlInfoRecord;
82 import android.hardware.radio.V1_0.CfData;
83 import android.hardware.radio.V1_0.LceDataInfo;
84 import android.hardware.radio.V1_0.PcoDataInfo;
85 import android.hardware.radio.V1_0.SimRefreshResult;
86 import android.hardware.radio.V1_0.SsInfoData;
87 import android.hardware.radio.V1_0.StkCcUnsolSsResult;
88 import android.hardware.radio.V1_0.SuppSvcNotification;
89 import android.hardware.radio.V1_2.CellConnectionStatus;
90 import android.hardware.radio.V1_6.IRadioIndication;
91 import android.hardware.radio.V1_6.PhonebookRecordInfo;
92 import android.hardware.radio.V1_6.PhysicalChannelConfig.Band;
93 import android.os.AsyncResult;
94 import android.os.RemoteException;
95 import android.sysprop.TelephonyProperties;
96 import android.telephony.Annotation.RadioPowerState;
97 import android.telephony.AnomalyReporter;
98 import android.telephony.BarringInfo;
99 import android.telephony.CellIdentity;
100 import android.telephony.CellInfo;
101 import android.telephony.LinkCapacityEstimate;
102 import android.telephony.NetworkRegistrationInfo;
103 import android.telephony.PcoData;
104 import android.telephony.PhysicalChannelConfig;
105 import android.telephony.ServiceState;
106 import android.telephony.SignalStrength;
107 import android.telephony.SmsMessage;
108 import android.telephony.TelephonyManager;
109 import android.telephony.data.DataCallResponse;
110 import android.telephony.emergency.EmergencyNumber;
111 import android.text.TextUtils;
112 
113 import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
114 import com.android.internal.telephony.cdma.CdmaInformationRecords;
115 import com.android.internal.telephony.cdma.SmsMessageConverter;
116 import com.android.internal.telephony.dataconnection.KeepaliveStatus;
117 import com.android.internal.telephony.gsm.SsData;
118 import com.android.internal.telephony.gsm.SuppServiceNotification;
119 import com.android.internal.telephony.uicc.IccRefreshResponse;
120 import com.android.internal.telephony.uicc.IccUtils;
121 import com.android.internal.telephony.uicc.ReceivedPhonebookRecords;
122 import com.android.internal.telephony.uicc.SimPhonebookRecord;
123 
124 import java.util.ArrayList;
125 import java.util.List;
126 import java.util.UUID;
127 
128 public class RadioIndication extends IRadioIndication.Stub {
129     RIL mRil;
130 
RadioIndication(RIL ril)131     RadioIndication(RIL ril) {
132         mRil = ril;
133     }
134 
135     /**
136      * Indicates when radio state changes.
137      * @param indicationType RadioIndicationType
138      * @param radioState android.hardware.radio.V1_0.RadioState
139      */
radioStateChanged(int indicationType, int radioState)140     public void radioStateChanged(int indicationType, int radioState) {
141         mRil.processIndication(indicationType);
142 
143         int state = getRadioStateFromInt(radioState);
144         if (RIL.RILJ_LOGD) {
145             mRil.unsljLogMore(RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED, "radioStateChanged: " +
146                     state);
147         }
148 
149         mRil.setRadioState(state, false /* forceNotifyRegistrants */);
150     }
151 
callStateChanged(int indicationType)152     public void callStateChanged(int indicationType) {
153         mRil.processIndication(indicationType);
154 
155         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED);
156 
157         mRil.mCallStateRegistrants.notifyRegistrants();
158     }
159 
160     /**
161      * Indicates when either voice or data network state changed
162      * @param indicationType RadioIndicationType
163      */
networkStateChanged(int indicationType)164     public void networkStateChanged(int indicationType) {
165         mRil.processIndication(indicationType);
166 
167         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED);
168 
169         mRil.mNetworkStateRegistrants.notifyRegistrants();
170     }
171 
newSms(int indicationType, ArrayList<Byte> pdu)172     public void newSms(int indicationType, ArrayList<Byte> pdu) {
173         mRil.processIndication(indicationType);
174 
175         byte[] pduArray = RIL.arrayListToPrimitiveArray(pdu);
176         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RESPONSE_NEW_SMS);
177 
178         SmsMessageBase smsb = com.android.internal.telephony.gsm.SmsMessage.createFromPdu(pduArray);
179         if (mRil.mGsmSmsRegistrant != null) {
180             mRil.mGsmSmsRegistrant.notifyRegistrant(
181                     new AsyncResult(null, smsb == null ? null : new SmsMessage(smsb), null));
182         }
183     }
184 
newSmsStatusReport(int indicationType, ArrayList<Byte> pdu)185     public void newSmsStatusReport(int indicationType, ArrayList<Byte> pdu) {
186         mRil.processIndication(indicationType);
187 
188         byte[] pduArray = RIL.arrayListToPrimitiveArray(pdu);
189         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT);
190 
191         if (mRil.mSmsStatusRegistrant != null) {
192             mRil.mSmsStatusRegistrant.notifyRegistrant(new AsyncResult(null, pduArray, null));
193         }
194     }
195 
newSmsOnSim(int indicationType, int recordNumber)196     public void newSmsOnSim(int indicationType, int recordNumber) {
197         mRil.processIndication(indicationType);
198 
199         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM);
200 
201         if (mRil.mSmsOnSimRegistrant != null) {
202             mRil.mSmsOnSimRegistrant.notifyRegistrant(new AsyncResult(null, recordNumber, null));
203         }
204     }
205 
onUssd(int indicationType, int ussdModeType, String msg)206     public void onUssd(int indicationType, int ussdModeType, String msg) {
207         mRil.processIndication(indicationType);
208 
209         if (RIL.RILJ_LOGD) mRil.unsljLogMore(RIL_UNSOL_ON_USSD, "" + ussdModeType);
210 
211         // todo: Clean this up with a parcelable class for better self-documentation
212         String[] resp = new String[2];
213         resp[0] = "" + ussdModeType;
214         resp[1] = msg;
215         if (mRil.mUSSDRegistrant != null) {
216             mRil.mUSSDRegistrant.notifyRegistrant(new AsyncResult (null, resp, null));
217         }
218     }
219 
nitzTimeReceived(int indicationType, String nitzTime, long receivedTime)220     public void nitzTimeReceived(int indicationType, String nitzTime, long receivedTime) {
221         mRil.processIndication(indicationType);
222 
223         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_NITZ_TIME_RECEIVED, nitzTime);
224 
225         // todo: Clean this up with a parcelable class for better self-documentation
226         Object[] result = new Object[2];
227         result[0] = nitzTime;
228         result[1] = receivedTime;
229 
230         boolean ignoreNitz = TelephonyProperties.ignore_nitz().orElse(false);
231 
232         if (ignoreNitz) {
233             if (RIL.RILJ_LOGD) mRil.riljLog("ignoring UNSOL_NITZ_TIME_RECEIVED");
234         } else {
235             if (mRil.mNITZTimeRegistrant != null) {
236                 mRil.mNITZTimeRegistrant.notifyRegistrant(new AsyncResult (null, result, null));
237             }
238             // in case NITZ time registrant isn't registered yet, or a new registrant
239             // registers later
240             mRil.mLastNITZTimeInfo = result;
241         }
242     }
243 
currentSignalStrength(int indicationType, android.hardware.radio.V1_0.SignalStrength signalStrength)244     public void currentSignalStrength(int indicationType,
245                                       android.hardware.radio.V1_0.SignalStrength signalStrength) {
246         mRil.processIndication(indicationType);
247 
248         SignalStrength ssInitial = new SignalStrength(signalStrength);
249 
250         SignalStrength ss = mRil.fixupSignalStrength10(ssInitial);
251         // Note this is set to "verbose" because it happens frequently
252         if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss);
253 
254         if (mRil.mSignalStrengthRegistrant != null) {
255             mRil.mSignalStrengthRegistrant.notifyRegistrant(new AsyncResult (null, ss, null));
256         }
257     }
258 
259     /**
260      * Indicates current link capacity estimate.
261      */
currentLinkCapacityEstimate(int indicationType, android.hardware.radio.V1_2.LinkCapacityEstimate lce)262     public void currentLinkCapacityEstimate(int indicationType,
263                                             android.hardware.radio.V1_2.LinkCapacityEstimate lce) {
264         mRil.processIndication(indicationType);
265 
266         List<LinkCapacityEstimate> response = RIL.convertHalLceData(lce, mRil);
267 
268         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_LCEDATA_RECV, response);
269 
270         if (mRil.mLceInfoRegistrants != null) {
271             mRil.mLceInfoRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
272         }
273     }
274 
275     /**
276      * Indicates current link capacity estimate.
277      */
currentLinkCapacityEstimate_1_6(int indicationType, android.hardware.radio.V1_6.LinkCapacityEstimate lce)278     public void currentLinkCapacityEstimate_1_6(int indicationType,
279             android.hardware.radio.V1_6.LinkCapacityEstimate lce) {
280         mRil.processIndication(indicationType);
281 
282         List<LinkCapacityEstimate> response = RIL.convertHalLceData(lce, mRil);
283 
284         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_LCEDATA_RECV, response);
285 
286         if (mRil.mLceInfoRegistrants != null) {
287             mRil.mLceInfoRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
288         }
289     }
290 
291     /**
292      * Indicates the current signal strength of the camped or primary serving cell.
293      */
currentSignalStrength_1_2(int indicationType, android.hardware.radio.V1_2.SignalStrength signalStrength)294     public void currentSignalStrength_1_2(int indicationType,
295                                       android.hardware.radio.V1_2.SignalStrength signalStrength) {
296         mRil.processIndication(indicationType);
297 
298         SignalStrength ss = new SignalStrength(signalStrength);
299         // Note this is set to "verbose" because it happens frequently
300         if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss);
301 
302         if (mRil.mSignalStrengthRegistrant != null) {
303             mRil.mSignalStrengthRegistrant.notifyRegistrant(new AsyncResult(null, ss, null));
304         }
305     }
306 
307     /**
308      * Indicates the current signal strength of the camped or primary serving cell.
309      */
currentSignalStrength_1_4(int indicationType, android.hardware.radio.V1_4.SignalStrength signalStrength)310     public void currentSignalStrength_1_4(int indicationType,
311             android.hardware.radio.V1_4.SignalStrength signalStrength) {
312 
313         mRil.processIndication(indicationType);
314 
315         SignalStrength ss = new SignalStrength(signalStrength);
316 
317         if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss);
318 
319         if (mRil.mSignalStrengthRegistrant != null) {
320             mRil.mSignalStrengthRegistrant.notifyRegistrant(new AsyncResult(null, ss, null));
321         }
322     }
323 
324     /**
325      * Indicates the current signal strength of the camped or primary serving cell.
326      */
currentSignalStrength_1_6(int indicationType, android.hardware.radio.V1_6.SignalStrength signalStrength)327     public void currentSignalStrength_1_6(int indicationType,
328             android.hardware.radio.V1_6.SignalStrength signalStrength) {
329 
330         mRil.processIndication(indicationType);
331 
332         SignalStrength ss = new SignalStrength(signalStrength);
333 
334         if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss);
335 
336         if (mRil.mSignalStrengthRegistrant != null) {
337             mRil.mSignalStrengthRegistrant.notifyRegistrant(new AsyncResult(null, ss, null));
338         }
339     }
340 
341     /**
342      * Indicates current physical channel configuration.
343      */
currentPhysicalChannelConfigs_1_4(int indicationType, ArrayList<android.hardware.radio.V1_4.PhysicalChannelConfig> configs)344     public void currentPhysicalChannelConfigs_1_4(int indicationType,
345             ArrayList<android.hardware.radio.V1_4.PhysicalChannelConfig> configs) {
346         mRil.processIndication(indicationType);
347         physicalChannelConfigsIndication(configs);
348     }
349 
350     /**
351      * Indicates current physical channel configuration.
352      */
currentPhysicalChannelConfigs_1_6(int indicationType, ArrayList<android.hardware.radio.V1_6.PhysicalChannelConfig> configs)353     public void currentPhysicalChannelConfigs_1_6(int indicationType,
354             ArrayList<android.hardware.radio.V1_6.PhysicalChannelConfig> configs) {
355         mRil.processIndication(indicationType);
356         physicalChannelConfigsIndication(configs);
357     }
358 
359     /**
360      * Indicates current physical channel configuration.
361      */
currentPhysicalChannelConfigs(int indicationType, ArrayList<android.hardware.radio.V1_2.PhysicalChannelConfig> configs)362     public void currentPhysicalChannelConfigs(int indicationType,
363             ArrayList<android.hardware.radio.V1_2.PhysicalChannelConfig> configs) {
364         mRil.processIndication(indicationType);
365         physicalChannelConfigsIndication(configs);
366     }
367 
368     /**
369      * Indicates current emergency number list.
370      */
currentEmergencyNumberList(int indicationType, ArrayList<android.hardware.radio.V1_4.EmergencyNumber> emergencyNumberList)371     public void currentEmergencyNumberList(int indicationType,
372             ArrayList<android.hardware.radio.V1_4.EmergencyNumber> emergencyNumberList) {
373         List<EmergencyNumber> response = new ArrayList<>(emergencyNumberList.size());
374 
375         for (android.hardware.radio.V1_4.EmergencyNumber emergencyNumberHal
376                 : emergencyNumberList) {
377             EmergencyNumber emergencyNumber = new EmergencyNumber(emergencyNumberHal.number,
378                     MccTable.countryCodeForMcc(emergencyNumberHal.mcc), emergencyNumberHal.mnc,
379                     emergencyNumberHal.categories, emergencyNumberHal.urns,
380                     emergencyNumberHal.sources, EmergencyNumber.EMERGENCY_CALL_ROUTING_UNKNOWN);
381             response.add(emergencyNumber);
382         }
383 
384         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_EMERGENCY_NUMBER_LIST, response);
385 
386         // Cache emergency number list from last indication.
387         mRil.cacheEmergencyNumberListIndication(response);
388 
389         // Notify emergency number list from radio to registrants
390         mRil.mEmergencyNumberListRegistrants.notifyRegistrants(
391                 new AsyncResult(null, response, null));
392     }
393 
394     /** Indicates current data call list. */
dataCallListChanged(int indicationType, ArrayList<android.hardware.radio.V1_0.SetupDataCallResult> dcList)395     public void dataCallListChanged(int indicationType,
396             ArrayList<android.hardware.radio.V1_0.SetupDataCallResult> dcList) {
397         responseDataCallListChanged(indicationType, dcList);
398     }
399 
400     /** Indicates current data call list with radio HAL 1.4. */
dataCallListChanged_1_4(int indicationType, ArrayList<android.hardware.radio.V1_4.SetupDataCallResult> dcList)401     public void dataCallListChanged_1_4(int indicationType,
402             ArrayList<android.hardware.radio.V1_4.SetupDataCallResult> dcList) {
403         responseDataCallListChanged(indicationType, dcList);
404 
405     }
406 
407     /** Indicates current data call list with radio HAL 1.5. */
dataCallListChanged_1_5(int indicationType, ArrayList<android.hardware.radio.V1_5.SetupDataCallResult> dcList)408     public void dataCallListChanged_1_5(int indicationType,
409             ArrayList<android.hardware.radio.V1_5.SetupDataCallResult> dcList) {
410         responseDataCallListChanged(indicationType, dcList);
411     }
412 
413     /** Indicates current data call list with radio HAL 1.6. */
dataCallListChanged_1_6(int indicationType, ArrayList<android.hardware.radio.V1_6.SetupDataCallResult> dcList)414     public void dataCallListChanged_1_6(int indicationType,
415             ArrayList<android.hardware.radio.V1_6.SetupDataCallResult> dcList) {
416         responseDataCallListChanged(indicationType, dcList);
417     }
418 
419     @Override
unthrottleApn(int indicationType, String apn)420     public void unthrottleApn(int indicationType, String apn)
421             throws RemoteException {
422         responseApnUnthrottled(indicationType, apn);
423     }
424 
suppSvcNotify(int indicationType, SuppSvcNotification suppSvcNotification)425     public void suppSvcNotify(int indicationType, SuppSvcNotification suppSvcNotification) {
426         mRil.processIndication(indicationType);
427 
428         SuppServiceNotification notification = new SuppServiceNotification();
429         notification.notificationType = suppSvcNotification.isMT ? 1 : 0;
430         notification.code = suppSvcNotification.code;
431         notification.index = suppSvcNotification.index;
432         notification.type = suppSvcNotification.type;
433         notification.number = suppSvcNotification.number;
434 
435         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_SUPP_SVC_NOTIFICATION, notification);
436 
437         if (mRil.mSsnRegistrant != null) {
438             mRil.mSsnRegistrant.notifyRegistrant(new AsyncResult (null, notification, null));
439         }
440     }
441 
stkSessionEnd(int indicationType)442     public void stkSessionEnd(int indicationType) {
443         mRil.processIndication(indicationType);
444 
445         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_STK_SESSION_END);
446 
447         if (mRil.mCatSessionEndRegistrant != null) {
448             mRil.mCatSessionEndRegistrant.notifyRegistrant(new AsyncResult (null, null, null));
449         }
450     }
451 
stkProactiveCommand(int indicationType, String cmd)452     public void stkProactiveCommand(int indicationType, String cmd) {
453         mRil.processIndication(indicationType);
454 
455         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_STK_PROACTIVE_COMMAND);
456 
457         if (mRil.mCatProCmdRegistrant != null) {
458             mRil.mCatProCmdRegistrant.notifyRegistrant(new AsyncResult (null, cmd, null));
459         }
460     }
461 
stkEventNotify(int indicationType, String cmd)462     public void stkEventNotify(int indicationType, String cmd) {
463         mRil.processIndication(indicationType);
464 
465         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_STK_EVENT_NOTIFY);
466 
467         if (mRil.mCatEventRegistrant != null) {
468             mRil.mCatEventRegistrant.notifyRegistrant(new AsyncResult (null, cmd, null));
469         }
470     }
471 
stkCallSetup(int indicationType, long timeout)472     public void stkCallSetup(int indicationType, long timeout) {
473         mRil.processIndication(indicationType);
474 
475         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_STK_CALL_SETUP, timeout);
476 
477         if (mRil.mCatCallSetUpRegistrant != null) {
478             mRil.mCatCallSetUpRegistrant.notifyRegistrant(new AsyncResult (null, timeout, null));
479         }
480     }
481 
simSmsStorageFull(int indicationType)482     public void simSmsStorageFull(int indicationType) {
483         mRil.processIndication(indicationType);
484 
485         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_SIM_SMS_STORAGE_FULL);
486 
487         if (mRil.mIccSmsFullRegistrant != null) {
488             mRil.mIccSmsFullRegistrant.notifyRegistrant();
489         }
490     }
491 
simRefresh(int indicationType, SimRefreshResult refreshResult)492     public void simRefresh(int indicationType, SimRefreshResult refreshResult) {
493         mRil.processIndication(indicationType);
494 
495         IccRefreshResponse response = new IccRefreshResponse();
496         response.refreshResult = refreshResult.type;
497         response.efId = refreshResult.efId;
498         response.aid = refreshResult.aid;
499 
500         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_SIM_REFRESH, response);
501 
502         mRil.mIccRefreshRegistrants.notifyRegistrants(new AsyncResult (null, response, null));
503     }
504 
callRing(int indicationType, boolean isGsm, CdmaSignalInfoRecord record)505     public void callRing(int indicationType, boolean isGsm, CdmaSignalInfoRecord record) {
506         mRil.processIndication(indicationType);
507 
508         char response[] = null;
509 
510         // Ignore record for gsm
511         if (!isGsm) {
512             // todo: Clean this up with a parcelable class for better self-documentation
513             response = new char[4];
514             response[0] = (char) (record.isPresent ? 1 : 0);
515             response[1] = (char) record.signalType;
516             response[2] = (char) record.alertPitch;
517             response[3] = (char) record.signal;
518             mRil.writeMetricsCallRing(response);
519         }
520 
521         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CALL_RING, response);
522 
523         if (mRil.mRingRegistrant != null) {
524             mRil.mRingRegistrant.notifyRegistrant(new AsyncResult (null, response, null));
525         }
526     }
527 
simStatusChanged(int indicationType)528     public void simStatusChanged(int indicationType) {
529         mRil.processIndication(indicationType);
530 
531         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED);
532 
533         mRil.mIccStatusChangedRegistrants.notifyRegistrants();
534     }
535 
cdmaNewSms(int indicationType, CdmaSmsMessage msg)536     public void cdmaNewSms(int indicationType, CdmaSmsMessage msg) {
537         mRil.processIndication(indicationType);
538 
539         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RESPONSE_CDMA_NEW_SMS);
540 
541         // todo: conversion from CdmaSmsMessage to SmsMessage should be contained in this class so
542         // that usage of auto-generated HAL classes is limited to this file
543         SmsMessage sms = SmsMessageConverter.newSmsMessageFromCdmaSmsMessage(msg);
544         if (mRil.mCdmaSmsRegistrant != null) {
545             mRil.mCdmaSmsRegistrant.notifyRegistrant(new AsyncResult(null, sms, null));
546         }
547     }
548 
newBroadcastSms(int indicationType, ArrayList<Byte> data)549     public void newBroadcastSms(int indicationType, ArrayList<Byte> data) {
550         mRil.processIndication(indicationType);
551 
552         byte response[] = RIL.arrayListToPrimitiveArray(data);
553         if (RIL.RILJ_LOGD) {
554             mRil.unsljLogvRet(RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS,
555                     IccUtils.bytesToHexString(response));
556         }
557 
558         if (mRil.mGsmBroadcastSmsRegistrant != null) {
559             mRil.mGsmBroadcastSmsRegistrant.notifyRegistrant(new AsyncResult(null, response, null));
560         }
561     }
562 
cdmaRuimSmsStorageFull(int indicationType)563     public void cdmaRuimSmsStorageFull(int indicationType) {
564         mRil.processIndication(indicationType);
565 
566         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL);
567 
568         if (mRil.mIccSmsFullRegistrant != null) {
569             mRil.mIccSmsFullRegistrant.notifyRegistrant();
570         }
571     }
572 
restrictedStateChanged(int indicationType, int state)573     public void restrictedStateChanged(int indicationType, int state) {
574         mRil.processIndication(indicationType);
575 
576         if (RIL.RILJ_LOGD) mRil.unsljLogvRet(RIL_UNSOL_RESTRICTED_STATE_CHANGED, state);
577 
578         if (mRil.mRestrictedStateRegistrant != null) {
579             mRil.mRestrictedStateRegistrant.notifyRegistrant(new AsyncResult (null, state, null));
580         }
581     }
582 
enterEmergencyCallbackMode(int indicationType)583     public void enterEmergencyCallbackMode(int indicationType) {
584         mRil.processIndication(indicationType);
585 
586         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE);
587 
588         if (mRil.mEmergencyCallbackModeRegistrant != null) {
589             mRil.mEmergencyCallbackModeRegistrant.notifyRegistrant();
590         }
591     }
592 
cdmaCallWaiting(int indicationType, CdmaCallWaiting callWaitingRecord)593     public void cdmaCallWaiting(int indicationType, CdmaCallWaiting callWaitingRecord) {
594         mRil.processIndication(indicationType);
595 
596         // todo: create a CdmaCallWaitingNotification constructor that takes in these fields to make
597         // sure no fields are missing
598         CdmaCallWaitingNotification notification = new CdmaCallWaitingNotification();
599         notification.number = callWaitingRecord.number;
600         notification.numberPresentation = CdmaCallWaitingNotification.presentationFromCLIP(
601                 callWaitingRecord.numberPresentation);
602         notification.name = callWaitingRecord.name;
603         notification.namePresentation = notification.numberPresentation;
604         notification.isPresent = callWaitingRecord.signalInfoRecord.isPresent ? 1 : 0;
605         notification.signalType = callWaitingRecord.signalInfoRecord.signalType;
606         notification.alertPitch = callWaitingRecord.signalInfoRecord.alertPitch;
607         notification.signal = callWaitingRecord.signalInfoRecord.signal;
608         notification.numberType = callWaitingRecord.numberType;
609         notification.numberPlan = callWaitingRecord.numberPlan;
610 
611         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CDMA_CALL_WAITING, notification);
612 
613         mRil.mCallWaitingInfoRegistrants.notifyRegistrants(
614                 new AsyncResult (null, notification, null));
615     }
616 
cdmaOtaProvisionStatus(int indicationType, int status)617     public void cdmaOtaProvisionStatus(int indicationType, int status) {
618         mRil.processIndication(indicationType);
619 
620         int response[] = new int[1];
621         response[0] = status;
622 
623         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CDMA_OTA_PROVISION_STATUS, response);
624 
625         mRil.mOtaProvisionRegistrants.notifyRegistrants(new AsyncResult (null, response, null));
626     }
627 
cdmaInfoRec(int indicationType, android.hardware.radio.V1_0.CdmaInformationRecords records)628     public void cdmaInfoRec(int indicationType,
629                             android.hardware.radio.V1_0.CdmaInformationRecords records) {
630         mRil.processIndication(indicationType);
631 
632         int numberOfInfoRecs = records.infoRec.size();
633         for (int i = 0; i < numberOfInfoRecs; i++) {
634             CdmaInformationRecord record = records.infoRec.get(i);
635             int id = record.name;
636             CdmaInformationRecords cdmaInformationRecords;
637             switch (id) {
638                 case CdmaInformationRecords.RIL_CDMA_DISPLAY_INFO_REC:
639                 case CdmaInformationRecords.RIL_CDMA_EXTENDED_DISPLAY_INFO_REC:
640                     CdmaInformationRecords.CdmaDisplayInfoRec cdmaDisplayInfoRec =
641                             new CdmaInformationRecords.CdmaDisplayInfoRec(id,
642                             record.display.get(0).alphaBuf);
643                     cdmaInformationRecords = new CdmaInformationRecords(cdmaDisplayInfoRec);
644                     break;
645 
646                 case CdmaInformationRecords.RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC:
647                 case CdmaInformationRecords.RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC:
648                 case CdmaInformationRecords.RIL_CDMA_CONNECTED_NUMBER_INFO_REC:
649                     CdmaNumberInfoRecord numInfoRecord = record.number.get(0);
650                     CdmaInformationRecords.CdmaNumberInfoRec cdmaNumberInfoRec =
651                             new CdmaInformationRecords.CdmaNumberInfoRec(id,
652                             numInfoRecord.number,
653                             numInfoRecord.numberType,
654                             numInfoRecord.numberPlan,
655                             numInfoRecord.pi,
656                             numInfoRecord.si);
657                     cdmaInformationRecords = new CdmaInformationRecords(cdmaNumberInfoRec);
658                     break;
659 
660                 case CdmaInformationRecords.RIL_CDMA_SIGNAL_INFO_REC:
661                     CdmaSignalInfoRecord signalInfoRecord = record.signal.get(0);
662                     CdmaInformationRecords.CdmaSignalInfoRec cdmaSignalInfoRec =
663                             new CdmaInformationRecords.CdmaSignalInfoRec(
664                             signalInfoRecord.isPresent ? 1 : 0,
665                             signalInfoRecord.signalType,
666                             signalInfoRecord.alertPitch,
667                             signalInfoRecord.signal);
668                     cdmaInformationRecords = new CdmaInformationRecords(cdmaSignalInfoRec);
669                     break;
670 
671                 case CdmaInformationRecords.RIL_CDMA_REDIRECTING_NUMBER_INFO_REC:
672                     CdmaRedirectingNumberInfoRecord redirectingNumberInfoRecord =
673                             record.redir.get(0);
674                     CdmaInformationRecords.CdmaRedirectingNumberInfoRec
675                             cdmaRedirectingNumberInfoRec =
676                             new CdmaInformationRecords.CdmaRedirectingNumberInfoRec(
677                             redirectingNumberInfoRecord.redirectingNumber.number,
678                             redirectingNumberInfoRecord.redirectingNumber.numberType,
679                             redirectingNumberInfoRecord.redirectingNumber.numberPlan,
680                             redirectingNumberInfoRecord.redirectingNumber.pi,
681                             redirectingNumberInfoRecord.redirectingNumber.si,
682                             redirectingNumberInfoRecord.redirectingReason);
683                     cdmaInformationRecords = new CdmaInformationRecords(
684                             cdmaRedirectingNumberInfoRec);
685                     break;
686 
687                 case CdmaInformationRecords.RIL_CDMA_LINE_CONTROL_INFO_REC:
688                     CdmaLineControlInfoRecord lineControlInfoRecord = record.lineCtrl.get(0);
689                     CdmaInformationRecords.CdmaLineControlInfoRec cdmaLineControlInfoRec =
690                             new CdmaInformationRecords.CdmaLineControlInfoRec(
691                             lineControlInfoRecord.lineCtrlPolarityIncluded,
692                             lineControlInfoRecord.lineCtrlToggle,
693                             lineControlInfoRecord.lineCtrlReverse,
694                             lineControlInfoRecord.lineCtrlPowerDenial);
695                     cdmaInformationRecords = new CdmaInformationRecords(cdmaLineControlInfoRec);
696                     break;
697 
698                 case CdmaInformationRecords.RIL_CDMA_T53_CLIR_INFO_REC:
699                     CdmaInformationRecords.CdmaT53ClirInfoRec cdmaT53ClirInfoRec =
700                             new CdmaInformationRecords.CdmaT53ClirInfoRec(record.clir.get(0).cause);
701                     cdmaInformationRecords = new CdmaInformationRecords(cdmaT53ClirInfoRec);
702                     break;
703 
704                 case CdmaInformationRecords.RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC:
705                     CdmaT53AudioControlInfoRecord audioControlInfoRecord = record.audioCtrl.get(0);
706                     CdmaInformationRecords.CdmaT53AudioControlInfoRec cdmaT53AudioControlInfoRec =
707                             new CdmaInformationRecords.CdmaT53AudioControlInfoRec(
708                             audioControlInfoRecord.upLink,
709                             audioControlInfoRecord.downLink);
710                     cdmaInformationRecords = new CdmaInformationRecords(cdmaT53AudioControlInfoRec);
711                     break;
712 
713                 default:
714                     throw new RuntimeException("RIL_UNSOL_CDMA_INFO_REC: unsupported record. Got "
715                             + CdmaInformationRecords.idToString(id) + " ");
716             }
717 
718             if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CDMA_INFO_REC, cdmaInformationRecords);
719             mRil.notifyRegistrantsCdmaInfoRec(cdmaInformationRecords);
720         }
721     }
722 
indicateRingbackTone(int indicationType, boolean start)723     public void indicateRingbackTone(int indicationType, boolean start) {
724         mRil.processIndication(indicationType);
725 
726         if (RIL.RILJ_LOGD) mRil.unsljLogvRet(RIL_UNSOL_RINGBACK_TONE, start);
727 
728         mRil.mRingbackToneRegistrants.notifyRegistrants(new AsyncResult(null, start, null));
729     }
730 
resendIncallMute(int indicationType)731     public void resendIncallMute(int indicationType) {
732         mRil.processIndication(indicationType);
733 
734         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RESEND_INCALL_MUTE);
735 
736         mRil.mResendIncallMuteRegistrants.notifyRegistrants();
737     }
738 
cdmaSubscriptionSourceChanged(int indicationType, int cdmaSource)739     public void cdmaSubscriptionSourceChanged(int indicationType, int cdmaSource) {
740         mRil.processIndication(indicationType);
741 
742         int response[] = new int[1];
743         response[0] = cdmaSource;
744 
745         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED, response);
746 
747         mRil.mCdmaSubscriptionChangedRegistrants.notifyRegistrants(
748                 new AsyncResult (null, response, null));
749     }
750 
cdmaPrlChanged(int indicationType, int version)751     public void cdmaPrlChanged(int indicationType, int version) {
752         mRil.processIndication(indicationType);
753 
754         int response[] = new int[1];
755         response[0] = version;
756 
757         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOl_CDMA_PRL_CHANGED, response);
758 
759         mRil.mCdmaPrlChangedRegistrants.notifyRegistrants(
760                 new AsyncResult (null, response, null));
761     }
762 
exitEmergencyCallbackMode(int indicationType)763     public void exitEmergencyCallbackMode(int indicationType) {
764         mRil.processIndication(indicationType);
765 
766         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE);
767 
768         mRil.mExitEmergencyCallbackModeRegistrants.notifyRegistrants();
769     }
770 
rilConnected(int indicationType)771     public void rilConnected(int indicationType) {
772         mRil.processIndication(indicationType);
773 
774         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RIL_CONNECTED);
775 
776         // Initial conditions
777         mRil.setRadioPower(false, null);
778         mRil.setCdmaSubscriptionSource(mRil.mCdmaSubscription, null);
779         // todo: this should not require a version number now. Setting it to latest RIL version for
780         // now.
781         mRil.notifyRegistrantsRilConnectionChanged(15);
782     }
783 
voiceRadioTechChanged(int indicationType, int rat)784     public void voiceRadioTechChanged(int indicationType, int rat) {
785         mRil.processIndication(indicationType);
786 
787         int response[] = new int[1];
788         response[0] = rat;
789 
790         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_VOICE_RADIO_TECH_CHANGED, response);
791 
792         mRil.mVoiceRadioTechChangedRegistrants.notifyRegistrants(
793                 new AsyncResult (null, response, null));
794     }
795 
796     /** Get unsolicited message for cellInfoList */
cellInfoList(int indicationType, ArrayList<android.hardware.radio.V1_0.CellInfo> records)797     public void cellInfoList(int indicationType,
798                              ArrayList<android.hardware.radio.V1_0.CellInfo> records) {
799         mRil.processIndication(indicationType);
800 
801         ArrayList<CellInfo> response = RIL.convertHalCellInfoList(records);
802 
803         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CELL_INFO_LIST, response);
804 
805         mRil.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
806     }
807 
808     /** Get unsolicited message for cellInfoList using HAL V1_2 */
cellInfoList_1_2(int indicationType, ArrayList<android.hardware.radio.V1_2.CellInfo> records)809     public void cellInfoList_1_2(int indicationType,
810                                  ArrayList<android.hardware.radio.V1_2.CellInfo> records) {
811         mRil.processIndication(indicationType);
812 
813         ArrayList<CellInfo> response = RIL.convertHalCellInfoList_1_2(records);
814 
815         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CELL_INFO_LIST, response);
816 
817         mRil.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
818     }
819 
820     /** Get unsolicited message for cellInfoList using HAL V1_4 */
cellInfoList_1_4(int indicationType, ArrayList<android.hardware.radio.V1_4.CellInfo> records)821     public void cellInfoList_1_4(int indicationType,
822                                  ArrayList<android.hardware.radio.V1_4.CellInfo> records) {
823         mRil.processIndication(indicationType);
824 
825         ArrayList<CellInfo> response = RIL.convertHalCellInfoList_1_4(records);
826 
827         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CELL_INFO_LIST, response);
828 
829         mRil.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
830     }
831 
832     /** Get unsolicited message for cellInfoList using HAL V1_5 */
cellInfoList_1_5(int indicationType, ArrayList<android.hardware.radio.V1_5.CellInfo> records)833     public void cellInfoList_1_5(int indicationType,
834             ArrayList<android.hardware.radio.V1_5.CellInfo> records) {
835         mRil.processIndication(indicationType);
836 
837         ArrayList<CellInfo> response = RIL.convertHalCellInfoList_1_5(records);
838 
839         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CELL_INFO_LIST, response);
840 
841         mRil.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
842     }
843 
844     /** Get unsolicited message for cellInfoList using HAL V1_5 */
cellInfoList_1_6(int indicationType, ArrayList<android.hardware.radio.V1_6.CellInfo> records)845     public void cellInfoList_1_6(int indicationType,
846             ArrayList<android.hardware.radio.V1_6.CellInfo> records) {
847         mRil.processIndication(indicationType);
848 
849         ArrayList<CellInfo> response = RIL.convertHalCellInfoList_1_6(records);
850 
851         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CELL_INFO_LIST, response);
852 
853         mRil.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
854     }
855 
856     /** Get unsolicited message for uicc applications enablement changes. */
uiccApplicationsEnablementChanged(int indicationType, boolean enabled)857     public void uiccApplicationsEnablementChanged(int indicationType, boolean enabled) {
858         mRil.processIndication(indicationType);
859 
860         if (RIL.RILJ_LOGD) {
861             mRil.unsljLogRet(RIL_UNSOL_UICC_APPLICATIONS_ENABLEMENT_CHANGED, enabled);
862         }
863 
864         mRil.mUiccApplicationsEnablementRegistrants.notifyResult(enabled);
865     }
866 
867     /** Incremental network scan results */
networkScanResult(int indicationType, android.hardware.radio.V1_1.NetworkScanResult result)868     public void networkScanResult(int indicationType,
869                                   android.hardware.radio.V1_1.NetworkScanResult result) {
870         responseNetworkScan(indicationType, result);
871     }
872 
873     /** Incremental network scan results with HAL V1_2 */
networkScanResult_1_2(int indicationType, android.hardware.radio.V1_2.NetworkScanResult result)874     public void networkScanResult_1_2(int indicationType,
875                                       android.hardware.radio.V1_2.NetworkScanResult result) {
876         responseNetworkScan_1_2(indicationType, result);
877     }
878 
879     /** Incremental network scan results with HAL V1_4 */
networkScanResult_1_4(int indicationType, android.hardware.radio.V1_4.NetworkScanResult result)880     public void networkScanResult_1_4(int indicationType,
881                                       android.hardware.radio.V1_4.NetworkScanResult result) {
882         responseNetworkScan_1_4(indicationType, result);
883     }
884 
885     /** Incremental network scan results with HAL V1_5 */
networkScanResult_1_5(int indicationType, android.hardware.radio.V1_5.NetworkScanResult result)886     public void networkScanResult_1_5(int indicationType,
887             android.hardware.radio.V1_5.NetworkScanResult result) {
888         responseNetworkScan_1_5(indicationType, result);
889     }
890 
891     /** Incremental network scan results with HAL V1_6 */
networkScanResult_1_6(int indicationType, android.hardware.radio.V1_6.NetworkScanResult result)892     public void networkScanResult_1_6(int indicationType,
893             android.hardware.radio.V1_6.NetworkScanResult result) {
894         responseNetworkScan_1_6(indicationType, result);
895     }
896 
imsNetworkStateChanged(int indicationType)897     public void imsNetworkStateChanged(int indicationType) {
898         mRil.processIndication(indicationType);
899 
900         if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED);
901 
902         mRil.mImsNetworkStateChangedRegistrants.notifyRegistrants();
903     }
904 
subscriptionStatusChanged(int indicationType, boolean activate)905     public void subscriptionStatusChanged(int indicationType, boolean activate) {
906         mRil.processIndication(indicationType);
907 
908         int response[] = new int[1];
909         response[0] = activate ? 1 : 0;
910 
911         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED, response);
912 
913         mRil.mSubscriptionStatusRegistrants.notifyRegistrants(
914                 new AsyncResult (null, response, null));
915     }
916 
srvccStateNotify(int indicationType, int state)917     public void srvccStateNotify(int indicationType, int state) {
918         mRil.processIndication(indicationType);
919 
920         int response[] = new int[1];
921         response[0] = state;
922 
923         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_SRVCC_STATE_NOTIFY, response);
924 
925         mRil.writeMetricsSrvcc(state);
926 
927         mRil.mSrvccStateRegistrants.notifyRegistrants(
928                 new AsyncResult (null, response, null));
929     }
930 
hardwareConfigChanged( int indicationType, ArrayList<android.hardware.radio.V1_0.HardwareConfig> configs)931     public void hardwareConfigChanged(
932             int indicationType,
933             ArrayList<android.hardware.radio.V1_0.HardwareConfig> configs) {
934         mRil.processIndication(indicationType);
935 
936         ArrayList<HardwareConfig> response = RIL.convertHalHwConfigList(configs, mRil);
937 
938         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_HARDWARE_CONFIG_CHANGED, response);
939 
940         mRil.mHardwareConfigChangeRegistrants.notifyRegistrants(
941                 new AsyncResult (null, response, null));
942     }
943 
radioCapabilityIndication(int indicationType, android.hardware.radio.V1_0.RadioCapability rc)944     public void radioCapabilityIndication(int indicationType,
945                                           android.hardware.radio.V1_0.RadioCapability rc) {
946         mRil.processIndication(indicationType);
947 
948         RadioCapability response = RIL.convertHalRadioCapability(rc, mRil);
949 
950         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_RADIO_CAPABILITY, response);
951 
952         mRil.mPhoneRadioCapabilityChangedRegistrants.notifyRegistrants(
953                 new AsyncResult (null, response, null));
954     }
955 
onSupplementaryServiceIndication(int indicationType, StkCcUnsolSsResult ss)956     public void onSupplementaryServiceIndication(int indicationType, StkCcUnsolSsResult ss) {
957         mRil.processIndication(indicationType);
958 
959         int num;
960         SsData ssData = new SsData();
961 
962         ssData.serviceType = ssData.ServiceTypeFromRILInt(ss.serviceType);
963         ssData.requestType = ssData.RequestTypeFromRILInt(ss.requestType);
964         ssData.teleserviceType = ssData.TeleserviceTypeFromRILInt(ss.teleserviceType);
965         ssData.serviceClass = ss.serviceClass; // This is service class sent in the SS request.
966         ssData.result = ss.result; // This is the result of the SS request.
967 
968         if (ssData.serviceType.isTypeCF() &&
969                 ssData.requestType.isTypeInterrogation()) {
970             CfData cfData = ss.cfData.get(0);
971             num = cfData.cfInfo.size();
972             ssData.cfInfo = new CallForwardInfo[num];
973 
974             for (int i = 0; i < num; i++) {
975                 android.hardware.radio.V1_0.CallForwardInfo cfInfo = cfData.cfInfo.get(i);
976                 ssData.cfInfo[i] = new CallForwardInfo();
977 
978                 ssData.cfInfo[i].status = cfInfo.status;
979                 ssData.cfInfo[i].reason = cfInfo.reason;
980                 ssData.cfInfo[i].serviceClass = cfInfo.serviceClass;
981                 ssData.cfInfo[i].toa = cfInfo.toa;
982                 ssData.cfInfo[i].number = cfInfo.number;
983                 ssData.cfInfo[i].timeSeconds = cfInfo.timeSeconds;
984 
985                 mRil.riljLog("[SS Data] CF Info " + i + " : " +  ssData.cfInfo[i]);
986             }
987         } else {
988             SsInfoData ssInfo = ss.ssInfo.get(0);
989             num = ssInfo.ssInfo.size();
990             ssData.ssInfo = new int[num];
991             for (int i = 0; i < num; i++) {
992                 ssData.ssInfo[i] = ssInfo.ssInfo.get(i);
993                 mRil.riljLog("[SS Data] SS Info " + i + " : " +  ssData.ssInfo[i]);
994             }
995         }
996 
997         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_ON_SS, ssData);
998 
999         if (mRil.mSsRegistrant != null) {
1000             mRil.mSsRegistrant.notifyRegistrant(new AsyncResult(null, ssData, null));
1001         }
1002     }
1003 
stkCallControlAlphaNotify(int indicationType, String alpha)1004     public void stkCallControlAlphaNotify(int indicationType, String alpha) {
1005         mRil.processIndication(indicationType);
1006 
1007         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_STK_CC_ALPHA_NOTIFY, alpha);
1008 
1009         if (mRil.mCatCcAlphaRegistrant != null) {
1010             mRil.mCatCcAlphaRegistrant.notifyRegistrant(new AsyncResult (null, alpha, null));
1011         }
1012     }
1013 
lceData(int indicationType, LceDataInfo lce)1014     public void lceData(int indicationType, LceDataInfo lce) {
1015         mRil.processIndication(indicationType);
1016 
1017         List<LinkCapacityEstimate> response = RIL.convertHalLceData(lce, mRil);
1018 
1019         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_LCEDATA_RECV, response);
1020 
1021         if (mRil.mLceInfoRegistrants != null) {
1022             mRil.mLceInfoRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
1023         }
1024     }
1025 
pcoData(int indicationType, PcoDataInfo pco)1026     public void pcoData(int indicationType, PcoDataInfo pco) {
1027         mRil.processIndication(indicationType);
1028 
1029         PcoData response = new PcoData(pco.cid,
1030                 pco.bearerProto,
1031                 pco.pcoId,
1032                 RIL.arrayListToPrimitiveArray(pco.contents));
1033 
1034         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_PCO_DATA, response);
1035 
1036         mRil.mPcoDataRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
1037     }
1038 
modemReset(int indicationType, String reason)1039     public void modemReset(int indicationType, String reason) {
1040         mRil.processIndication(indicationType);
1041 
1042         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_MODEM_RESTART, reason);
1043 
1044         mRil.writeMetricsModemRestartEvent(reason);
1045         mRil.mModemResetRegistrants.notifyRegistrants(new AsyncResult(null, reason, null));
1046     }
1047 
1048     /**
1049      * Indicates when the carrier info to encrypt IMSI is being requested
1050      * @param indicationType RadioIndicationType
1051      */
carrierInfoForImsiEncryption(int indicationType)1052     public void carrierInfoForImsiEncryption(int indicationType) {
1053         mRil.processIndication(indicationType);
1054 
1055         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION, null);
1056 
1057         mRil.mCarrierInfoForImsiEncryptionRegistrants.notifyRegistrants(
1058                 new AsyncResult(null, null, null));
1059     }
1060 
1061     /**
1062      * Indicates a change in the status of an ongoing Keepalive session
1063      * @param indicationType RadioIndicationType
1064      * @param halStatus Status of the ongoing Keepalive session
1065      */
keepaliveStatus( int indicationType, android.hardware.radio.V1_1.KeepaliveStatus halStatus)1066     public void keepaliveStatus(
1067             int indicationType, android.hardware.radio.V1_1.KeepaliveStatus halStatus) {
1068         mRil.processIndication(indicationType);
1069 
1070         if (RIL.RILJ_LOGD) {
1071             mRil.unsljLogRet(RIL_UNSOL_KEEPALIVE_STATUS,
1072                     "handle=" + halStatus.sessionHandle + " code=" +  halStatus.code);
1073         }
1074 
1075         KeepaliveStatus ks = new KeepaliveStatus(halStatus.sessionHandle, halStatus.code);
1076         mRil.mNattKeepaliveStatusRegistrants.notifyRegistrants(new AsyncResult(null, ks, null));
1077     }
1078 
1079     /**
1080      * Indicates when the phonebook is changed.
1081      *
1082      * @param indicationType RadioIndicationType
1083      */
simPhonebookChanged(int indicationType)1084     public void simPhonebookChanged(int indicationType) {
1085         mRil.processIndication(indicationType);
1086 
1087         if (RIL.RILJ_LOGD) {
1088             mRil.unsljLog(RIL_UNSOL_RESPONSE_SIM_PHONEBOOK_CHANGED);
1089         }
1090 
1091         mRil.mSimPhonebookChangedRegistrants.notifyRegistrants();
1092     }
1093 
1094     /**
1095      * Indicates the content of all the used records in the SIM phonebook..
1096      * @param indicationType RadioIndicationType
1097      * @param records Content of the SIM phonebook records
1098      */
simPhonebookRecordsReceived(int indicationType, byte status, ArrayList<PhonebookRecordInfo> records)1099     public void simPhonebookRecordsReceived(int indicationType, byte status,
1100             ArrayList<PhonebookRecordInfo> records) {
1101         mRil.processIndication(indicationType);
1102 
1103         List<SimPhonebookRecord> simPhonebookRecords = new ArrayList<SimPhonebookRecord>();
1104 
1105         for (PhonebookRecordInfo record : records) {
1106             simPhonebookRecords.add(new SimPhonebookRecord(record));
1107         }
1108 
1109         if (RIL.RILJ_LOGD) {
1110             mRil.unsljLogRet(RIL_UNSOL_RESPONSE_SIM_PHONEBOOK_RECORDS_RECEIVED,
1111                     "status = " + status +
1112                     " received " + records.size() + " records");
1113         }
1114 
1115         mRil.mSimPhonebookRecordsReceivedRegistrants.notifyRegistrants(
1116                 new AsyncResult(null,
1117                 new ReceivedPhonebookRecords(status, simPhonebookRecords), null));
1118     }
1119 
1120     /**
1121      * Indicate that a registration failure has occurred.
1122      *
1123      * @param cellIdentity a CellIdentity the CellIdentity of the Cell
1124      * @param chosenPlmn a 5 or 6 digit alphanumeric string indicating the PLMN on which
1125      *        registration failed
1126      * @param domain the domain of the failed procedure: CS, PS, or both
1127      * @param causeCode the primary failure cause code of the procedure
1128      * @param additionalCauseCode an additional cause code if applicable
1129      */
registrationFailed(int indicationType, android.hardware.radio.V1_5.CellIdentity cellIdentity, String chosenPlmn, @NetworkRegistrationInfo.Domain int domain, int causeCode, int additionalCauseCode)1130     public void registrationFailed(int indicationType,
1131             android.hardware.radio.V1_5.CellIdentity cellIdentity, String chosenPlmn,
1132             @NetworkRegistrationInfo.Domain int domain,
1133             int causeCode, int additionalCauseCode) {
1134         mRil.processIndication(indicationType);
1135         CellIdentity ci = CellIdentity.create(cellIdentity);
1136         if (ci == null
1137                 || TextUtils.isEmpty(chosenPlmn)
1138                 || (domain & NetworkRegistrationInfo.DOMAIN_CS_PS) == 0
1139                 || (domain & ~NetworkRegistrationInfo.DOMAIN_CS_PS) != 0
1140                 || causeCode < 0 || additionalCauseCode < 0
1141                 || (causeCode == Integer.MAX_VALUE && additionalCauseCode == Integer.MAX_VALUE)) {
1142             AnomalyReporter.reportAnomaly(
1143                     UUID.fromString("f16e5703-6105-4341-9eb3-e68189156eb4"),
1144                             "Invalid registrationFailed indication");
1145 
1146             mRil.riljLoge("Invalid registrationFailed indication");
1147             return;
1148         }
1149 
1150         mRil.mRegistrationFailedRegistrant.notifyRegistrant(
1151                 new AsyncResult(
1152                         null,
1153                         new RegistrationFailedEvent(ci, chosenPlmn, domain,
1154                                 causeCode, additionalCauseCode),
1155                         null));
1156     }
1157 
1158     /**
1159      * Indicate that BarringInfo has changed for the current cell and user.
1160      *
1161      * @param cellIdentity a CellIdentity the CellIdentity of the Cell
1162      * @param barringInfos the updated barring information from the current cell, filtered for the
1163      *        current PLMN and access class / access category.
1164      */
barringInfoChanged(int indicationType, android.hardware.radio.V1_5.CellIdentity cellIdentity, ArrayList<android.hardware.radio.V1_5.BarringInfo> barringInfos)1165     public void barringInfoChanged(int indicationType,
1166             android.hardware.radio.V1_5.CellIdentity cellIdentity,
1167             ArrayList<android.hardware.radio.V1_5.BarringInfo> barringInfos) {
1168         mRil.processIndication(indicationType);
1169 
1170         if (cellIdentity == null || barringInfos == null) {
1171             AnomalyReporter.reportAnomaly(
1172                     UUID.fromString("645b16bb-c930-4c1c-9c5d-568696542e05"),
1173                             "Invalid barringInfoChanged indication");
1174 
1175             mRil.riljLoge("Invalid barringInfoChanged indication");
1176             return;
1177         }
1178 
1179         CellIdentity ci = CellIdentity.create(cellIdentity);
1180         BarringInfo cbi = BarringInfo.create(cellIdentity, barringInfos);
1181 
1182         mRil.mBarringInfoChangedRegistrants.notifyRegistrants(
1183                 new AsyncResult(null, cbi, null));
1184     }
1185 
1186     /**
1187      * @param stateInt
1188      * @return {@link RadioPowerState RadioPowerState}
1189      */
getRadioStateFromInt(int stateInt)1190     private @RadioPowerState int getRadioStateFromInt(int stateInt) {
1191         int state;
1192 
1193         switch(stateInt) {
1194             case android.hardware.radio.V1_0.RadioState.OFF:
1195                 state = TelephonyManager.RADIO_POWER_OFF;
1196                 break;
1197             case android.hardware.radio.V1_0.RadioState.UNAVAILABLE:
1198                 state = TelephonyManager.RADIO_POWER_UNAVAILABLE;
1199                 break;
1200             case android.hardware.radio.V1_0.RadioState.ON:
1201                 state = TelephonyManager.RADIO_POWER_ON;
1202                 break;
1203             default:
1204                 throw new RuntimeException("Unrecognized RadioState: " + stateInt);
1205         }
1206         return state;
1207     }
1208 
1209 
1210     /**
1211      * Set the frequency range or channel number from the physical channel config. Only one of them
1212      * is valid, we should set the other to the unknown value.
1213      * @param builder the builder of {@link PhysicalChannelConfig}.
1214      * @param config physical channel config from ril.
1215      */
setFrequencyRangeOrChannelNumber(PhysicalChannelConfig.Builder builder, android.hardware.radio.V1_4.PhysicalChannelConfig config)1216     private void setFrequencyRangeOrChannelNumber(PhysicalChannelConfig.Builder builder,
1217             android.hardware.radio.V1_4.PhysicalChannelConfig config) {
1218 
1219         switch (config.rfInfo.getDiscriminator()) {
1220             case android.hardware.radio.V1_4.RadioFrequencyInfo.hidl_discriminator.range:
1221                 builder.setFrequencyRange(config.rfInfo.range());
1222                 break;
1223             case android.hardware.radio.V1_4.RadioFrequencyInfo.hidl_discriminator.channelNumber:
1224                 builder.setDownlinkChannelNumber(config.rfInfo.channelNumber());
1225                 break;
1226             default:
1227                 mRil.riljLoge("Unsupported frequency type " + config.rfInfo.getDiscriminator());
1228         }
1229     }
1230 
convertConnectionStatusFromCellConnectionStatus(int status)1231     private int convertConnectionStatusFromCellConnectionStatus(int status) {
1232         switch (status) {
1233             case CellConnectionStatus.PRIMARY_SERVING:
1234                 return PhysicalChannelConfig.CONNECTION_PRIMARY_SERVING;
1235             case CellConnectionStatus.SECONDARY_SERVING:
1236                 return PhysicalChannelConfig.CONNECTION_SECONDARY_SERVING;
1237             default:
1238                 // only PRIMARY_SERVING and SECONDARY_SERVING are supported.
1239                 mRil.riljLoge("Unsupported CellConnectionStatus in PhysicalChannelConfig: "
1240                         + status);
1241                 return PhysicalChannelConfig.CONNECTION_UNKNOWN;
1242         }
1243     }
1244 
1245     /**
1246      * Set the band from the physical channel config.
1247      *
1248      * @param builder the builder of {@link PhysicalChannelConfig}.
1249      * @param config physical channel config from ril.
1250      */
setBandToBuilder(PhysicalChannelConfig.Builder builder, android.hardware.radio.V1_6.PhysicalChannelConfig config)1251     public void setBandToBuilder(PhysicalChannelConfig.Builder builder,
1252             android.hardware.radio.V1_6.PhysicalChannelConfig config) {
1253 
1254         android.hardware.radio.V1_6.PhysicalChannelConfig.Band band = config.band;
1255 
1256         switch (band.getDiscriminator()) {
1257             case Band.hidl_discriminator.geranBand:
1258                 builder.setBand(band.geranBand());
1259                 break;
1260             case Band.hidl_discriminator.utranBand:
1261                 builder.setBand(band.utranBand());
1262                 break;
1263             case Band.hidl_discriminator.eutranBand:
1264                 builder.setBand(band.eutranBand());
1265                 break;
1266             case Band.hidl_discriminator.ngranBand:
1267                 builder.setBand(band.ngranBand());
1268                 break;
1269             default:
1270                 mRil.riljLoge("Unsupported band type " + band.getDiscriminator());
1271         }
1272     }
1273 
physicalChannelConfigsIndication(List<? extends Object> configs)1274     private void physicalChannelConfigsIndication(List<? extends Object> configs) {
1275         List<PhysicalChannelConfig> response = new ArrayList<>(configs.size());
1276         try {
1277             for (Object obj : configs) {
1278                 if (obj instanceof android.hardware.radio.V1_2.PhysicalChannelConfig) {
1279                     android.hardware.radio.V1_2.PhysicalChannelConfig config =
1280                             (android.hardware.radio.V1_2.PhysicalChannelConfig) obj;
1281 
1282                     response.add(new PhysicalChannelConfig.Builder()
1283                             .setCellConnectionStatus(
1284                                     convertConnectionStatusFromCellConnectionStatus(config.status))
1285                             .setCellBandwidthDownlinkKhz(config.cellBandwidthDownlink)
1286                             .build());
1287                 } else if (obj instanceof android.hardware.radio.V1_4.PhysicalChannelConfig) {
1288                     android.hardware.radio.V1_4.PhysicalChannelConfig config =
1289                             (android.hardware.radio.V1_4.PhysicalChannelConfig) obj;
1290                     PhysicalChannelConfig.Builder builder = new PhysicalChannelConfig.Builder();
1291                     setFrequencyRangeOrChannelNumber(builder, config);
1292                     response.add(builder.setCellConnectionStatus(
1293                             convertConnectionStatusFromCellConnectionStatus(config.base.status))
1294                             .setCellBandwidthDownlinkKhz(config.base.cellBandwidthDownlink)
1295                             .setNetworkType(
1296                                     ServiceState.rilRadioTechnologyToNetworkType(config.rat))
1297                             .setPhysicalCellId(config.physicalCellId)
1298                             .setContextIds(config.contextIds.stream().mapToInt(x -> x).toArray())
1299                             .build());
1300                 } else if (obj instanceof android.hardware.radio.V1_6.PhysicalChannelConfig) {
1301                     android.hardware.radio.V1_6.PhysicalChannelConfig config =
1302                             (android.hardware.radio.V1_6.PhysicalChannelConfig) obj;
1303                     PhysicalChannelConfig.Builder builder = new PhysicalChannelConfig.Builder();
1304                     setBandToBuilder(builder, config);
1305                     response.add(builder.setCellConnectionStatus(
1306                             convertConnectionStatusFromCellConnectionStatus(config.status))
1307                             .setDownlinkChannelNumber(config.downlinkChannelNumber)
1308                             .setUplinkChannelNumber(config.uplinkChannelNumber)
1309                             .setCellBandwidthDownlinkKhz(config.cellBandwidthDownlinkKhz)
1310                             .setCellBandwidthUplinkKhz(config.cellBandwidthUplinkKhz)
1311                             .setNetworkType(
1312                                     ServiceState.rilRadioTechnologyToNetworkType(config.rat))
1313                             .setPhysicalCellId(config.physicalCellId)
1314                             .setContextIds(config.contextIds.stream().mapToInt(x -> x).toArray())
1315                             .build());
1316                 } else {
1317                     mRil.riljLoge("Unsupported PhysicalChannelConfig " + obj);
1318                 }
1319             }
1320         } catch (IllegalArgumentException iae) {
1321             AnomalyReporter.reportAnomaly(
1322                     UUID.fromString("918f0970-9aa9-4bcd-a28e-e49a83fe77d5"),
1323                     "Invalid PhysicalChannelConfig reported by HAL");
1324             mRil.riljLoge("Invalid PhysicalChannelConfig " + iae);
1325             return;
1326         }
1327 
1328         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_PHYSICAL_CHANNEL_CONFIG, response);
1329 
1330         mRil.mPhysicalChannelConfigurationRegistrants.notifyRegistrants(
1331                 new AsyncResult(null, response, null));
1332     }
1333 
responseNetworkScan(int indicationType, android.hardware.radio.V1_1.NetworkScanResult result)1334     private void responseNetworkScan(int indicationType,
1335                                      android.hardware.radio.V1_1.NetworkScanResult result) {
1336         mRil.processIndication(indicationType);
1337 
1338         NetworkScanResult nsr = null;
1339         ArrayList<CellInfo> infos = RIL.convertHalCellInfoList(result.networkInfos);
1340         nsr = new NetworkScanResult(result.status, result.error, infos);
1341         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_NETWORK_SCAN_RESULT, nsr);
1342         mRil.mRilNetworkScanResultRegistrants.notifyRegistrants(new AsyncResult(null, nsr, null));
1343     }
1344 
responseNetworkScan_1_2(int indicationType, android.hardware.radio.V1_2.NetworkScanResult result)1345     private void responseNetworkScan_1_2(int indicationType,
1346                                          android.hardware.radio.V1_2.NetworkScanResult result) {
1347         mRil.processIndication(indicationType);
1348 
1349         NetworkScanResult nsr = null;
1350         ArrayList<CellInfo> infos = RIL.convertHalCellInfoList_1_2(result.networkInfos);
1351         nsr = new NetworkScanResult(result.status, result.error, infos);
1352         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_NETWORK_SCAN_RESULT, nsr);
1353         mRil.mRilNetworkScanResultRegistrants.notifyRegistrants(new AsyncResult(null, nsr, null));
1354     }
1355 
responseNetworkScan_1_4(int indicationType, android.hardware.radio.V1_4.NetworkScanResult result)1356     private void responseNetworkScan_1_4(int indicationType,
1357                                          android.hardware.radio.V1_4.NetworkScanResult result) {
1358         mRil.processIndication(indicationType);
1359 
1360         ArrayList<CellInfo> cellInfos = RIL.convertHalCellInfoList_1_4(result.networkInfos);
1361         NetworkScanResult nsr = new NetworkScanResult(result.status, result.error, cellInfos);
1362         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_NETWORK_SCAN_RESULT, nsr);
1363         mRil.mRilNetworkScanResultRegistrants.notifyRegistrants(new AsyncResult(null, nsr, null));
1364     }
1365 
responseNetworkScan_1_5(int indicationType, android.hardware.radio.V1_5.NetworkScanResult result)1366     private void responseNetworkScan_1_5(int indicationType,
1367             android.hardware.radio.V1_5.NetworkScanResult result) {
1368         mRil.processIndication(indicationType);
1369 
1370         ArrayList<CellInfo> cellInfos = RIL.convertHalCellInfoList_1_5(result.networkInfos);
1371         NetworkScanResult nsr = new NetworkScanResult(result.status, result.error, cellInfos);
1372         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_NETWORK_SCAN_RESULT, nsr);
1373         mRil.mRilNetworkScanResultRegistrants.notifyRegistrants(new AsyncResult(null, nsr, null));
1374     }
1375 
responseNetworkScan_1_6(int indicationType, android.hardware.radio.V1_6.NetworkScanResult result)1376     private void responseNetworkScan_1_6(int indicationType,
1377             android.hardware.radio.V1_6.NetworkScanResult result) {
1378         mRil.processIndication(indicationType);
1379 
1380         ArrayList<CellInfo> cellInfos = RIL.convertHalCellInfoList_1_6(result.networkInfos);
1381         NetworkScanResult nsr = new NetworkScanResult(result.status, result.error, cellInfos);
1382         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_NETWORK_SCAN_RESULT, nsr);
1383         mRil.mRilNetworkScanResultRegistrants.notifyRegistrants(new AsyncResult(null, nsr, null));
1384     }
1385 
responseDataCallListChanged(int indicationType, List<?> dcList)1386     private void responseDataCallListChanged(int indicationType, List<?> dcList) {
1387         mRil.processIndication(indicationType);
1388 
1389         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_DATA_CALL_LIST_CHANGED, dcList);
1390 
1391         ArrayList<DataCallResponse> response = RIL.convertDataCallResultList(dcList);
1392         mRil.mDataCallListChangedRegistrants.notifyRegistrants(
1393                 new AsyncResult(null, response, null));
1394     }
1395 
responseApnUnthrottled(int indicationType, String apn)1396     private void responseApnUnthrottled(int indicationType, String apn) {
1397         mRil.processIndication(indicationType);
1398 
1399         if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_UNTHROTTLE_APN, apn);
1400 
1401         mRil.mApnUnthrottledRegistrants.notifyRegistrants(
1402                 new AsyncResult(null, apn, null));
1403     }
1404 }
1405