blob: 4c31cf520896f07ec551037eb74a62a6073e8879 [file] [log] [blame]
gomo1da4b5c2018-12-02 02:49:10 -08001/*
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
17package android.hardware.gnss@2.0;
18
19import @1.0::IGnssCallback;
20import @1.1::IGnssCallback;
Pierre Fite-Georgel12ac2b52019-01-17 16:56:17 -080021import GnssLocation;
gomo1da4b5c2018-12-02 02:49:10 -080022
23/**
Anil Admal86450fa2019-03-11 15:31:05 -070024 * This interface is required for the HAL to communicate certain information
gomo1da4b5c2018-12-02 02:49:10 -080025 * like status and location info back to the platform, the platform implements
26 * the interfaces and passes a handle to the HAL.
27 */
28interface IGnssCallback extends @1.1::IGnssCallback {
29
30 /** Flags for the gnssSetCapabilities callback. */
31 @export(name="", value_prefix="GPS_CAPABILITY_")
Anil Admal86450fa2019-03-11 15:31:05 -070032 enum Capabilities : uint32_t {
33 /**
34 * GNSS HAL schedules fixes for RECURRENCE_PERIODIC mode.
35 * If this is not set, then the framework will use 1000ms for
36 * minInterval and must call start() and stop() to schedule the GNSS.
37 */
38 SCHEDULING = 1 << 0,
39 /** GNSS supports MS-Based AGNSS mode */
40 MSB = 1 << 1,
41 /** GNSS supports MS-Assisted AGNSS mode */
42 MSA = 1 << 2,
43 /** GNSS supports single-shot fixes */
44 SINGLE_SHOT = 1 << 3,
45 /** GNSS supports on demand time injection */
46 ON_DEMAND_TIME = 1 << 4,
47 /**
48 * Values for the flags removed from IGnssCallback.hal@1.0 Capabilities
49 * enum are marked as reserved and not reused here to avoid confusion.
50 */
51 RESERVED_1 = 1 << 5,
52 RESERVED_2 = 1 << 6,
53 RESERVED_3 = 1 << 7,
54 /** GNSS supports low power mode */
55 LOW_POWER_MODE = 1 << 8,
56 /** GNSS supports blacklisting satellites */
57 SATELLITE_BLACKLIST = 1 << 9
gomo1da4b5c2018-12-02 02:49:10 -080058 };
59
60 /**
Anil Admal86450fa2019-03-11 15:31:05 -070061 * Callback to inform framework of the GNSS HAL implementation's capabilities.
gomo1da4b5c2018-12-02 02:49:10 -080062 *
63 * @param capabilities Capability parameter is a bit field of the Capabilities enum.
64 */
65 gnssSetCapabilitiesCb_2_0(bitfield<Capabilities> capabilities);
66
Pierre Fite-Georgel12ac2b52019-01-17 16:56:17 -080067 /**
68 * Called when a GNSS location is available.
69 *
70 * @param location Location information from HAL.
71 */
72 gnssLocationCb_2_0(GnssLocation location);
73
Yu-Han Yang75b35de2019-02-13 12:04:52 -080074 /**
75 * Callback for requesting Location.
76 *
77 * HAL implementation must call this when it wants the framework to provide locations to assist
78 * with GNSS HAL operation, for example, to assist with time to first fix, error recovery, or to
79 * supplement GNSS location for other clients of the GNSS HAL.
80 *
81 * If a request is made with independentFromGnss set to true, the framework must avoid
82 * providing locations derived from GNSS locations (such as "fused" location), to help improve
83 * information independence for situations such as error recovery.
84 *
85 * In response to this method call, GNSS HAL can expect zero, one, or more calls to
86 * IGnss::injectLocation or IGnss::injectBestLocation, dependent on availability of location
87 * from other sources, which may happen at some arbitrary delay. Generally speaking, HAL
88 * implementations must be able to handle calls to IGnss::injectLocation or
89 * IGnss::injectBestLocation at any time.
90 *
91 * @param independentFromGnss True if requesting a location that is independent from GNSS.
92 * @param isUserEmergency True if the location request is for delivery of this location to an
93 * emergency services endpoint, during a user-initiated emergency session (e.g.
94 * during-call to E911, or up to 5 minutes after end-of-call or text to E911).
95 */
96 gnssRequestLocationCb_2_0(bool independentFromGnss, bool isUserEmergency);
Anil Admal86450fa2019-03-11 15:31:05 -070097};