gomo | 1da4b5c | 2018-12-02 02:49:10 -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 | |
| 19 | import @1.0::IGnssCallback; |
| 20 | import @1.1::IGnssCallback; |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 21 | import GnssLocation; |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * The interface is required for the HAL to communicate certain information |
| 25 | * like status and location info back to the platform, the platform implements |
| 26 | * the interfaces and passes a handle to the HAL. |
| 27 | */ |
| 28 | interface IGnssCallback extends @1.1::IGnssCallback { |
| 29 | |
| 30 | /** Flags for the gnssSetCapabilities callback. */ |
| 31 | @export(name="", value_prefix="GPS_CAPABILITY_") |
| 32 | enum Capabilities : @1.0::IGnssCallback.Capabilities { |
| 33 | /** GNSS supports line-of-sight satellite identification measurement Corrections */ |
| 34 | MEASUREMENT_CORRECTIONS_LOS_SATS = 1 << 8, |
| 35 | /** GNSS supports per satellite excess-path-length measurement Corrections */ |
gomo | 8cb5e3e | 2018-12-19 00:20:23 -0800 | [diff] [blame] | 36 | MEASUREMENT_CORRECTIONS_EXCESS_PATH_LENGTH = 1 << 9, |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 37 | /** GNSS supports reflecting planes measurement Corrections */ |
gomo | 8cb5e3e | 2018-12-19 00:20:23 -0800 | [diff] [blame] | 38 | MEASUREMENT_CORRECTIONS_REFLECTING_PLANE = 1 << 10 |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | /** |
| 42 | * Callback to inform framework of the GNSS engine's capabilities. |
| 43 | * |
| 44 | * @param capabilities Capability parameter is a bit field of the Capabilities enum. |
| 45 | */ |
| 46 | gnssSetCapabilitiesCb_2_0(bitfield<Capabilities> capabilities); |
| 47 | |
Pierre Fite-Georgel | 12ac2b5 | 2019-01-17 16:56:17 -0800 | [diff] [blame] | 48 | /** |
| 49 | * Called when a GNSS location is available. |
| 50 | * |
| 51 | * @param location Location information from HAL. |
| 52 | */ |
| 53 | gnssLocationCb_2_0(GnssLocation location); |
| 54 | |
Yu-Han Yang | 75b35de | 2019-02-13 12:04:52 -0800 | [diff] [blame^] | 55 | /** |
| 56 | * Callback for requesting Location. |
| 57 | * |
| 58 | * HAL implementation must call this when it wants the framework to provide locations to assist |
| 59 | * with GNSS HAL operation, for example, to assist with time to first fix, error recovery, or to |
| 60 | * supplement GNSS location for other clients of the GNSS HAL. |
| 61 | * |
| 62 | * If a request is made with independentFromGnss set to true, the framework must avoid |
| 63 | * providing locations derived from GNSS locations (such as "fused" location), to help improve |
| 64 | * information independence for situations such as error recovery. |
| 65 | * |
| 66 | * In response to this method call, GNSS HAL can expect zero, one, or more calls to |
| 67 | * IGnss::injectLocation or IGnss::injectBestLocation, dependent on availability of location |
| 68 | * from other sources, which may happen at some arbitrary delay. Generally speaking, HAL |
| 69 | * implementations must be able to handle calls to IGnss::injectLocation or |
| 70 | * IGnss::injectBestLocation at any time. |
| 71 | * |
| 72 | * @param independentFromGnss True if requesting a location that is independent from GNSS. |
| 73 | * @param isUserEmergency True if the location request is for delivery of this location to an |
| 74 | * emergency services endpoint, during a user-initiated emergency session (e.g. |
| 75 | * during-call to E911, or up to 5 minutes after end-of-call or text to E911). |
| 76 | */ |
| 77 | gnssRequestLocationCb_2_0(bool independentFromGnss, bool isUserEmergency); |
gomo | 1da4b5c | 2018-12-02 02:49:10 -0800 | [diff] [blame] | 78 | }; |