Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.hardware.gnss@1.0; |
| 18 | |
| 19 | import IAGnssRilCallback; |
| 20 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 21 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 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 | */ |
| 27 | interface IAGnssRil { |
Hridya Valsaraju | 529331c | 2016-11-22 08:17:23 -0800 | [diff] [blame] | 28 | @export(name="", value_prefix="AGPS_SETID_TYPE_") |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 29 | enum SetIDType : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 30 | NONE = 0, |
| 31 | IMSI = 1, |
| 32 | MSISDM = 2 |
| 33 | }; |
| 34 | |
Hridya Valsaraju | 529331c | 2016-11-22 08:17:23 -0800 | [diff] [blame] | 35 | @export(name="", value_prefix="AGPS_RIL_NETWORK_TYPE_") |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 36 | enum NetworkType : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 37 | MOBILE = 0, |
| 38 | WIFI = 1, |
| 39 | MMS = 2, |
| 40 | SUPL = 3, |
| 41 | DUN = 4, |
| 42 | HIPRI = 5, |
| 43 | WIMAX = 6, |
| 44 | }; |
| 45 | |
Hridya Valsaraju | 529331c | 2016-11-22 08:17:23 -0800 | [diff] [blame] | 46 | @export(name="", value_prefix="AGPS_REF_LOCATION_TYPE_") |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 47 | enum AGnssRefLocationType : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 48 | GSM_CELLID = 1, |
| 49 | UMTS_CELLID = 2, |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 50 | LTE_CELLID = 4, |
| 51 | }; |
| 52 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 53 | /** CellID for 2G, 3G and LTE, used in AGNSS. */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 54 | struct AGnssRefLocationCellID { |
| 55 | AGnssRefLocationType type; |
| 56 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 57 | /** Mobile Country Code. */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 58 | uint16_t mcc; |
| 59 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 60 | /** |
| 61 | * Mobile Network Code .*/ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 62 | uint16_t mnc; |
| 63 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 64 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 65 | * 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 Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 71 | /** Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 72 | uint32_t cid; |
| 73 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 74 | /** Tracking Area Code in LTE. */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 75 | uint16_t tac; |
| 76 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 77 | /** Physical Cell id in LTE (not used in 2G and 3G) */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 78 | uint16_t pcid; |
| 79 | }; |
| 80 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 81 | /** Represents ref locations */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 82 | struct AGnssRefLocation { |
| 83 | AGnssRefLocationType type; |
| 84 | |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 85 | AGnssRefLocationCellID cellID; |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 86 | }; |
| 87 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 88 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 89 | * 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 Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 96 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 97 | * Sets the reference location. |
| 98 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 99 | * @param agnssReflocation AGNSS reference location CellID. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 100 | */ |
| 101 | setRefLocation(AGnssRefLocation agnssReflocation); |
| 102 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 103 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 104 | * 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 Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 118 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 119 | * 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 Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 133 | /** |
Wyatt Riley | 5c196e0 | 2017-04-18 13:20:06 -0700 | [diff] [blame] | 134 | * Notify GNSS of network status changes and current APN. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 135 | * |
| 136 | * @param available Indicates whether network connectivity is available. |
Wyatt Riley | 5c196e0 | 2017-04-18 13:20:06 -0700 | [diff] [blame] | 137 | * @param apn String containing the telephony preferred Access Point Name. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 138 | * |
| 139 | * @return success True if all parameters were valid and the operation was |
| 140 | * successful. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 141 | */ |
| 142 | updateNetworkAvailability(bool available, string apn) generates (bool success); |
| 143 | |
| 144 | }; |