Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 17 | package android.hardware.radio@1.4; |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 18 | |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 19 | import @1.0::Dial; |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 20 | import @1.2::DataRequestReason; |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 21 | import @1.3::IRadio; |
| 22 | import @1.4::AccessNetwork; |
Malcolm Chen | ded4399 | 2018-11-27 20:23:13 -0800 | [diff] [blame] | 23 | import @1.4::DataProfileInfo; |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 24 | import @1.4::EmergencyServiceCategory; |
Pengquan Meng | 1ed3924 | 2018-12-10 18:22:47 -0800 | [diff] [blame] | 25 | import @1.4::RadioAccessFamily; |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * This interface is used by telephony and telecom to talk to cellular radio. |
| 29 | * All the functions have minimum one parameter: |
| 30 | * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the |
| 31 | * duration of a method call. If clients provide colliding serials (including passing the same |
| 32 | * serial to different methods), multiple responses (one for each method call) must still be served. |
| 33 | * setResponseFunctions must work with @1.1::IRadioResponse and @1.1::IRadioIndication. |
| 34 | */ |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 35 | interface IRadio extends @1.3::IRadio { |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 36 | /** |
| 37 | * Setup a packet data connection. If DataCallResponse.status returns DataCallFailCause:NONE, |
| 38 | * the data connection must be added to data calls and a unsolDataCallListChanged() must be |
| 39 | * sent. The call remains until removed by subsequent unsolDataCallIstChanged(). It may be |
| 40 | * lost due to many factors, including deactivateDataCall() being issued, the radio powered |
| 41 | * off, reception lost or even transient factors like congestion. This data call list is |
| 42 | * returned by getDataCallList() and dataCallListChanged(). |
| 43 | * |
| 44 | * The Radio is expected to: |
| 45 | * - Create one data call context. |
| 46 | * - Create and configure a dedicated interface for the context. |
| 47 | * - The interface must be point to point. |
| 48 | * - The interface is configured with one or more addresses and is capable of sending and |
| 49 | * receiving packets. The prefix length of the addresses must be /32 for IPv4 and /128 |
| 50 | * for IPv6. |
| 51 | * - Must not modify routing configuration related to this interface; routing management is |
| 52 | * exclusively within the purview of the Android OS. |
| 53 | * - Support simultaneous data call contexts up to DataRegStateResult.maxDataCalls specified |
| 54 | * in the response of getDataRegistrationState. |
| 55 | * |
| 56 | * @param serial Serial number of request. |
| 57 | * @param accessNetwork The access network to setup the data call. If the data connection cannot |
| 58 | * be established on the specified access network, the setup request must be failed. |
| 59 | * @param dataProfileInfo Data profile info. |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 60 | * @param roamingAllowed Indicates whether or not data roaming is allowed by the user. |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 61 | * @param reason The request reason. Must be DataRequestReason.NORMAL or |
| 62 | * DataRequestReason.HANDOVER. |
| 63 | * @param addresses If the reason is DataRequestReason.HANDOVER, this indicates the list of link |
| 64 | * addresses of the existing data connection. The format is IP address with optional "/" |
| 65 | * prefix length (The format is defined in RFC-4291 section 2.3). For example, "192.0.1.3", |
| 66 | * "192.0.1.11/16", or "2001:db8::1/64". Typically one IPv4 or one IPv6 or one of each. If |
| 67 | * the prefix length is absent, then the addresses are assumed to be point to point with |
| 68 | * IPv4 with prefix length 32 or IPv6 with prefix length 128. This parameter must be ignored |
| 69 | * unless reason is DataRequestReason.HANDOVER. |
| 70 | * @param dnses If the reason is DataRequestReason.HANDOVER, this indicates the list of DNS |
| 71 | * addresses of the existing data connection. The format is defined in RFC-4291 section |
| 72 | * 2.2. For example, "192.0.1.3" or "2001:db8::1". This parameter must be ignored unless |
| 73 | * reason is DataRequestReason.HANDOVER. |
| 74 | * |
| 75 | * Response function is IRadioResponse.setupDataCallResponse() |
| 76 | * |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 77 | * Note this API is same as 1.2 version except using the 1.4 AccessNetwork as the input param. |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 78 | */ |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 79 | oneway setupDataCall_1_4(int32_t serial, AccessNetwork accessNetwork, |
Jack Yu | e7de00c | 2018-09-14 17:27:27 -0700 | [diff] [blame] | 80 | DataProfileInfo dataProfileInfo, bool roamingAllowed, |
| 81 | DataRequestReason reason, vec<string> addresses, vec<string> dnses); |
| 82 | |
| 83 | /** |
| 84 | * Set an apn to initial attach network |
| 85 | * |
| 86 | * @param serial Serial number of request. |
| 87 | * @param dataProfileInfo data profile containing APN settings |
| 88 | * |
| 89 | * Response callback is IRadioResponse.setInitialAttachApnResponse() |
| 90 | */ |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 91 | oneway setInitialAttachApn_1_4(int32_t serial, DataProfileInfo dataProfileInfo); |
Jack Yu | e7de00c | 2018-09-14 17:27:27 -0700 | [diff] [blame] | 92 | |
| 93 | /** |
| 94 | * Send data profiles of the current carrier to the modem. |
| 95 | * |
| 96 | * @param serial Serial number of request. |
| 97 | * @param profiles Array of DataProfile to set. |
| 98 | * |
| 99 | * Response callback is IRadioResponse.setDataProfileResponse() |
| 100 | */ |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 101 | oneway setDataProfile_1_4(int32_t serial, vec<DataProfileInfo> profiles); |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 102 | |
| 103 | /** |
sqian | 968f531 | 2018-09-19 14:10:42 -0700 | [diff] [blame] | 104 | * Initiate emergency voice call, with zero or more emergency service category(s). |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 105 | * |
| 106 | * Note this API is the same as IRadio.dial except using the |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 107 | * @1.4::EmergencyServiceCategory as the input param. |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 108 | * |
sqian | ed2eb3d | 2018-12-07 22:00:12 -0800 | [diff] [blame^] | 109 | * If the number in the 'dialInfo' field is identified as an emergency number in Android, |
| 110 | * Android use this request for its emergency call instead of @1.0::IRadio.dial. The |
| 111 | * implementation decides how to handle the call (e.g. emergency routing or normal |
| 112 | * routing). |
| 113 | * |
sqian | 968f531 | 2018-09-19 14:10:42 -0700 | [diff] [blame] | 114 | * If the dialed emergency number does not have a specified emergency service category, the |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 115 | * 'categories' field is set to @1.4::EmergencyServiceCategory#UNSPECIFIED; iff either the |
| 116 | * 'categories' field is set to @1.4::EmergencyServiceCategory#UNSPECIFIED or the underlying |
sqian | 968f531 | 2018-09-19 14:10:42 -0700 | [diff] [blame] | 117 | * technology used to request emergency services does not support the emergency service |
| 118 | * category, the interpretation of the categories is defined by implementation. |
| 119 | * |
| 120 | * Reference: 3gpp TS 22.101, Section 10 - Emergency Calls |
| 121 | * |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 122 | * @param serial Serial number of request. |
| 123 | * @param dialInfo the same @1.0::Dial information used by @1.0::IRadio.dial. |
Malcolm Chen | 638f005 | 2018-11-26 13:11:03 -0800 | [diff] [blame] | 124 | * @param categories bitfield<@1.4::EmergencyServiceCategory> the Emergency Service Category(s) |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 125 | * of the call. |
| 126 | * |
| 127 | * Response function is IRadioResponse.emergencyDialResponse() |
| 128 | */ |
| 129 | oneway emergencyDial(int32_t serial, Dial dialInfo, |
| 130 | bitfield<EmergencyServiceCategory> categories); |
Pengquan Meng | 1ed3924 | 2018-12-10 18:22:47 -0800 | [diff] [blame] | 131 | |
| 132 | /** |
| 133 | * Query the preferred network type bitmap. |
| 134 | * |
| 135 | * @param serial Serial number of request. |
| 136 | * |
| 137 | * Response callback is IRadioResponse.getPreferredNetworkTypeBitmapResponse() |
| 138 | */ |
| 139 | oneway getPreferredNetworkTypeBitmap(int32_t serial); |
| 140 | |
| 141 | /** |
| 142 | * Requests to set the preferred network type for searching and registering. |
| 143 | * |
| 144 | * @param serial Serial number of request. |
| 145 | * @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily. |
| 146 | * |
| 147 | * Response callback is IRadioResponse.setPreferredNetworkTypeBitmapResponse() |
| 148 | */ |
| 149 | oneway setPreferredNetworkTypeBitmap( |
| 150 | int32_t serial, bitfield<RadioAccessFamily> networkTypeBitmap); |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 151 | }; |