blob: fb73498ba480eaa6329aa6ff5eabb8025064720a [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 {
28 enum SetIDType : uint16_t {
29 NONE = 0,
30 IMSI = 1,
31 MSISDM = 2
32 };
33
34 enum NetworkType : int32_t {
35 MOBILE = 0,
36 WIFI = 1,
37 MMS = 2,
38 SUPL = 3,
39 DUN = 4,
40 HIPRI = 5,
41 WIMAX = 6,
42 };
43
44 enum AGnssRefLocationType {
45 GSM_CELLID = 1,
46 UMTS_CELLID = 2,
47 MAC = 3,
48 LTE_CELLID = 4,
49 };
50
51 /* CellID for 2G, 3G and LTE, used in AGNSS. */
52 struct AGnssRefLocationCellID {
53 AGnssRefLocationType type;
54
55 /* Mobile Country Code. */
56 uint16_t mcc;
57
58 /* Mobile Network Code .*/
59 uint16_t mnc;
60
61 /*
62 * Location Area Code in 2G, 3G and LTE. In 3G lac is discarded. In LTE,
63 * lac is populated with tac, to ensure that we don't break old clients that
64 * might rely in the old (wrong) behavior.
65 */
66 uint16_t lac;
67
68 /* Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. */
69 uint32_t cid;
70
71 /* Tracking Area Code in LTE. */
72 uint16_t tac;
73
74 /* Physical Cell id in LTE (not used in 2G and 3G) */
75 uint16_t pcid;
76 };
77
78 struct AGnssRefLocationMac {
79 uint8_t[6] mac;
80 };
81
82 /* Represents ref locations */
83 struct AGnssRefLocation {
84 AGnssRefLocationType type;
85
86 union RefLoc {
87 AGnssRefLocationCellID cellID;
88 AGnssRefLocationMac mac;
89 };
90
91 RefLoc refLocVal;
92 };
93
94 /*
95 * Opens the AGNSS interface and provides the callback routines
96 * to the implementation of this interface.
97 *
98 * @param callback Interface for AGnssRil callbacks.
99 */
100 setCallback(IAGnssRilCallback callback);
101
102 /*
103 * Sets the reference location.
104 *
105 * @param agnssReflocation AGNSS reference location CellID/MAC.
106 */
107 setRefLocation(AGnssRefLocation agnssReflocation);
108
109 /*
110 * Sets the SET ID.
111 *
112 * @param type Must be populated with either IMSI or MSISDN or NONE.
113 * @param setid If type is IMSI then setid is populated with
114 * a string representing the unique Subscriber ID, for example, the IMSI for
115 * a GMS phone. If type is MSISDN, then setid must contain
116 * the phone number string for line 1. For example, the MSISDN for a GSM phone.
117 * If the type is NONE, then the string must be empty.
118 *
119 * @return success True if all parameters were valid and operation was
120 * successful.
121 */
122 setSetId(SetIDType type, string setid) generates (bool success);
123
124 /*
125 * Notify GNSS of network status changes.
126 *
127 * @param connected Indicates whether network connectivity exists and
128 * it is possible to establish connections and pass data.
129 * @param type Indicates the kind of network, for eg. mobile, wifi etc.
130 * @param roaming Indicates whether the device is currently roaming on
131 * this network.
132 *
133 * @return success True is all parameters were valid and operation was
134 * successful.
135 */
136 updateNetworkState(bool connected, NetworkType type, bool roaming)
137 generates (bool success);
138
139 /*
140 * Notify GNSS of network status changes.
141 *
142 * @param available Indicates whether network connectivity is available.
143 * @param apn String containing the Access Point Name.
144 *
145 * @return success True if all parameters were valid and the operation was
146 * successful.
147 * TODO(b/32022567): Add VTS test to validate the format of APN.
148 */
149 updateNetworkAvailability(bool available, string apn) generates (bool success);
150
151};