1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2018 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport @1.0::Dial; 20*4d7e907cSAndroid Build Coastguard Workerimport @1.2::DataRequestReason; 21*4d7e907cSAndroid Build Coastguard Workerimport @1.2::NetworkScanRequest; 22*4d7e907cSAndroid Build Coastguard Workerimport @1.3::IRadio; 23*4d7e907cSAndroid Build Coastguard Workerimport @1.4::AccessNetwork; 24*4d7e907cSAndroid Build Coastguard Workerimport @1.4::CarrierRestrictionsWithPriority; 25*4d7e907cSAndroid Build Coastguard Workerimport @1.4::DataProfileInfo; 26*4d7e907cSAndroid Build Coastguard Workerimport @1.4::EmergencyCallRouting; 27*4d7e907cSAndroid Build Coastguard Workerimport @1.4::EmergencyServiceCategory; 28*4d7e907cSAndroid Build Coastguard Workerimport @1.4::RadioAccessFamily; 29*4d7e907cSAndroid Build Coastguard Workerimport @1.4::SimLockMultiSimPolicy; 30*4d7e907cSAndroid Build Coastguard Worker 31*4d7e907cSAndroid Build Coastguard Worker/** 32*4d7e907cSAndroid Build Coastguard Worker * This interface is used by telephony and telecom to talk to cellular radio. 33*4d7e907cSAndroid Build Coastguard Worker * All the functions have minimum one parameter: 34*4d7e907cSAndroid Build Coastguard Worker * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the 35*4d7e907cSAndroid Build Coastguard Worker * duration of a method call. If clients provide colliding serials (including passing the same 36*4d7e907cSAndroid Build Coastguard Worker * serial to different methods), multiple responses (one for each method call) must still be served. 37*4d7e907cSAndroid Build Coastguard Worker * setResponseFunctions must work with @1.1::IRadioResponse and @1.1::IRadioIndication. 38*4d7e907cSAndroid Build Coastguard Worker */ 39*4d7e907cSAndroid Build Coastguard Workerinterface IRadio extends @1.3::IRadio { 40*4d7e907cSAndroid Build Coastguard Worker /** 41*4d7e907cSAndroid Build Coastguard Worker * Setup a packet data connection. If DataCallResponse.status returns DataCallFailCause:NONE, 42*4d7e907cSAndroid Build Coastguard Worker * the data connection must be added to data calls and a unsolDataCallListChanged() must be 43*4d7e907cSAndroid Build Coastguard Worker * sent. The call remains until removed by subsequent unsolDataCallIstChanged(). It may be 44*4d7e907cSAndroid Build Coastguard Worker * lost due to many factors, including deactivateDataCall() being issued, the radio powered 45*4d7e907cSAndroid Build Coastguard Worker * off, reception lost or even transient factors like congestion. This data call list is 46*4d7e907cSAndroid Build Coastguard Worker * returned by getDataCallList() and dataCallListChanged(). 47*4d7e907cSAndroid Build Coastguard Worker * 48*4d7e907cSAndroid Build Coastguard Worker * The Radio is expected to: 49*4d7e907cSAndroid Build Coastguard Worker * - Create one data call context. 50*4d7e907cSAndroid Build Coastguard Worker * - Create and configure a dedicated interface for the context. 51*4d7e907cSAndroid Build Coastguard Worker * - The interface must be point to point. 52*4d7e907cSAndroid Build Coastguard Worker * - The interface is configured with one or more addresses and is capable of sending and 53*4d7e907cSAndroid Build Coastguard Worker * receiving packets. The prefix length of the addresses must be /32 for IPv4 and /128 54*4d7e907cSAndroid Build Coastguard Worker * for IPv6. 55*4d7e907cSAndroid Build Coastguard Worker * - Must not modify routing configuration related to this interface; routing management is 56*4d7e907cSAndroid Build Coastguard Worker * exclusively within the purview of the Android OS. 57*4d7e907cSAndroid Build Coastguard Worker * - Support simultaneous data call contexts up to DataRegStateResult.maxDataCalls specified 58*4d7e907cSAndroid Build Coastguard Worker * in the response of getDataRegistrationState. 59*4d7e907cSAndroid Build Coastguard Worker * 60*4d7e907cSAndroid Build Coastguard Worker * @param serial Serial number of request. 61*4d7e907cSAndroid Build Coastguard Worker * @param accessNetwork The access network to setup the data call. If the data connection cannot 62*4d7e907cSAndroid Build Coastguard Worker * be established on the specified access network, the setup request must be failed. 63*4d7e907cSAndroid Build Coastguard Worker * @param dataProfileInfo Data profile info. 64*4d7e907cSAndroid Build Coastguard Worker * @param roamingAllowed Indicates whether or not data roaming is allowed by the user. 65*4d7e907cSAndroid Build Coastguard Worker * @param reason The request reason. Must be DataRequestReason.NORMAL or 66*4d7e907cSAndroid Build Coastguard Worker * DataRequestReason.HANDOVER. 67*4d7e907cSAndroid Build Coastguard Worker * @param addresses If the reason is DataRequestReason.HANDOVER, this indicates the list of link 68*4d7e907cSAndroid Build Coastguard Worker * addresses of the existing data connection. The format is IP address with optional "/" 69*4d7e907cSAndroid Build Coastguard Worker * prefix length (The format is defined in RFC-4291 section 2.3). For example, "192.0.1.3", 70*4d7e907cSAndroid Build Coastguard Worker * "192.0.1.11/16", or "2001:db8::1/64". Typically one IPv4 or one IPv6 or one of each. If 71*4d7e907cSAndroid Build Coastguard Worker * the prefix length is absent, then the addresses are assumed to be point to point with 72*4d7e907cSAndroid Build Coastguard Worker * IPv4 with prefix length 32 or IPv6 with prefix length 128. This parameter must be ignored 73*4d7e907cSAndroid Build Coastguard Worker * unless reason is DataRequestReason.HANDOVER. 74*4d7e907cSAndroid Build Coastguard Worker * @param dnses If the reason is DataRequestReason.HANDOVER, this indicates the list of DNS 75*4d7e907cSAndroid Build Coastguard Worker * addresses of the existing data connection. The format is defined in RFC-4291 section 76*4d7e907cSAndroid Build Coastguard Worker * 2.2. For example, "192.0.1.3" or "2001:db8::1". This parameter must be ignored unless 77*4d7e907cSAndroid Build Coastguard Worker * reason is DataRequestReason.HANDOVER. 78*4d7e907cSAndroid Build Coastguard Worker * 79*4d7e907cSAndroid Build Coastguard Worker * Response function is IRadioResponse.setupDataCallResponse() 80*4d7e907cSAndroid Build Coastguard Worker * 81*4d7e907cSAndroid Build Coastguard Worker * Note this API is same as 1.2 version except using the 1.4 AccessNetwork as the input param. 82*4d7e907cSAndroid Build Coastguard Worker */ 83*4d7e907cSAndroid Build Coastguard Worker oneway setupDataCall_1_4(int32_t serial, AccessNetwork accessNetwork, 84*4d7e907cSAndroid Build Coastguard Worker DataProfileInfo dataProfileInfo, bool roamingAllowed, 85*4d7e907cSAndroid Build Coastguard Worker DataRequestReason reason, vec<string> addresses, vec<string> dnses); 86*4d7e907cSAndroid Build Coastguard Worker 87*4d7e907cSAndroid Build Coastguard Worker /** 88*4d7e907cSAndroid Build Coastguard Worker * Set an apn to initial attach network 89*4d7e907cSAndroid Build Coastguard Worker * 90*4d7e907cSAndroid Build Coastguard Worker * @param serial Serial number of request. 91*4d7e907cSAndroid Build Coastguard Worker * @param dataProfileInfo data profile containing APN settings 92*4d7e907cSAndroid Build Coastguard Worker * 93*4d7e907cSAndroid Build Coastguard Worker * Response callback is IRadioResponse.setInitialAttachApnResponse() 94*4d7e907cSAndroid Build Coastguard Worker */ 95*4d7e907cSAndroid Build Coastguard Worker oneway setInitialAttachApn_1_4(int32_t serial, DataProfileInfo dataProfileInfo); 96*4d7e907cSAndroid Build Coastguard Worker 97*4d7e907cSAndroid Build Coastguard Worker /** 98*4d7e907cSAndroid Build Coastguard Worker * Send data profiles of the current carrier to the modem. 99*4d7e907cSAndroid Build Coastguard Worker * 100*4d7e907cSAndroid Build Coastguard Worker * @param serial Serial number of request. 101*4d7e907cSAndroid Build Coastguard Worker * @param profiles Array of DataProfile to set. 102*4d7e907cSAndroid Build Coastguard Worker * 103*4d7e907cSAndroid Build Coastguard Worker * Response callback is IRadioResponse.setDataProfileResponse() 104*4d7e907cSAndroid Build Coastguard Worker */ 105*4d7e907cSAndroid Build Coastguard Worker oneway setDataProfile_1_4(int32_t serial, vec<DataProfileInfo> profiles); 106*4d7e907cSAndroid Build Coastguard Worker 107*4d7e907cSAndroid Build Coastguard Worker /** 108*4d7e907cSAndroid Build Coastguard Worker * Initiate emergency voice call, with zero or more emergency service category(s), zero or 109*4d7e907cSAndroid Build Coastguard Worker * more emergency Uniform Resource Names (URN), and routing information for handling the call. 110*4d7e907cSAndroid Build Coastguard Worker * Android uses this request to make its emergency call instead of using @1.0::IRadio.dial 111*4d7e907cSAndroid Build Coastguard Worker * if the 'address' in the 'dialInfo' field is identified as an emergency number by Android. 112*4d7e907cSAndroid Build Coastguard Worker * 113*4d7e907cSAndroid Build Coastguard Worker * In multi-sim scenario, if the emergency number is from a specific subscription, this radio 114*4d7e907cSAndroid Build Coastguard Worker * request is sent through the IRadio service that serves the subscription, no matter of the 115*4d7e907cSAndroid Build Coastguard Worker * PUK/PIN state of the subscription and the service state of the radio. 116*4d7e907cSAndroid Build Coastguard Worker * 117*4d7e907cSAndroid Build Coastguard Worker * Some countries or carriers require some emergency numbers that must be handled with normal 118*4d7e907cSAndroid Build Coastguard Worker * call routing if possible or emergency routing. 1) if the 'routing' field is specified as 119*4d7e907cSAndroid Build Coastguard Worker * @1.4::EmergencyNumberRouting#NORMAL, the implementation must try the full radio service to 120*4d7e907cSAndroid Build Coastguard Worker * use normal call routing to handle the call; if service cannot support normal routing, the 121*4d7e907cSAndroid Build Coastguard Worker * implementation must use emergency routing to handle the call. 2) if 'routing' is specified 122*4d7e907cSAndroid Build Coastguard Worker * as @1.4::EmergencyNumberRouting#EMERGENCY, the implementation must use emergency routing to 123*4d7e907cSAndroid Build Coastguard Worker * handle the call. 3) if 'routing' is specified as @1.4::EmergencyNumberRouting#UNKNOWN, 124*4d7e907cSAndroid Build Coastguard Worker * Android does not know how to handle the call. 125*4d7e907cSAndroid Build Coastguard Worker * 126*4d7e907cSAndroid Build Coastguard Worker * If the dialed emergency number does not have a specified emergency service category, the 127*4d7e907cSAndroid Build Coastguard Worker * 'categories' field is set to @1.4::EmergencyServiceCategory#UNSPECIFIED; if the dialed 128*4d7e907cSAndroid Build Coastguard Worker * emergency number does not have specified emergency Uniform Resource Names, the 'urns' field 129*4d7e907cSAndroid Build Coastguard Worker * is set to an empty list. If the underlying technology used to request emergency services 130*4d7e907cSAndroid Build Coastguard Worker * does not support the emergency service category or emergency uniform resource names, the 131*4d7e907cSAndroid Build Coastguard Worker * field 'categories' or 'urns' may be ignored. 132*4d7e907cSAndroid Build Coastguard Worker * 133*4d7e907cSAndroid Build Coastguard Worker * In the scenarios that the 'address' in the 'dialInfo' field has other functions besides the 134*4d7e907cSAndroid Build Coastguard Worker * emergency number function, if the 'hasKnownUserIntentEmergency' field is true, the user's 135*4d7e907cSAndroid Build Coastguard Worker * intent for this dial request is emergency call, and the modem must treat this as an actual 136*4d7e907cSAndroid Build Coastguard Worker * emergency dial; if the 'hasKnownUserIntentEmergency' field is false, Android does not know 137*4d7e907cSAndroid Build Coastguard Worker * user's intent for this call. 138*4d7e907cSAndroid Build Coastguard Worker * 139*4d7e907cSAndroid Build Coastguard Worker * If 'isTesting' is true, this request is for testing purpose, and must not be sent to a real 140*4d7e907cSAndroid Build Coastguard Worker * emergency service; otherwise it's for a real emergency call request. 141*4d7e907cSAndroid Build Coastguard Worker * 142*4d7e907cSAndroid Build Coastguard Worker * Reference: 3gpp 22.101, Section 10 - Emergency Calls; 143*4d7e907cSAndroid Build Coastguard Worker * 3gpp 23.167, Section 6 - Functional description; 144*4d7e907cSAndroid Build Coastguard Worker * 3gpp 24.503, Section 5.1.6.8.1 - General; 145*4d7e907cSAndroid Build Coastguard Worker * RFC 5031 146*4d7e907cSAndroid Build Coastguard Worker * 147*4d7e907cSAndroid Build Coastguard Worker * @param serial Serial number of request. 148*4d7e907cSAndroid Build Coastguard Worker * @param dialInfo the same @1.0::Dial information used by @1.0::IRadio.dial. 149*4d7e907cSAndroid Build Coastguard Worker * @param categories bitfield<@1.4::EmergencyServiceCategory> the Emergency Service Category(s) 150*4d7e907cSAndroid Build Coastguard Worker * of the call. 151*4d7e907cSAndroid Build Coastguard Worker * @param urns the emergency Uniform Resource Names (URN) 152*4d7e907cSAndroid Build Coastguard Worker * @param routing @1.4::EmergencyCallRouting the emergency call routing information. 153*4d7e907cSAndroid Build Coastguard Worker * @param hasKnownUserIntentEmergency Flag indicating if user's intent for the emergency call 154*4d7e907cSAndroid Build Coastguard Worker * is known. 155*4d7e907cSAndroid Build Coastguard Worker * @param isTesting Flag indicating if this request is for testing purpose. 156*4d7e907cSAndroid Build Coastguard Worker * 157*4d7e907cSAndroid Build Coastguard Worker * Response function is IRadioResponse.emergencyDialResponse() 158*4d7e907cSAndroid Build Coastguard Worker */ 159*4d7e907cSAndroid Build Coastguard Worker oneway emergencyDial(int32_t serial, Dial dialInfo, 160*4d7e907cSAndroid Build Coastguard Worker bitfield<EmergencyServiceCategory> categories, vec<string> urns, 161*4d7e907cSAndroid Build Coastguard Worker EmergencyCallRouting routing, bool hasKnownUserIntentEmergency, bool isTesting); 162*4d7e907cSAndroid Build Coastguard Worker 163*4d7e907cSAndroid Build Coastguard Worker /** 164*4d7e907cSAndroid Build Coastguard Worker * Starts a network scan 165*4d7e907cSAndroid Build Coastguard Worker * 166*4d7e907cSAndroid Build Coastguard Worker * @param serial Serial number of request. 167*4d7e907cSAndroid Build Coastguard Worker * @param request Defines the radio networks/bands/channels which need to be scanned. 168*4d7e907cSAndroid Build Coastguard Worker * 169*4d7e907cSAndroid Build Coastguard Worker * Same API as @1.2::IRadio.startNetworkScan_1_2, except using the 170*4d7e907cSAndroid Build Coastguard Worker * @1.4::IRadioResponse.startNetworkScanResponse_1_4 as the response. 171*4d7e907cSAndroid Build Coastguard Worker */ 172*4d7e907cSAndroid Build Coastguard Worker oneway startNetworkScan_1_4(int32_t serial, NetworkScanRequest request); 173*4d7e907cSAndroid Build Coastguard Worker 174*4d7e907cSAndroid Build Coastguard Worker /** 175*4d7e907cSAndroid Build Coastguard Worker * Query the preferred network type bitmap. 176*4d7e907cSAndroid Build Coastguard Worker * 177*4d7e907cSAndroid Build Coastguard Worker * @param serial Serial number of request. 178*4d7e907cSAndroid Build Coastguard Worker * 179*4d7e907cSAndroid Build Coastguard Worker * Response callback is IRadioResponse.getPreferredNetworkTypeBitmapResponse() 180*4d7e907cSAndroid Build Coastguard Worker */ 181*4d7e907cSAndroid Build Coastguard Worker oneway getPreferredNetworkTypeBitmap(int32_t serial); 182*4d7e907cSAndroid Build Coastguard Worker 183*4d7e907cSAndroid Build Coastguard Worker /** 184*4d7e907cSAndroid Build Coastguard Worker * Requests to set the preferred network type for searching and registering. 185*4d7e907cSAndroid Build Coastguard Worker * 186*4d7e907cSAndroid Build Coastguard Worker * @param serial Serial number of request. 187*4d7e907cSAndroid Build Coastguard Worker * @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily. 188*4d7e907cSAndroid Build Coastguard Worker * 189*4d7e907cSAndroid Build Coastguard Worker * Response callback is IRadioResponse.setPreferredNetworkTypeBitmapResponse() 190*4d7e907cSAndroid Build Coastguard Worker */ 191*4d7e907cSAndroid Build Coastguard Worker oneway setPreferredNetworkTypeBitmap( 192*4d7e907cSAndroid Build Coastguard Worker int32_t serial, bitfield<RadioAccessFamily> networkTypeBitmap); 193*4d7e907cSAndroid Build Coastguard Worker 194*4d7e907cSAndroid Build Coastguard Worker /** 195*4d7e907cSAndroid Build Coastguard Worker * Set carrier restrictions. Expected modem behavior: 196*4d7e907cSAndroid Build Coastguard Worker * If never receives this command: 197*4d7e907cSAndroid Build Coastguard Worker * - Must allow all carriers 198*4d7e907cSAndroid Build Coastguard Worker * Receives this command: 199*4d7e907cSAndroid Build Coastguard Worker * - Only allow carriers specified in carriers. The restriction persists across power cycles 200*4d7e907cSAndroid Build Coastguard Worker * and FDR. If a present SIM is allowed, modem must not reload the SIM. If a present SIM is 201*4d7e907cSAndroid Build Coastguard Worker * *not* allowed, modem must detach from the registered network and only keep emergency 202*4d7e907cSAndroid Build Coastguard Worker * service, and notify Android SIM refresh reset with new SIM state being 203*4d7e907cSAndroid Build Coastguard Worker * CardState:RESTRICTED. Emergency service must be enabled. 204*4d7e907cSAndroid Build Coastguard Worker * 205*4d7e907cSAndroid Build Coastguard Worker * @param serial Serial number of request. 206*4d7e907cSAndroid Build Coastguard Worker * @param carriers CarrierRestrictionsWithPriority consisting allowed and excluded carriers 207*4d7e907cSAndroid Build Coastguard Worker * as defined in types.hal 208*4d7e907cSAndroid Build Coastguard Worker * @param multiSimPolicy Policy to be used for devices with multiple SIMs. 209*4d7e907cSAndroid Build Coastguard Worker * 210*4d7e907cSAndroid Build Coastguard Worker * Response callback is IRadioResponse.setAllowedCarriersResponse_1_4() 211*4d7e907cSAndroid Build Coastguard Worker */ 212*4d7e907cSAndroid Build Coastguard Worker oneway setAllowedCarriers_1_4(int32_t serial, CarrierRestrictionsWithPriority carriers, 213*4d7e907cSAndroid Build Coastguard Worker SimLockMultiSimPolicy multiSimPolicy); 214*4d7e907cSAndroid Build Coastguard Worker 215*4d7e907cSAndroid Build Coastguard Worker /** 216*4d7e907cSAndroid Build Coastguard Worker * Get carrier restrictions. 217*4d7e907cSAndroid Build Coastguard Worker * 218*4d7e907cSAndroid Build Coastguard Worker * @param serial Serial number of request. 219*4d7e907cSAndroid Build Coastguard Worker * 220*4d7e907cSAndroid Build Coastguard Worker * Response callback is IRadioResponse.getAllowedCarriersResponse_1_4() 221*4d7e907cSAndroid Build Coastguard Worker */ 222*4d7e907cSAndroid Build Coastguard Worker oneway getAllowedCarriers_1_4(int32_t serial); 223*4d7e907cSAndroid Build Coastguard Worker 224*4d7e907cSAndroid Build Coastguard Worker /** 225*4d7e907cSAndroid Build Coastguard Worker * Requests current signal strength and associated information. Must succeed if radio is on. 226*4d7e907cSAndroid Build Coastguard Worker * 227*4d7e907cSAndroid Build Coastguard Worker * @param serial Serial number of request. 228*4d7e907cSAndroid Build Coastguard Worker * 229*4d7e907cSAndroid Build Coastguard Worker * Response function is IRadioResponse.getSignalStrengthResponse_1_4() 230*4d7e907cSAndroid Build Coastguard Worker */ 231*4d7e907cSAndroid Build Coastguard Worker oneway getSignalStrength_1_4(int32_t serial); 232*4d7e907cSAndroid Build Coastguard Worker}; 233