1/* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.hardware.radio@1.2; 18 19import @1.1::IRadio; 20import @1.1::RadioAccessNetworks; 21import @1.0::DataProfileInfo; 22import @1.0::RadioTechnology; 23 24/** 25 * This interface is used by telephony and telecom to talk to cellular radio. 26 * All the functions have minimum one parameter: 27 * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the 28 * duration of a method call. If clients provide colliding serials (including passing the same 29 * serial to different methods), multiple responses (one for each method call) must still be served. 30 * setResponseFunctions must work with @1.1::IRadioResponse and @1.1::IRadioIndication. 31 */ 32interface IRadio extends @1.1::IRadio { 33 34 /** 35 * Starts a network scan 36 * 37 * @param serial Serial number of request. 38 * @param request Defines the radio networks/bands/channels which need to be scanned. 39 * 40 * Response function is IRadioResponse.startNetworkScanResponse() 41 */ 42 oneway startNetworkScan_1_2(int32_t serial, NetworkScanRequest request); 43 44 /** 45 * Sets the indication filter. 46 * 47 * Prevents the reporting of specified unsolicited indications from the radio. This is used 48 * for power saving in instances when those indications are not needed. If unset, defaults to 49 * @1.2::IndicationFilter:ALL. 50 * 51 * @param serial Serial number of request. 52 * @param indicationFilter 32-bit bitmap of IndicationFilter. Bits set to 1 indicate the 53 * indications are enabled. See @1.2::IndicationFilter for the definition of each bit. 54 * 55 * Response callback is IRadioResponse.setIndicationFilterResponse() 56 */ 57 oneway setIndicationFilter_1_2(int32_t serial, bitfield<IndicationFilter> indicationFilter); 58 59 /** 60 * Sets the signal strength reporting criteria. 61 * 62 * The resulting reporting criteria are the AND of all the supplied criteria. 63 * 64 * Note: Reporting criteria must be individually set for each RAN. If unset, reporting criteria 65 * for that RAN are implementation-defined. 66 * 67 * Response callback is IRadioResponse.setSignalStrengthReportingCriteriaResponse(). 68 * 69 * @param serial Serial number of request. 70 * @param hysteresisMs A hysteresis time in milliseconds to prevent flapping. A value of 0 71 * disables hysteresis. 72 * @param hysteresisDb An interval in dB defining the required magnitude change between reports. 73 * hysteresisDb must be smaller than the smallest threshold delta. An 74 * interval value of 0 disables hysteresis. 75 * @param thresholdsDbm A vector of trigger thresholds in dBm. A vector size of 0 disables the 76 * use of thresholds for reporting. 77 * @param accessNetwork The type of network for which to apply these thresholds. 78 */ 79 oneway setSignalStrengthReportingCriteria(int32_t serial, int32_t hysteresisMs, 80 int32_t hysteresisDb, vec<int32_t> thresholdsDbm, AccessNetwork accessNetwork); 81 82 /** 83 * Sets the link capacity reporting criteria. 84 * 85 * The resulting reporting criteria are the AND of all the supplied criteria. 86 * 87 * Note: Reporting criteria must be individually set for each RAN. If unset, reporting criteria 88 * for that RAN are implementation-defined. 89 * 90 * Response callback is IRadioResponse.setLinkCapacityReportingCriteriaResponse(). 91 * 92 * @param serial Serial number of request. 93 * @param hysteresisMs A hysteresis time in milliseconds to prevent flapping. A value of 0 94 * disables hysteresis. 95 * @param hysteresisDlKbps An interval in kbps defining the required magnitude change between DL 96 * reports. hysteresisDlKbps must be smaller than the smallest threshold delta. A value of 0 97 * disables hysteresis. 98 * @param hysteresisUlKbps An interval in kbps defining the required magnitude change between UL 99 * reports. hysteresisUlKbps must be smaller than the smallest threshold delta. A value of 0 100 * disables hysteresis. 101 * @param thresholdsDownlinkKbps A vector of trigger thresholds in kbps for downlink reports. A 102 * vector size of 0 disables the use of DL thresholds for reporting. 103 * @param thresholdsUplinkKbps A vector of trigger thresholds in kbps for uplink reports. A 104 * vector size of 0 disables the use of UL thresholds for reporting. 105 * @param accessNetwork The type of network for which to apply these thresholds. 106 */ 107 oneway setLinkCapacityReportingCriteria(int32_t serial, int32_t hysteresisMs, 108 int32_t hysteresisDlKbps, int32_t hysteresisUlKbps, vec<int32_t> thresholdsDownlinkKbps, 109 vec<int32_t> thresholdsUplinkKbps, AccessNetwork accessNetwork); 110 111 /** 112 * Setup a packet data connection. If DataCallResponse.status returns DataCallFailCause:NONE, 113 * the data connection must be added to data calls and a unsolDataCallListChanged() must be 114 * sent. The call remains until removed by subsequent unsolDataCallIstChanged(). It may be 115 * lost due to many factors, including deactivateDataCall() being issued, the radio powered 116 * off, reception lost or even transient factors like congestion. This data call list is 117 * returned by getDataCallList() and dataCallListChanged(). 118 * 119 * The Radio is expected to: 120 * - Create one data call context. 121 * - Create and configure a dedicated interface for the context. 122 * - The interface must be point to point. 123 * - The interface is configured with one or more addresses and is capable of sending and 124 * receiving packets. The prefix length of the addresses must be /32 for IPv4 and /128 125 * for IPv6. 126 * - Must not modify routing configuration related to this interface; routing management is 127 * exclusively within the purview of the Android OS. 128 * - Support simultaneous data call contexts up to DataRegStateResult.maxDataCalls specified 129 * in the response of getDataRegistrationState. 130 * 131 * @param serial Serial number of request. 132 * @param accessNetwork The access network to setup the data call. If the data connection cannot 133 * be established on the specified access network, the setup request must be failed. 134 * @param dataProfileInfo Data profile info. 135 * @param modemCognitive Indicates that the requested profile has previously been provided via 136 * setDataProfile(). 137 * @param roamingAllowed Indicates whether or not data roaming is allowed by the user. 138 * @param isRoaming Indicates whether or not the framework has requested this setupDataCall for 139 * a roaming network. The 'protocol' parameter in the old RIL API must be filled 140 * accordingly based on the roaming condition. Note this is for backward compatibility with 141 * the old radio modem. The modem must not use this param for any other reason. 142 * @param reason The request reason. Must be DataRequestReason.NORMAL or 143 * DataRequestReason.HANDOVER. 144 * @param addresses If the reason is DataRequestReason.HANDOVER, this indicates the list of link 145 * addresses of the existing data connection. The format is IP address with optional "/" 146 * prefix length (The format is defined in RFC-4291 section 2.3). For example, "192.0.1.3", 147 * "192.0.1.11/16", or "2001:db8::1/64". Typically one IPv4 or one IPv6 or one of each. If 148 * the prefix length is absent, then the addresses are assumed to be point to point with 149 * IPv4 with prefix length 32 or IPv6 with prefix length 128. This parameter must be ignored 150 * unless reason is DataRequestReason.HANDOVER. 151 * @param dnses If the reason is DataRequestReason.HANDOVER, this indicates the list of DNS 152 * addresses of the existing data connection. The format is defined in RFC-4291 section 153 * 2.2. For example, "192.0.1.3" or "2001:db8::1". This parameter must be ignored unless 154 * reason is DataRequestReason.HANDOVER. 155 * 156 * Response function is IRadioResponse.setupDataCallResponse() 157 */ 158 oneway setupDataCall_1_2(int32_t serial, AccessNetwork accessNetwork, 159 DataProfileInfo dataProfileInfo, bool modemCognitive, bool roamingAllowed, 160 bool isRoaming, DataRequestReason reason, vec<string> addresses, vec<string> dnses); 161 162 /** 163 * Deactivate packet data connection and remove from the data call list. An 164 * unsolDataCallListChanged() must be sent when data connection is deactivated. 165 * 166 * @param serial Serial number of request. 167 * @param cid Data call id. 168 * @param reason The request reason. Must be normal, handover, or shutdown. 169 * 170 * Response function is IRadioResponse.deactivateDataCallResponse() 171 */ 172 oneway deactivateDataCall_1_2(int32_t serial, int32_t cid, DataRequestReason reason); 173}; 174