Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0560c4f7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'binderized_gps_hal'

* changes:
  IGpsDebug Interface for GPS Hal
  GPS HAL Binderization
parents 5a444a7b 49526a75
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ subdirs = [
    "benchmarks/msgq/1.0",
    "bluetooth/1.0",
    "biometrics/fingerprint/2.1",
    "gnss/1.0",
    "graphics/allocator/2.0",
    "graphics/allocator/2.0/default",
    "graphics/composer/2.1",

gnss/1.0/Android.bp

0 → 100644
+174 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen. Do not edit manually.

genrule {
    name: "android.hardware.gnss@1.0_genc++",
    tool: "hidl-gen",
    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.gnss@1.0",
    srcs: [
        "types.hal",
        "IAGnss.hal",
        "IAGnssCallback.hal",
        "IAGnssRil.hal",
        "IAGnssRilCallback.hal",
        "IGnss.hal",
        "IGnssCallback.hal",
        "IGnssDebug.hal",
        "IGnssGeofenceCallback.hal",
        "IGnssGeofencing.hal",
        "IGnssMeasurement.hal",
        "IGnssMeasurementCallback.hal",
        "IGnssNavigationMessage.hal",
        "IGnssNavigationMessageCallback.hal",
        "IGnssNi.hal",
        "IGnssNiCallback.hal",
        "IGnssXtra.hal",
        "IGnssXtraCallback.hal",
    ],
    out: [
        "android/hardware/gnss/1.0/types.cpp",
        "android/hardware/gnss/1.0/AGnssAll.cpp",
        "android/hardware/gnss/1.0/AGnssCallbackAll.cpp",
        "android/hardware/gnss/1.0/AGnssRilAll.cpp",
        "android/hardware/gnss/1.0/AGnssRilCallbackAll.cpp",
        "android/hardware/gnss/1.0/GnssAll.cpp",
        "android/hardware/gnss/1.0/GnssCallbackAll.cpp",
        "android/hardware/gnss/1.0/GnssDebugAll.cpp",
        "android/hardware/gnss/1.0/GnssGeofenceCallbackAll.cpp",
        "android/hardware/gnss/1.0/GnssGeofencingAll.cpp",
        "android/hardware/gnss/1.0/GnssMeasurementAll.cpp",
        "android/hardware/gnss/1.0/GnssMeasurementCallbackAll.cpp",
        "android/hardware/gnss/1.0/GnssNavigationMessageAll.cpp",
        "android/hardware/gnss/1.0/GnssNavigationMessageCallbackAll.cpp",
        "android/hardware/gnss/1.0/GnssNiAll.cpp",
        "android/hardware/gnss/1.0/GnssNiCallbackAll.cpp",
        "android/hardware/gnss/1.0/GnssXtraAll.cpp",
        "android/hardware/gnss/1.0/GnssXtraCallbackAll.cpp",
    ],
}

genrule {
    name: "android.hardware.gnss@1.0_genc++_headers",
    tool: "hidl-gen",
    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.gnss@1.0",
    srcs: [
        "types.hal",
        "IAGnss.hal",
        "IAGnssCallback.hal",
        "IAGnssRil.hal",
        "IAGnssRilCallback.hal",
        "IGnss.hal",
        "IGnssCallback.hal",
        "IGnssDebug.hal",
        "IGnssGeofenceCallback.hal",
        "IGnssGeofencing.hal",
        "IGnssMeasurement.hal",
        "IGnssMeasurementCallback.hal",
        "IGnssNavigationMessage.hal",
        "IGnssNavigationMessageCallback.hal",
        "IGnssNi.hal",
        "IGnssNiCallback.hal",
        "IGnssXtra.hal",
        "IGnssXtraCallback.hal",
    ],
    out: [
        "android/hardware/gnss/1.0/types.h",
        "android/hardware/gnss/1.0/IAGnss.h",
        "android/hardware/gnss/1.0/IHwAGnss.h",
        "android/hardware/gnss/1.0/BnAGnss.h",
        "android/hardware/gnss/1.0/BpAGnss.h",
        "android/hardware/gnss/1.0/BsAGnss.h",
        "android/hardware/gnss/1.0/IAGnssCallback.h",
        "android/hardware/gnss/1.0/IHwAGnssCallback.h",
        "android/hardware/gnss/1.0/BnAGnssCallback.h",
        "android/hardware/gnss/1.0/BpAGnssCallback.h",
        "android/hardware/gnss/1.0/BsAGnssCallback.h",
        "android/hardware/gnss/1.0/IAGnssRil.h",
        "android/hardware/gnss/1.0/IHwAGnssRil.h",
        "android/hardware/gnss/1.0/BnAGnssRil.h",
        "android/hardware/gnss/1.0/BpAGnssRil.h",
        "android/hardware/gnss/1.0/BsAGnssRil.h",
        "android/hardware/gnss/1.0/IAGnssRilCallback.h",
        "android/hardware/gnss/1.0/IHwAGnssRilCallback.h",
        "android/hardware/gnss/1.0/BnAGnssRilCallback.h",
        "android/hardware/gnss/1.0/BpAGnssRilCallback.h",
        "android/hardware/gnss/1.0/BsAGnssRilCallback.h",
        "android/hardware/gnss/1.0/IGnss.h",
        "android/hardware/gnss/1.0/IHwGnss.h",
        "android/hardware/gnss/1.0/BnGnss.h",
        "android/hardware/gnss/1.0/BpGnss.h",
        "android/hardware/gnss/1.0/BsGnss.h",
        "android/hardware/gnss/1.0/IGnssCallback.h",
        "android/hardware/gnss/1.0/IHwGnssCallback.h",
        "android/hardware/gnss/1.0/BnGnssCallback.h",
        "android/hardware/gnss/1.0/BpGnssCallback.h",
        "android/hardware/gnss/1.0/BsGnssCallback.h",
        "android/hardware/gnss/1.0/IGnssDebug.h",
        "android/hardware/gnss/1.0/IHwGnssDebug.h",
        "android/hardware/gnss/1.0/BnGnssDebug.h",
        "android/hardware/gnss/1.0/BpGnssDebug.h",
        "android/hardware/gnss/1.0/BsGnssDebug.h",
        "android/hardware/gnss/1.0/IGnssGeofenceCallback.h",
        "android/hardware/gnss/1.0/IHwGnssGeofenceCallback.h",
        "android/hardware/gnss/1.0/BnGnssGeofenceCallback.h",
        "android/hardware/gnss/1.0/BpGnssGeofenceCallback.h",
        "android/hardware/gnss/1.0/BsGnssGeofenceCallback.h",
        "android/hardware/gnss/1.0/IGnssGeofencing.h",
        "android/hardware/gnss/1.0/IHwGnssGeofencing.h",
        "android/hardware/gnss/1.0/BnGnssGeofencing.h",
        "android/hardware/gnss/1.0/BpGnssGeofencing.h",
        "android/hardware/gnss/1.0/BsGnssGeofencing.h",
        "android/hardware/gnss/1.0/IGnssMeasurement.h",
        "android/hardware/gnss/1.0/IHwGnssMeasurement.h",
        "android/hardware/gnss/1.0/BnGnssMeasurement.h",
        "android/hardware/gnss/1.0/BpGnssMeasurement.h",
        "android/hardware/gnss/1.0/BsGnssMeasurement.h",
        "android/hardware/gnss/1.0/IGnssMeasurementCallback.h",
        "android/hardware/gnss/1.0/IHwGnssMeasurementCallback.h",
        "android/hardware/gnss/1.0/BnGnssMeasurementCallback.h",
        "android/hardware/gnss/1.0/BpGnssMeasurementCallback.h",
        "android/hardware/gnss/1.0/BsGnssMeasurementCallback.h",
        "android/hardware/gnss/1.0/IGnssNavigationMessage.h",
        "android/hardware/gnss/1.0/IHwGnssNavigationMessage.h",
        "android/hardware/gnss/1.0/BnGnssNavigationMessage.h",
        "android/hardware/gnss/1.0/BpGnssNavigationMessage.h",
        "android/hardware/gnss/1.0/BsGnssNavigationMessage.h",
        "android/hardware/gnss/1.0/IGnssNavigationMessageCallback.h",
        "android/hardware/gnss/1.0/IHwGnssNavigationMessageCallback.h",
        "android/hardware/gnss/1.0/BnGnssNavigationMessageCallback.h",
        "android/hardware/gnss/1.0/BpGnssNavigationMessageCallback.h",
        "android/hardware/gnss/1.0/BsGnssNavigationMessageCallback.h",
        "android/hardware/gnss/1.0/IGnssNi.h",
        "android/hardware/gnss/1.0/IHwGnssNi.h",
        "android/hardware/gnss/1.0/BnGnssNi.h",
        "android/hardware/gnss/1.0/BpGnssNi.h",
        "android/hardware/gnss/1.0/BsGnssNi.h",
        "android/hardware/gnss/1.0/IGnssNiCallback.h",
        "android/hardware/gnss/1.0/IHwGnssNiCallback.h",
        "android/hardware/gnss/1.0/BnGnssNiCallback.h",
        "android/hardware/gnss/1.0/BpGnssNiCallback.h",
        "android/hardware/gnss/1.0/BsGnssNiCallback.h",
        "android/hardware/gnss/1.0/IGnssXtra.h",
        "android/hardware/gnss/1.0/IHwGnssXtra.h",
        "android/hardware/gnss/1.0/BnGnssXtra.h",
        "android/hardware/gnss/1.0/BpGnssXtra.h",
        "android/hardware/gnss/1.0/BsGnssXtra.h",
        "android/hardware/gnss/1.0/IGnssXtraCallback.h",
        "android/hardware/gnss/1.0/IHwGnssXtraCallback.h",
        "android/hardware/gnss/1.0/BnGnssXtraCallback.h",
        "android/hardware/gnss/1.0/BpGnssXtraCallback.h",
        "android/hardware/gnss/1.0/BsGnssXtraCallback.h",
    ],
}

cc_library_shared {
    name: "android.hardware.gnss@1.0",
    generated_sources: ["android.hardware.gnss@1.0_genc++"],
    generated_headers: ["android.hardware.gnss@1.0_genc++_headers"],
    export_generated_headers: ["android.hardware.gnss@1.0_genc++_headers"],
    shared_libs: [
        "libhidl",
        "libhwbinder",
        "libutils",
        "libcutils",
    ],
}

gnss/1.0/IAGnss.hal

0 → 100644
+77 −0
Original line number Diff line number Diff line
/*
 * 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 IAGnssCallback;

/*
 * Extended interface for AGNSS support.
 */
interface IAGnss {
    enum ApnIpType : uint16_t {
        INVALID  = 0,
        IPV4     = 1,
        IPV6     = 2,
        IPV4V6   = 3
    };

    /*
     * Opens the AGNSS interface and provides the callback routines to the
     * implementation of this interface.
     *
     * @param callback Handle to the AGNSS status callback interface.
     */
    setCallback(IAGnssCallback callback);

    /*
     * Notifies that the AGNSS data connection has been closed.
     *
     * @return success True if the operation is successful.
     */
    dataConnClosed() generates (bool success);

    /*
     * Notifies that a data connection is not available for AGNSS.
     *
     * @return success True if the operation is successful.
     */
    dataConnFailed() generates (bool success);

    /*
     * Sets the hostname and port for the AGNSS server.
     *
     * @param type Specifies if SUPL or C2K.
     * @param hostname Hostname of the AGNSS server.
     * @param port Port number associated with the server.
     *
     * @return success True if the operation is successful.
     */
    setServer(AGnssType type, string hostname, int32_t port)
        generates (bool success);

    /*
     * Notifies that a data connection is available and sets the name of the
     * APN, and its IP type, to be used for SUPL connections.
     *
     * @param apn Access Point Name(follows regular APN naming convention).
     * @param apnIpType Specifies if SUPL or C2K.
     *
     * @return success True if the operation is successful.
     */
    dataConnOpenWithApnIpType(string apn, ApnIpType apnIpType)
        generates (bool success);
};
+78 −0
Original line number Diff line number Diff line
/*
 * 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;

/** Callback structure for the AGNSS interface. */
interface IAGnssCallback {
    /** AGNSS type **/
    enum AGnssType : uint16_t {
        TYPE_SUPL         = 1,
        TYPE_C2K          = 2
    };

    enum AGnssStatusValue : uint16_t {
        /** GNSS requests data connection for AGNSS. */
        REQUEST_AGNSS_DATA_CONN  = 1,
        /** GNSS releases the AGNSS data connection. */
        RELEASE_AGNSS_DATA_CONN  = 2,
        /** AGNSS data connection initiated */
        AGNSS_DATA_CONNECTED     = 3,
        /** AGNSS data connection completed */
        AGNSS_DATA_CONN_DONE     = 4,
        /** AGNSS data connection failed */
        AGNSS_DATA_CONN_FAILED   = 5
    };

    /*
     * Represents the status of AGNSS augmented to support IPv4.
     */
    struct AGnssStatusIpV4 {
        AGnssType type;
        AGnssStatusValue status;
        /*
         * 32-bit IPv4 address.
         */
        uint32_t ipV4Addr;
    };

    /*
     * Represents the status of AGNSS augmented to support IPv6.
     */
    struct AGnssStatusIpV6 {
        AGnssType type;
        AGnssStatusValue status;
        /*
         * 128-bit IPv6 address.
         */
        uint8_t[16] ipV6Addr;
    };

    /*
     * Callback with AGNSS(IpV4) status information.
     *
     * @param status Will be of type AGnssStatusIpV4.
     */
    agnssStatusIpV4Cb(AGnssStatusIpV4 status);

    /*
     * Callback with AGNSS(IpV6) status information.
     *
     * @param status Will be of type AGnssStatusIpV6.
     */
    agnssStatusIpV6Cb(AGnssStatusIpV6 status);

};

gnss/1.0/IAGnssRil.hal

0 → 100644
+151 −0
Original line number Diff line number Diff line
/*
 * 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);

};
Loading