blob: b0810a44229010472d83b863f74942fc031e850a [file] [log] [blame]
Jack Yu15c42992018-08-10 17:13:03 -07001/*
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 Chen638f0052018-11-26 13:11:03 -080017package android.hardware.radio@1.4;
Jack Yu15c42992018-08-10 17:13:03 -070018
sqian8ffbfa52018-08-29 20:26:03 -070019import @1.0::Dial;
Jack Yu15c42992018-08-10 17:13:03 -070020import @1.2::DataRequestReason;
Youming Ye9f94a152019-01-02 15:55:29 -080021import @1.2::NetworkScanRequest;
Malcolm Chen638f0052018-11-26 13:11:03 -080022import @1.3::IRadio;
23import @1.4::AccessNetwork;
Malcolm Chended43992018-11-27 20:23:13 -080024import @1.4::DataProfileInfo;
sqian61424082018-12-18 21:34:32 -080025import @1.4::EmergencyCallRouting;
Malcolm Chen638f0052018-11-26 13:11:03 -080026import @1.4::EmergencyServiceCategory;
Pengquan Meng1ed39242018-12-10 18:22:47 -080027import @1.4::RadioAccessFamily;
Jack Yu15c42992018-08-10 17:13:03 -070028
29/**
30 * This interface is used by telephony and telecom to talk to cellular radio.
31 * All the functions have minimum one parameter:
32 * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the
33 * duration of a method call. If clients provide colliding serials (including passing the same
34 * serial to different methods), multiple responses (one for each method call) must still be served.
35 * setResponseFunctions must work with @1.1::IRadioResponse and @1.1::IRadioIndication.
36 */
Malcolm Chen638f0052018-11-26 13:11:03 -080037interface IRadio extends @1.3::IRadio {
Jack Yu15c42992018-08-10 17:13:03 -070038 /**
39 * Setup a packet data connection. If DataCallResponse.status returns DataCallFailCause:NONE,
40 * the data connection must be added to data calls and a unsolDataCallListChanged() must be
41 * sent. The call remains until removed by subsequent unsolDataCallIstChanged(). It may be
42 * lost due to many factors, including deactivateDataCall() being issued, the radio powered
43 * off, reception lost or even transient factors like congestion. This data call list is
44 * returned by getDataCallList() and dataCallListChanged().
45 *
46 * The Radio is expected to:
47 * - Create one data call context.
48 * - Create and configure a dedicated interface for the context.
49 * - The interface must be point to point.
50 * - The interface is configured with one or more addresses and is capable of sending and
51 * receiving packets. The prefix length of the addresses must be /32 for IPv4 and /128
52 * for IPv6.
53 * - Must not modify routing configuration related to this interface; routing management is
54 * exclusively within the purview of the Android OS.
55 * - Support simultaneous data call contexts up to DataRegStateResult.maxDataCalls specified
56 * in the response of getDataRegistrationState.
57 *
58 * @param serial Serial number of request.
59 * @param accessNetwork The access network to setup the data call. If the data connection cannot
60 * be established on the specified access network, the setup request must be failed.
61 * @param dataProfileInfo Data profile info.
Jack Yu15c42992018-08-10 17:13:03 -070062 * @param roamingAllowed Indicates whether or not data roaming is allowed by the user.
Jack Yu15c42992018-08-10 17:13:03 -070063 * @param reason The request reason. Must be DataRequestReason.NORMAL or
64 * DataRequestReason.HANDOVER.
65 * @param addresses If the reason is DataRequestReason.HANDOVER, this indicates the list of link
66 * addresses of the existing data connection. The format is IP address with optional "/"
67 * prefix length (The format is defined in RFC-4291 section 2.3). For example, "192.0.1.3",
68 * "192.0.1.11/16", or "2001:db8::1/64". Typically one IPv4 or one IPv6 or one of each. If
69 * the prefix length is absent, then the addresses are assumed to be point to point with
70 * IPv4 with prefix length 32 or IPv6 with prefix length 128. This parameter must be ignored
71 * unless reason is DataRequestReason.HANDOVER.
72 * @param dnses If the reason is DataRequestReason.HANDOVER, this indicates the list of DNS
73 * addresses of the existing data connection. The format is defined in RFC-4291 section
74 * 2.2. For example, "192.0.1.3" or "2001:db8::1". This parameter must be ignored unless
75 * reason is DataRequestReason.HANDOVER.
76 *
77 * Response function is IRadioResponse.setupDataCallResponse()
78 *
Malcolm Chen638f0052018-11-26 13:11:03 -080079 * Note this API is same as 1.2 version except using the 1.4 AccessNetwork as the input param.
Jack Yu15c42992018-08-10 17:13:03 -070080 */
Malcolm Chen638f0052018-11-26 13:11:03 -080081 oneway setupDataCall_1_4(int32_t serial, AccessNetwork accessNetwork,
Jack Yue7de00c2018-09-14 17:27:27 -070082 DataProfileInfo dataProfileInfo, bool roamingAllowed,
83 DataRequestReason reason, vec<string> addresses, vec<string> dnses);
84
85 /**
86 * Set an apn to initial attach network
87 *
88 * @param serial Serial number of request.
89 * @param dataProfileInfo data profile containing APN settings
90 *
91 * Response callback is IRadioResponse.setInitialAttachApnResponse()
92 */
Malcolm Chen638f0052018-11-26 13:11:03 -080093 oneway setInitialAttachApn_1_4(int32_t serial, DataProfileInfo dataProfileInfo);
Jack Yue7de00c2018-09-14 17:27:27 -070094
95 /**
96 * Send data profiles of the current carrier to the modem.
97 *
98 * @param serial Serial number of request.
99 * @param profiles Array of DataProfile to set.
100 *
101 * Response callback is IRadioResponse.setDataProfileResponse()
102 */
Malcolm Chen638f0052018-11-26 13:11:03 -0800103 oneway setDataProfile_1_4(int32_t serial, vec<DataProfileInfo> profiles);
sqian8ffbfa52018-08-29 20:26:03 -0700104
105 /**
sqian61424082018-12-18 21:34:32 -0800106 * Initiate emergency voice call, with zero or more emergency service category(s) and routing
107 * information for handling the call. Android uses this request to make its emergency call
108 * instead of using @1.0::IRadio.dial if the 'address' in the 'dialInfo' field is identified
109 * as an emergency number by Android.
sqian8ffbfa52018-08-29 20:26:03 -0700110 *
sqian61424082018-12-18 21:34:32 -0800111 * In multi-sim senario, this radio request is sent through the IRadio service that serves
112 * the subscription the emergency number belongs to, no matter of the PUK/PIN state of the
113 * subscription and the service state.
sqian8ffbfa52018-08-29 20:26:03 -0700114 *
sqian61424082018-12-18 21:34:32 -0800115 * Some countries or carriers require some emergency numbers that must be handled with normal
116 * call routing or emergency routing. If the 'routing' field is specified as
117 * @1.4::EmergencyNumberRouting#NORMAL, the implementation must use normal call routing to
118 * handle the call; if it is specified as @1.4::EmergencyNumberRouting#EMERGENCY, the
119 * implementation must use emergency routing to handle the call; if it is
120 * @1.4::EmergencyNumberRouting#UNKNOWN, Android does not know how to handle the call.
sqianed2eb3d2018-12-07 22:00:12 -0800121 *
sqian968f5312018-09-19 14:10:42 -0700122 * If the dialed emergency number does not have a specified emergency service category, the
sqian61424082018-12-18 21:34:32 -0800123 * 'categories' field is set to @1.4::EmergencyServiceCategory#UNSPECIFIED; if the underlying
sqian968f5312018-09-19 14:10:42 -0700124 * technology used to request emergency services does not support the emergency service
sqian61424082018-12-18 21:34:32 -0800125 * category, the categories may be ignored.
sqian968f5312018-09-19 14:10:42 -0700126 *
127 * Reference: 3gpp TS 22.101, Section 10 - Emergency Calls
128 *
sqian8ffbfa52018-08-29 20:26:03 -0700129 * @param serial Serial number of request.
130 * @param dialInfo the same @1.0::Dial information used by @1.0::IRadio.dial.
Malcolm Chen638f0052018-11-26 13:11:03 -0800131 * @param categories bitfield<@1.4::EmergencyServiceCategory> the Emergency Service Category(s)
sqian8ffbfa52018-08-29 20:26:03 -0700132 * of the call.
sqian61424082018-12-18 21:34:32 -0800133 * @param routing @1.4::EmergencyCallRouting the emergency call routing information.
sqian8ffbfa52018-08-29 20:26:03 -0700134 *
135 * Response function is IRadioResponse.emergencyDialResponse()
136 */
137 oneway emergencyDial(int32_t serial, Dial dialInfo,
sqian61424082018-12-18 21:34:32 -0800138 bitfield<EmergencyServiceCategory> categories, EmergencyCallRouting routing);
Pengquan Meng1ed39242018-12-10 18:22:47 -0800139
140 /**
Youming Ye9f94a152019-01-02 15:55:29 -0800141 * Starts a network scan
142 *
143 * @param serial Serial number of request.
144 * @param request Defines the radio networks/bands/channels which need to be scanned.
145 *
146 * Same API as @1.2::IRadio.startNetworkScan_1_2, except using the
147 * @1.4::IRadioResponse.startNetworkScanResponse_1_4 as the response.
148 */
149 oneway startNetworkScan_1_4(int32_t serial, NetworkScanRequest request);
150
151 /**
Pengquan Meng1ed39242018-12-10 18:22:47 -0800152 * Query the preferred network type bitmap.
153 *
154 * @param serial Serial number of request.
155 *
156 * Response callback is IRadioResponse.getPreferredNetworkTypeBitmapResponse()
157 */
158 oneway getPreferredNetworkTypeBitmap(int32_t serial);
159
160 /**
161 * Requests to set the preferred network type for searching and registering.
162 *
163 * @param serial Serial number of request.
164 * @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily.
165 *
166 * Response callback is IRadioResponse.setPreferredNetworkTypeBitmapResponse()
167 */
168 oneway setPreferredNetworkTypeBitmap(
169 int32_t serial, bitfield<RadioAccessFamily> networkTypeBitmap);
Jack Yu15c42992018-08-10 17:13:03 -0700170};