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 | |
| 17 | package android.hardware.radio@1.3; |
| 18 | |
Jack Yu | e7de00c | 2018-09-14 17:27:27 -0700 | [diff] [blame^] | 19 | import @1.3::DataProfileInfo; |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 20 | import @1.0::Dial; |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 21 | import @1.2::DataRequestReason; |
| 22 | import @1.2::IRadio; |
| 23 | import @1.3::AccessNetwork; |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 24 | import @1.3::EmergencyServiceCategory; |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * This interface is used by telephony and telecom to talk to cellular radio. |
| 28 | * All the functions have minimum one parameter: |
| 29 | * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the |
| 30 | * duration of a method call. If clients provide colliding serials (including passing the same |
| 31 | * serial to different methods), multiple responses (one for each method call) must still be served. |
| 32 | * setResponseFunctions must work with @1.1::IRadioResponse and @1.1::IRadioIndication. |
| 33 | */ |
| 34 | interface IRadio extends @1.2::IRadio { |
| 35 | /** |
| 36 | * Setup a packet data connection. If DataCallResponse.status returns DataCallFailCause:NONE, |
| 37 | * the data connection must be added to data calls and a unsolDataCallListChanged() must be |
| 38 | * sent. The call remains until removed by subsequent unsolDataCallIstChanged(). It may be |
| 39 | * lost due to many factors, including deactivateDataCall() being issued, the radio powered |
| 40 | * off, reception lost or even transient factors like congestion. This data call list is |
| 41 | * returned by getDataCallList() and dataCallListChanged(). |
| 42 | * |
| 43 | * The Radio is expected to: |
| 44 | * - Create one data call context. |
| 45 | * - Create and configure a dedicated interface for the context. |
| 46 | * - The interface must be point to point. |
| 47 | * - The interface is configured with one or more addresses and is capable of sending and |
| 48 | * receiving packets. The prefix length of the addresses must be /32 for IPv4 and /128 |
| 49 | * for IPv6. |
| 50 | * - Must not modify routing configuration related to this interface; routing management is |
| 51 | * exclusively within the purview of the Android OS. |
| 52 | * - Support simultaneous data call contexts up to DataRegStateResult.maxDataCalls specified |
| 53 | * in the response of getDataRegistrationState. |
| 54 | * |
| 55 | * @param serial Serial number of request. |
| 56 | * @param accessNetwork The access network to setup the data call. If the data connection cannot |
| 57 | * be established on the specified access network, the setup request must be failed. |
| 58 | * @param dataProfileInfo Data profile info. |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 59 | * @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] | 60 | * @param reason The request reason. Must be DataRequestReason.NORMAL or |
| 61 | * DataRequestReason.HANDOVER. |
| 62 | * @param addresses If the reason is DataRequestReason.HANDOVER, this indicates the list of link |
| 63 | * addresses of the existing data connection. The format is IP address with optional "/" |
| 64 | * prefix length (The format is defined in RFC-4291 section 2.3). For example, "192.0.1.3", |
| 65 | * "192.0.1.11/16", or "2001:db8::1/64". Typically one IPv4 or one IPv6 or one of each. If |
| 66 | * the prefix length is absent, then the addresses are assumed to be point to point with |
| 67 | * IPv4 with prefix length 32 or IPv6 with prefix length 128. This parameter must be ignored |
| 68 | * unless reason is DataRequestReason.HANDOVER. |
| 69 | * @param dnses If the reason is DataRequestReason.HANDOVER, this indicates the list of DNS |
| 70 | * addresses of the existing data connection. The format is defined in RFC-4291 section |
| 71 | * 2.2. For example, "192.0.1.3" or "2001:db8::1". This parameter must be ignored unless |
| 72 | * reason is DataRequestReason.HANDOVER. |
| 73 | * |
| 74 | * Response function is IRadioResponse.setupDataCallResponse() |
| 75 | * |
| 76 | * Note this API is same as 1.2 version except using the 1.3 AccessNetwork as the input param. |
| 77 | */ |
| 78 | oneway setupDataCall_1_3(int32_t serial, AccessNetwork accessNetwork, |
Jack Yu | e7de00c | 2018-09-14 17:27:27 -0700 | [diff] [blame^] | 79 | DataProfileInfo dataProfileInfo, bool roamingAllowed, |
| 80 | DataRequestReason reason, vec<string> addresses, vec<string> dnses); |
| 81 | |
| 82 | /** |
| 83 | * Set an apn to initial attach network |
| 84 | * |
| 85 | * @param serial Serial number of request. |
| 86 | * @param dataProfileInfo data profile containing APN settings |
| 87 | * |
| 88 | * Response callback is IRadioResponse.setInitialAttachApnResponse() |
| 89 | */ |
| 90 | oneway setInitialAttachApn_1_3(int32_t serial, DataProfileInfo dataProfileInfo); |
| 91 | |
| 92 | /** |
| 93 | * Send data profiles of the current carrier to the modem. |
| 94 | * |
| 95 | * @param serial Serial number of request. |
| 96 | * @param profiles Array of DataProfile to set. |
| 97 | * |
| 98 | * Response callback is IRadioResponse.setDataProfileResponse() |
| 99 | */ |
| 100 | oneway setDataProfile_1_3(int32_t serial, vec<DataProfileInfo> profiles); |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 101 | |
| 102 | /** |
sqian | 968f531 | 2018-09-19 14:10:42 -0700 | [diff] [blame] | 103 | * Initiate emergency voice call, with zero or more emergency service category(s). |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 104 | * |
| 105 | * Note this API is the same as IRadio.dial except using the |
| 106 | * @1.3::EmergencyServiceCategory as the input param. |
| 107 | * |
sqian | 968f531 | 2018-09-19 14:10:42 -0700 | [diff] [blame] | 108 | * If the dialed emergency number does not have a specified emergency service category, the |
| 109 | * 'categories' field is set to @1.3::EmergencyServiceCategory#UNSPECIFIED; iff either the |
| 110 | * 'categories' field is set to @1.3::EmergencyServiceCategory#UNSPECIFIED or the underlying |
| 111 | * technology used to request emergency services does not support the emergency service |
| 112 | * category, the interpretation of the categories is defined by implementation. |
| 113 | * |
| 114 | * Reference: 3gpp TS 22.101, Section 10 - Emergency Calls |
| 115 | * |
sqian | 8ffbfa5 | 2018-08-29 20:26:03 -0700 | [diff] [blame] | 116 | * @param serial Serial number of request. |
| 117 | * @param dialInfo the same @1.0::Dial information used by @1.0::IRadio.dial. |
| 118 | * @param categories bitfield<@1.3::EmergencyServiceCategory> the Emergency Service Category(s) |
| 119 | * of the call. |
| 120 | * |
| 121 | * Response function is IRadioResponse.emergencyDialResponse() |
| 122 | */ |
| 123 | oneway emergencyDial(int32_t serial, Dial dialInfo, |
| 124 | bitfield<EmergencyServiceCategory> categories); |
Jack Yu | 15c4299 | 2018-08-10 17:13:03 -0700 | [diff] [blame] | 125 | }; |