blob: 12289f685684eb3dfc028380ddc28dd96f328ef4 [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
Andreas Huber40d3a9b2017-03-28 16:19:16 -070021/**
Hridya Valsarajue596a712016-09-22 14:07:22 -070022 * 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
Andreas Huber40d3a9b2017-03-28 16:19:16 -070053 /** CellID for 2G, 3G and LTE, used in AGNSS. */
Hridya Valsarajue596a712016-09-22 14:07:22 -070054 struct AGnssRefLocationCellID {
55 AGnssRefLocationType type;
56
Andreas Huber40d3a9b2017-03-28 16:19:16 -070057 /** Mobile Country Code. */
Hridya Valsarajue596a712016-09-22 14:07:22 -070058 uint16_t mcc;
59
Andreas Huber40d3a9b2017-03-28 16:19:16 -070060 /**
61 * Mobile Network Code .*/
Hridya Valsarajue596a712016-09-22 14:07:22 -070062 uint16_t mnc;
63
Andreas Huber40d3a9b2017-03-28 16:19:16 -070064 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070065 * Location Area Code in 2G, 3G and LTE. In 3G lac is discarded. In LTE,
66 * lac is populated with tac, to ensure that we don't break old clients that
67 * might rely in the old (wrong) behavior.
68 */
69 uint16_t lac;
70
Andreas Huber40d3a9b2017-03-28 16:19:16 -070071 /** Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. */
Hridya Valsarajue596a712016-09-22 14:07:22 -070072 uint32_t cid;
73
Andreas Huber40d3a9b2017-03-28 16:19:16 -070074 /** Tracking Area Code in LTE. */
Hridya Valsarajue596a712016-09-22 14:07:22 -070075 uint16_t tac;
76
Andreas Huber40d3a9b2017-03-28 16:19:16 -070077 /** Physical Cell id in LTE (not used in 2G and 3G) */
Hridya Valsarajue596a712016-09-22 14:07:22 -070078 uint16_t pcid;
79 };
80
Andreas Huber40d3a9b2017-03-28 16:19:16 -070081 /** Represents ref locations */
Hridya Valsarajue596a712016-09-22 14:07:22 -070082 struct AGnssRefLocation {
83 AGnssRefLocationType type;
84
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070085 AGnssRefLocationCellID cellID;
Hridya Valsarajue596a712016-09-22 14:07:22 -070086 };
87
Andreas Huber40d3a9b2017-03-28 16:19:16 -070088 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070089 * Opens the AGNSS interface and provides the callback routines
90 * to the implementation of this interface.
91 *
92 * @param callback Interface for AGnssRil callbacks.
93 */
94 setCallback(IAGnssRilCallback callback);
95
Andreas Huber40d3a9b2017-03-28 16:19:16 -070096 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070097 * Sets the reference location.
98 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070099 * @param agnssReflocation AGNSS reference location CellID.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700100 */
101 setRefLocation(AGnssRefLocation agnssReflocation);
102
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700103 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700104 * Sets the SET ID.
105 *
106 * @param type Must be populated with either IMSI or MSISDN or NONE.
107 * @param setid If type is IMSI then setid is populated with
108 * a string representing the unique Subscriber ID, for example, the IMSI for
109 * a GMS phone. If type is MSISDN, then setid must contain
110 * the phone number string for line 1. For example, the MSISDN for a GSM phone.
111 * If the type is NONE, then the string must be empty.
112 *
113 * @return success True if all parameters were valid and operation was
114 * successful.
115 */
116 setSetId(SetIDType type, string setid) generates (bool success);
117
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700118 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700119 * Notify GNSS of network status changes.
120 *
121 * @param connected Indicates whether network connectivity exists and
122 * it is possible to establish connections and pass data.
123 * @param type Indicates the kind of network, for eg. mobile, wifi etc.
124 * @param roaming Indicates whether the device is currently roaming on
125 * this network.
126 *
127 * @return success True is all parameters were valid and operation was
128 * successful.
129 */
130 updateNetworkState(bool connected, NetworkType type, bool roaming)
131 generates (bool success);
132
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700133 /**
Wyatt Riley5c196e02017-04-18 13:20:06 -0700134 * Notify GNSS of network status changes and current APN.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700135 *
136 * @param available Indicates whether network connectivity is available.
Wyatt Riley5c196e02017-04-18 13:20:06 -0700137 * @param apn String containing the telephony preferred Access Point Name.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700138 *
139 * @return success True if all parameters were valid and the operation was
140 * successful.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700141 */
142 updateNetworkAvailability(bool available, string apn) generates (bool success);
143
144};