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 | |
| 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 | */ |
| 27 | interface IAGnssRil { |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 28 | enum SetIDType : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 29 | NONE = 0, |
| 30 | IMSI = 1, |
| 31 | MSISDM = 2 |
| 32 | }; |
| 33 | |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 34 | enum NetworkType : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 35 | MOBILE = 0, |
| 36 | WIFI = 1, |
| 37 | MMS = 2, |
| 38 | SUPL = 3, |
| 39 | DUN = 4, |
| 40 | HIPRI = 5, |
| 41 | WIMAX = 6, |
| 42 | }; |
| 43 | |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 44 | enum AGnssRefLocationType : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 45 | GSM_CELLID = 1, |
| 46 | UMTS_CELLID = 2, |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 47 | 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 Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 77 | /* Represents ref locations */ |
| 78 | struct AGnssRefLocation { |
| 79 | AGnssRefLocationType type; |
| 80 | |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 81 | AGnssRefLocationCellID cellID; |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 82 | }; |
| 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 Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 95 | * @param agnssReflocation AGNSS reference location CellID. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 96 | */ |
| 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 | }; |