1/*
2 * Copyright (C) 2017 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@1.1;
18
19import @1.0::IGnssCallback;
20
21/**
22 * The interface is required for the HAL to communicate certain information
23 * like status and location info back to the platform, the platform implements
24 * the interfaces and passes a handle to the HAL.
25 */
26interface IGnssCallback extends @1.0::IGnssCallback {
27    /**
28     * Callback to inform framework of the GNSS HAL implementation model & version name.
29     *
30     * This is a user-visible string that identifies the model and version of the GNSS HAL.
31     * For example "ABC Co., Baseband Part 1234, RF Part 567, Software version 3.14.159"
32     *
33     * For privacy reasons, this string must not contain any device-specific serial number or other
34     * identifier that uniquely identifies an individual device.
35     *
36     * This must be called in response to IGnss::setCallback
37     *
38     * @param name String providing the name of the GNSS HAL implementation
39     */
40    gnssNameCb(string name);
41
42    /**
43     * Callback for requesting Location.
44     *
45     * HAL implementation must call this when it wants the framework to provide locations to assist
46     * with GNSS HAL operation, for example, to assist with time to first fix, error recovery, or to
47     * supplement GNSS location for other clients of the GNSS HAL.
48     *
49     * If a request is made with independentFromGnss set to true, the framework must avoid
50     * providing locations derived from GNSS locations (such as "fused" location), to help improve
51     * information independence for situations such as error recovery.
52     *
53     * In response to this method call, GNSS HAL can expect zero, one, or more calls to
54     * IGnss::injectLocation or IGnss::injectBestLocation, dependent on availability of location
55     * from other sources, which may happen at some arbitrary delay. Generally speaking, HAL
56     * implementations must be able to handle calls to IGnss::injectLocation or
57     * IGnss::injectBestLocation at any time.
58     *
59     * @param independentFromGnss True if requesting a location that is independent from GNSS.
60     */
61    gnssRequestLocationCb(bool independentFromGnss);
62};