blob: 6292273250e211c52efdb452db70c2d6d8090fce [file] [log] [blame]
Hridya Valsarajue596a712016-09-22 14:07:22 -07001/*
2 * Copyright (C) 2016 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.gnss@1.0;
18
19import IAGnssRilCallback;
20
21/*
22 * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface
23 * Layer interface allows the GNSS chipset to request radio interface layer
24 * information from Android platform. Examples of such information are reference
25 * location, unique subscriber ID, phone number string and network availability changes.
26 */
27interface IAGnssRil {
Hridya Valsaraju529331c2016-11-22 08:17:23 -080028 @export(name="", value_prefix="AGPS_SETID_TYPE_")
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070029 enum SetIDType : uint8_t {
Hridya Valsarajue596a712016-09-22 14:07:22 -070030 NONE = 0,
31 IMSI = 1,
32 MSISDM = 2
33 };
34
Hridya Valsaraju529331c2016-11-22 08:17:23 -080035 @export(name="", value_prefix="AGPS_RIL_NETWORK_TYPE_")
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070036 enum NetworkType : uint8_t {
Hridya Valsarajue596a712016-09-22 14:07:22 -070037 MOBILE = 0,
38 WIFI = 1,
39 MMS = 2,
40 SUPL = 3,
41 DUN = 4,
42 HIPRI = 5,
43 WIMAX = 6,
44 };
45
Hridya Valsaraju529331c2016-11-22 08:17:23 -080046 @export(name="", value_prefix="AGPS_REF_LOCATION_TYPE_")
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070047 enum AGnssRefLocationType : uint8_t {
Hridya Valsarajue596a712016-09-22 14:07:22 -070048 GSM_CELLID = 1,
49 UMTS_CELLID = 2,
Hridya Valsarajue596a712016-09-22 14:07:22 -070050 LTE_CELLID = 4,
51 };
52
53 /* CellID for 2G, 3G and LTE, used in AGNSS. */
54 struct AGnssRefLocationCellID {
55 AGnssRefLocationType type;
56
57 /* Mobile Country Code. */
58 uint16_t mcc;
59
60 /* Mobile Network Code .*/
61 uint16_t mnc;
62
63 /*
64 * Location Area Code in 2G, 3G and LTE. In 3G lac is discarded. In LTE,
65 * lac is populated with tac, to ensure that we don't break old clients that
66 * might rely in the old (wrong) behavior.
67 */
68 uint16_t lac;
69
70 /* Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. */
71 uint32_t cid;
72
73 /* Tracking Area Code in LTE. */
74 uint16_t tac;
75
76 /* Physical Cell id in LTE (not used in 2G and 3G) */
77 uint16_t pcid;
78 };
79
Hridya Valsarajue596a712016-09-22 14:07:22 -070080 /* Represents ref locations */
81 struct AGnssRefLocation {
82 AGnssRefLocationType type;
83
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070084 AGnssRefLocationCellID cellID;
Hridya Valsarajue596a712016-09-22 14:07:22 -070085 };
86
87 /*
88 * Opens the AGNSS interface and provides the callback routines
89 * to the implementation of this interface.
90 *
91 * @param callback Interface for AGnssRil callbacks.
92 */
93 setCallback(IAGnssRilCallback callback);
94
95 /*
96 * Sets the reference location.
97 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070098 * @param agnssReflocation AGNSS reference location CellID.
Hridya Valsarajue596a712016-09-22 14:07:22 -070099 */
100 setRefLocation(AGnssRefLocation agnssReflocation);
101
102 /*
103 * Sets the SET ID.
104 *
105 * @param type Must be populated with either IMSI or MSISDN or NONE.
106 * @param setid If type is IMSI then setid is populated with
107 * a string representing the unique Subscriber ID, for example, the IMSI for
108 * a GMS phone. If type is MSISDN, then setid must contain
109 * the phone number string for line 1. For example, the MSISDN for a GSM phone.
110 * If the type is NONE, then the string must be empty.
111 *
112 * @return success True if all parameters were valid and operation was
113 * successful.
114 */
115 setSetId(SetIDType type, string setid) generates (bool success);
116
117 /*
118 * Notify GNSS of network status changes.
119 *
120 * @param connected Indicates whether network connectivity exists and
121 * it is possible to establish connections and pass data.
122 * @param type Indicates the kind of network, for eg. mobile, wifi etc.
123 * @param roaming Indicates whether the device is currently roaming on
124 * this network.
125 *
126 * @return success True is all parameters were valid and operation was
127 * successful.
128 */
129 updateNetworkState(bool connected, NetworkType type, bool roaming)
130 generates (bool success);
131
132 /*
133 * Notify GNSS of network status changes.
134 *
135 * @param available Indicates whether network connectivity is available.
136 * @param apn String containing the Access Point Name.
137 *
138 * @return success True if all parameters were valid and the operation was
139 * successful.
140 * TODO(b/32022567): Add VTS test to validate the format of APN.
141 */
142 updateNetworkAvailability(bool available, string apn) generates (bool success);
143
144};