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
17package [email protected];
18
19import @1.0::IAGnssRil;
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 */
27interface IAGnssRil extends @1.0::IAGnssRil {
28    /** Flags to indicate capabilities of the network */
29    enum NetworkCapability : uint16_t {
30        /** Network is not metered. */
31        NOT_METERED       = 1 << 0,
32        /** Network is not roaming. */
33        NOT_ROAMING       = 1 << 1
34    };
35
36    /** Represents network connection status and capabilities. */
37    struct NetworkAttributes {
38        /** Network handle of the network for use with the NDK API. */
39        net_handle_t networkHandle;
40
41        /**
42         * True indicates that network connectivity exists and it is possible to
43         * establish connections and pass data. If false, only the networkHandle field
44         * is populated to indicate that this network has just disconnected.
45         */
46        bool isConnected;
47
48        /** A set of flags indicating the capabilities of this network. */
49        bitfield<NetworkCapability> capabilities;
50
51        /**
52         * Telephony preferred Access Point Name to use for carrier data connection when
53         * connected to a cellular network. Empty string, otherwise.
54         */
55        string apn;
56    };
57
58    /**
59     * Notifies GNSS of network status changes.
60     *
61     * The framework calls this method to update the GNSS HAL implementation of network
62     * state changes. The methods updateNetworkState() and updateNetworkAvailability
63     * in @1.0::IAGnssRil are deprecated and are not called by the framework.
64     *
65     * @param attributes Updated network attributes.
66     *
67     * @return success True if all parameters were valid and the operation was
68     * successful.
69     */
70    updateNetworkState_2_0(NetworkAttributes attributes) generates (bool success);
71};
72