Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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@2.0; |
| 18 | |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 19 | import android.hardware.gnss.measurement_corrections@1.0::IMeasurementCorrections; |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 20 | import android.hardware.gnss.visibility_control@1.0::IGnssVisibilityControl; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 21 | import @1.1::IGnss; |
| 22 | |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 23 | import GnssLocation; |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 24 | import IGnssCallback; |
Anil Admal | 4e50a4c | 2018-12-19 15:22:13 -0800 | [diff] [blame] | 25 | import IGnssConfiguration; |
Yu-Han Yang | 6999a0f | 2019-03-14 11:08:43 -0700 | [diff] [blame] | 26 | import IGnssDebug; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 27 | import IGnssMeasurement; |
Anil Admal | 3a405c5 | 2018-11-14 09:35:14 -0800 | [diff] [blame] | 28 | import IAGnss; |
Anil Admal | b02bcc1 | 2018-11-14 10:23:45 -0800 | [diff] [blame] | 29 | import IAGnssRil; |
Anil Admal | 704bc61 | 2019-03-21 18:45:30 +0000 | [diff] [blame] | 30 | import IGnssBatching; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 31 | |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 32 | /** |
| 33 | * Represents the standard GNSS (Global Navigation Satellite System) interface. |
| 34 | * |
| 35 | * Due to the introduction of new GNSS HAL package android.hardware.gnss.visibility_control@1.0 |
| 36 | * the interface @1.0::IGnssNi.hal and @1.0::IGnssNiCallback.hal are deprecated in this version |
| 37 | * and are not supported by the framework. The GNSS HAL implementation of this interface |
| 38 | * must return nullptr for the following @1.0::IGnss method. |
Anil Admal | a3afa5c | 2019-05-08 18:18:19 -0700 | [diff] [blame] | 39 | * getExtensionGnssNi() generates (IGnssNi gnssNiIface); |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 40 | */ |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 41 | interface IGnss extends @1.1::IGnss { |
Anil Admal | 4e50a4c | 2018-12-19 15:22:13 -0800 | [diff] [blame] | 42 | /** |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 43 | * Opens the interface and provides the callback routines to the implementation of this |
| 44 | * interface. |
| 45 | * |
Anil Admal | a3afa5c | 2019-05-08 18:18:19 -0700 | [diff] [blame] | 46 | * The framework calls this method to instruct the GPS engine to prepare for serving requests |
| 47 | * from the framework. The GNSS HAL implementation must respond to all GNSS requests from the |
| 48 | * framework upon successful return from this method until cleanup() method is called to |
| 49 | * close this interface. |
| 50 | * |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 51 | * @param callback Callback interface for IGnss. |
| 52 | * |
| 53 | * @return success Returns true on success. |
| 54 | */ |
| 55 | setCallback_2_0(IGnssCallback callback) generates (bool success); |
| 56 | |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 57 | /** |
Anil Admal | 4e50a4c | 2018-12-19 15:22:13 -0800 | [diff] [blame] | 58 | * This method returns the IGnssConfiguration interface. |
| 59 | * |
| 60 | * @return gnssConfigurationIface Handle to the IGnssConfiguration interface. |
| 61 | */ |
| 62 | getExtensionGnssConfiguration_2_0() generates (IGnssConfiguration gnssConfigurationIface); |
| 63 | |
| 64 | /** |
Yu-Han Yang | 6999a0f | 2019-03-14 11:08:43 -0700 | [diff] [blame] | 65 | * This method returns the IGnssDebug interface. |
| 66 | * |
| 67 | * @return gnssDebugIface Handle to the IGnssDebug interface. |
| 68 | */ |
| 69 | getExtensionGnssDebug_2_0() generates (IGnssDebug gnssDebugIface); |
| 70 | |
| 71 | /** |
Anil Admal | 3a405c5 | 2018-11-14 09:35:14 -0800 | [diff] [blame] | 72 | * This method returns the IAGnss Interface. |
| 73 | * |
| 74 | * The getExtensionAGnss() must return nullptr as the @1.0::IAGnss interface is |
| 75 | * deprecated. |
| 76 | * |
| 77 | * @return aGnssIface Handle to the IAGnss interface. |
| 78 | */ |
| 79 | getExtensionAGnss_2_0() generates (IAGnss aGnssIface); |
| 80 | |
| 81 | /** |
Anil Admal | b02bcc1 | 2018-11-14 10:23:45 -0800 | [diff] [blame] | 82 | * This method returns the IAGnssRil Interface. |
| 83 | * |
| 84 | * @return aGnssRilIface Handle to the IAGnssRil interface. |
| 85 | */ |
| 86 | getExtensionAGnssRil_2_0() generates (IAGnssRil aGnssRilIface); |
| 87 | |
| 88 | /** |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 89 | * This method returns the IGnssMeasurement interface. |
| 90 | * |
Anil Admal | a3afa5c | 2019-05-08 18:18:19 -0700 | [diff] [blame] | 91 | * Exactly one of getExtensionGnssMeasurement(), getExtensionGnssMeasurement_1_1(), and |
| 92 | * getExtensionGnssMeasurement_2_0() methods must return a non-null handle, and the other |
| 93 | * methods must return nullptr. |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 94 | * |
| 95 | * @return gnssMeasurementIface Handle to the IGnssMeasurement interface. |
| 96 | */ |
| 97 | getExtensionGnssMeasurement_2_0() generates (IGnssMeasurement gnssMeasurementIface); |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 98 | |
| 99 | /** |
| 100 | * This method returns the IMeasurementCorrections interface. |
| 101 | * |
| 102 | * @return measurementCorrectionsIface Handle to the IMeasurementCorrections interface. |
| 103 | */ |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 104 | getExtensionMeasurementCorrections() |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 105 | generates (IMeasurementCorrections measurementCorrectionsIface); |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 106 | |
| 107 | /** |
| 108 | * This method returns the IGnssVisibilityControl interface. |
| 109 | * |
| 110 | * @return visibilityControlIface Handle to the IGnssVisibilityControl interface. |
| 111 | */ |
| 112 | getExtensionVisibilityControl() generates (IGnssVisibilityControl visibilityControlIface); |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 113 | |
| 114 | /** |
Anil Admal | 704bc61 | 2019-03-21 18:45:30 +0000 | [diff] [blame] | 115 | * This method returns the IGnssBatching interface. |
| 116 | * |
| 117 | * @return batchingIface Handle to the IGnssBatching interface. |
| 118 | */ |
| 119 | getExtensionGnssBatching_2_0() generates (IGnssBatching batchingIface); |
| 120 | |
| 121 | /** |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 122 | * Injects current location from the best available location provider. |
| 123 | * |
| 124 | * Unlike injectLocation, this method may inject a recent GNSS location from the HAL |
| 125 | * implementation, if that is the best available location known to the framework. |
| 126 | * |
| 127 | * @param location Location information from the best available location provider. |
| 128 | * |
| 129 | * @return success Returns true if successful. |
| 130 | */ |
| 131 | injectBestLocation_2_0(GnssLocation location) generates (bool success); |
Anil Admal | 4d739e7 | 2018-11-14 12:38:57 -0800 | [diff] [blame] | 132 | }; |