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

Commit 94f3272a authored by Anil Admal's avatar Anil Admal Committed by Android (Google) Code Review
Browse files

Merge "Replace network type with network capabilities in IAgnssRil.hal"

parents bafa670a b02bcc13
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -7,6 +7,8 @@ hidl_interface {
        enabled: true,
        enabled: true,
    },
    },
    srcs: [
    srcs: [
        "types.hal",
        "IAGnssRil.hal",
        "IGnss.hal",
        "IGnss.hal",
        "IGnssCallback.hal",
        "IGnssCallback.hal",
        "IGnssMeasurement.hal",
        "IGnssMeasurement.hal",
@@ -18,6 +20,8 @@ hidl_interface {
        "android.hardware.gnss@1.1",
        "android.hardware.gnss@1.1",
        "android.hidl.base@1.0",
        "android.hidl.base@1.0",
    ],
    ],
    types: [
    ],
    gen_java: true,
    gen_java: true,
    gen_java_constants: true,
    gen_java_constants: true,
}
}

gnss/2.0/IAGnssRil.hal

0 → 100644
+71 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2018 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@2.0;

import @1.0::IAGnssRil;

/**
 * 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 extends @1.0::IAGnssRil {
    /** Flags to indicate capabilities of the network */
    enum NetworkCapability : uint16_t {
        /** Network is not metered. */
        NOT_METERED       = 1 << 0,
        /** Network is not roaming. */
        NOT_ROAMING       = 1 << 1
    };

    /** Represents network connection status and capabilities. */
    struct NetworkAttributes {
        /** Network handle of the network for use with the NDK API. */
        net_handle_t networkHandle;

        /**
         * True indicates that network connectivity exists and it is possible to
         * establish connections and pass data. If false, only the networkHandle field
         * is populated to indicate that this network has just disconnected.
         */
        bool isConnected;

        /** A set of flags indicating the capabilities of this network. */
        bitfield<NetworkCapability> capabilities;

        /**
         * Telephony preferred Access Point Name to use for carrier data connection when
         * connected to a cellular network. Empty string, otherwise.
         */
        string apn;
    };

    /**
     * Notifies GNSS of network status changes.
     *
     * The framework calls this method to update the GNSS HAL implementation of network
     * state changes. The methods updateNetworkState() and updateNetworkAvailability
     * in @1.0::IAGnssRil are deprecated and are not called by the framework.
     *
     * @param attributes Updated network attributes.
     *
     * @return success True if all parameters were valid and the operation was
     * successful.
     */
    updateNetworkState_2_0(NetworkAttributes attributes) generates (bool success);
};
+8 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ import @1.1::IGnss;


import IGnssCallback;
import IGnssCallback;
import IGnssMeasurement;
import IGnssMeasurement;
import IAGnssRil;


/** Represents the standard GNSS (Global Navigation Satellite System) interface. */
/** Represents the standard GNSS (Global Navigation Satellite System) interface. */
interface IGnss extends @1.1::IGnss {
interface IGnss extends @1.1::IGnss {
@@ -34,6 +35,13 @@ interface IGnss extends @1.1::IGnss {
     */
     */
    setCallback_2_0(IGnssCallback callback) generates (bool success);
    setCallback_2_0(IGnssCallback callback) generates (bool success);


    /**
     * This method returns the IAGnssRil Interface.
     *
     * @return aGnssRilIface Handle to the IAGnssRil interface.
     */
    getExtensionAGnssRil_2_0() generates (IAGnssRil aGnssRilIface);

    /**
    /**
     * This method returns the IGnssMeasurement interface.
     * This method returns the IGnssMeasurement interface.
     *
     *
+65 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2018 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.
 */

#define LOG_TAG "AGnssRil"

#include "AGnssRil.h"
#include <log/log.h>

namespace android {
namespace hardware {
namespace gnss {
namespace V2_0 {
namespace implementation {

// Methods from V1_0::IAGnssRil follow.
Return<void> AGnssRil::setCallback(const sp<V1_0::IAGnssRilCallback>&) {
    // TODO implement
    return Void();
}

Return<void> AGnssRil::setRefLocation(const V1_0::IAGnssRil::AGnssRefLocation&) {
    // TODO implement
    return Void();
}

Return<bool> AGnssRil::setSetId(V1_0::IAGnssRil::SetIDType, const hidl_string&) {
    // TODO implement
    return bool{};
}

Return<bool> AGnssRil::updateNetworkState(bool, V1_0::IAGnssRil::NetworkType, bool) {
    // TODO implement
    return bool{};
}

Return<bool> AGnssRil::updateNetworkAvailability(bool, const hidl_string&) {
    // TODO implement
    return bool{};
}

// Methods from ::android::hardware::gnss::V2_0::IAGnssRil follow.
Return<bool> AGnssRil::updateNetworkState_2_0(
    const V2_0::IAGnssRil::NetworkAttributes& attributes) {
    ALOGD("updateNetworkState_2_0 networkAttributes: %s", toString(attributes).c_str());
    return true;
}

}  // namespace implementation
}  // namespace V2_0
}  // namespace gnss
}  // namespace hardware
}  // namespace android
+58 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2018 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.
 */

#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H
#define ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H

#include <android/hardware/gnss/2.0/IAGnssRil.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>

namespace android {
namespace hardware {
namespace gnss {
namespace V2_0 {
namespace implementation {

using ::android::sp;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;

struct AGnssRil : public IAGnssRil {
    // Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow.
    Return<void> setCallback(const sp<V1_0::IAGnssRilCallback>& callback) override;
    Return<void> setRefLocation(const V1_0::IAGnssRil::AGnssRefLocation& agnssReflocation) override;
    Return<bool> setSetId(V1_0::IAGnssRil::SetIDType type, const hidl_string& setid) override;
    Return<bool> updateNetworkState(bool connected, V1_0::IAGnssRil::NetworkType type,
                                    bool roaming) override;
    Return<bool> updateNetworkAvailability(bool available, const hidl_string& apn) override;

    // Methods from ::android::hardware::gnss::V2_0::IAGnssRil follow.
    Return<bool> updateNetworkState_2_0(
        const V2_0::IAGnssRil::NetworkAttributes& attributes) override;
};

}  // namespace implementation
}  // namespace V2_0
}  // namespace gnss
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H
 No newline at end of file
Loading