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