GPS HAL Binderization

A Debug interface as well as a configuration interface will be added in
another CL.

Bug: 31974439
Test: mma

Change-Id: I977d95fc815172bd2aae7c78f81e1fc7c9bce72a
diff --git a/gnss/1.0/IAGnssRil.hal b/gnss/1.0/IAGnssRil.hal
new file mode 100644
index 0000000..fb73498
--- /dev/null
+++ b/gnss/1.0/IAGnssRil.hal
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.gnss@1.0;
+
+import IAGnssRilCallback;
+
+/*
+ * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface
+ * Layer interface allows the GNSS chipset to request radio interface layer
+ * information from Android platform. Examples of such information are reference
+ * location, unique subscriber ID, phone number string and network availability changes.
+ */
+interface IAGnssRil {
+    enum SetIDType : uint16_t {
+        NONE    = 0,
+        IMSI    = 1,
+        MSISDM  = 2
+    };
+
+    enum NetworkType : int32_t {
+        MOBILE  = 0,
+        WIFI    = 1,
+        MMS     = 2,
+        SUPL    = 3,
+        DUN     = 4,
+        HIPRI   = 5,
+        WIMAX   = 6,
+    };
+
+    enum AGnssRefLocationType {
+        GSM_CELLID   = 1,
+        UMTS_CELLID  = 2,
+        MAC          = 3,
+        LTE_CELLID   = 4,
+    };
+
+    /* CellID for 2G, 3G and LTE, used in AGNSS. */
+    struct AGnssRefLocationCellID {
+        AGnssRefLocationType type;
+
+        /* Mobile Country Code. */
+        uint16_t mcc;
+
+        /* Mobile Network Code .*/
+        uint16_t mnc;
+
+        /*
+         * Location Area Code in 2G, 3G and LTE. In 3G lac is discarded. In LTE,
+         * lac is populated with tac, to ensure that we don't break old clients that
+         * might rely in the old (wrong) behavior.
+         */
+        uint16_t lac;
+
+        /* Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. */
+        uint32_t cid;
+
+        /* Tracking Area Code in LTE. */
+        uint16_t tac;
+
+        /* Physical Cell id in LTE (not used in 2G and 3G) */
+        uint16_t pcid;
+    };
+
+    struct AGnssRefLocationMac {
+        uint8_t[6] mac;
+    };
+
+    /* Represents ref locations */
+    struct AGnssRefLocation {
+        AGnssRefLocationType type;
+
+        union RefLoc {
+            AGnssRefLocationCellID cellID;
+            AGnssRefLocationMac mac;
+        };
+
+        RefLoc refLocVal;
+    };
+
+    /*
+     * Opens the AGNSS interface and provides the callback routines
+     * to the implementation of this interface.
+     *
+     * @param callback Interface for AGnssRil callbacks.
+     */
+    setCallback(IAGnssRilCallback callback);
+
+    /*
+     * Sets the reference location.
+     *
+     * @param agnssReflocation AGNSS reference location CellID/MAC.
+     */
+    setRefLocation(AGnssRefLocation agnssReflocation);
+
+    /*
+     * Sets the SET ID.
+     *
+     * @param type Must be populated with either IMSI or MSISDN or NONE.
+     * @param setid If type is IMSI then setid is populated with
+     * a string representing the unique Subscriber ID, for example, the IMSI for
+     * a GMS phone. If type is MSISDN, then setid must contain
+     * the phone number string for line 1. For example, the MSISDN for a GSM phone.
+     * If the type is NONE, then the string must be empty.
+     *
+     * @return success True if all parameters were valid and operation was
+     * successful.
+     */
+    setSetId(SetIDType type, string setid) generates (bool success);
+
+    /*
+     * Notify GNSS of network status changes.
+     *
+     * @param connected Indicates whether network connectivity exists and
+     * it is possible to establish connections and pass data.
+     * @param type Indicates the kind of network, for eg. mobile, wifi etc.
+     * @param roaming Indicates whether the device is currently roaming on
+     * this network.
+     *
+     * @return success True is all parameters were valid and operation was
+     * successful.
+     */
+    updateNetworkState(bool connected, NetworkType type, bool roaming)
+        generates (bool success);
+
+    /*
+     * Notify GNSS of network status changes.
+     *
+     * @param available Indicates whether network connectivity is available.
+     * @param apn String containing the Access Point Name.
+     *
+     * @return success True if all parameters were valid and the operation was
+     * successful.
+     * TODO(b/32022567): Add VTS test to validate the format of APN.
+     */
+    updateNetworkAvailability(bool available, string apn) generates (bool success);
+
+};