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

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

Merge "GnssStatus for GnssMeasurement-only VTS test" into udc-dev

parents ac28d064 d32f3784
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -214,9 +214,12 @@ interface IGnssCallback {
    /**
     * Callback for the HAL to pass a vector of GnssSvInfo back to the client.
     *
     * If GnssMeasurement is registered, the SvStatus report interval is the same as the measurement
     * interval, i.e., the interval the measurement engine runs at. If GnssMeasurement is not
     * registered, the SvStatus interval is the same as the location interval.
     * If only GnssMeasurement is registered, the SvStatus reporting interval must be
     * the same as the measurement interval, i.e., the interval the measurement
     * engine runs at. If only location is registered, the SvStatus interval must
     * be the same as the location interval. If both GnssMeasurement and location
     * are registered, then the SvStatus interval is the same as the lesser interval
     * between the two.
     *
     * @param svInfo SV status information from HAL.
     */
+1 −0
Original line number Diff line number Diff line
@@ -325,6 +325,7 @@ ScopedAStatus Gnss::getExtensionGnssMeasurement(
    ALOGD("getExtensionGnssMeasurement");
    if (mGnssMeasurementInterface == nullptr) {
        mGnssMeasurementInterface = SharedRefBase::make<GnssMeasurementInterface>();
        mGnssMeasurementInterface->setGnssInterface(static_cast<std::shared_ptr<Gnss>>(this));
    }
    *iGnssMeasurement = mGnssMeasurementInterface;
    return ScopedAStatus::ok();
+1 −1
Original line number Diff line number Diff line
@@ -84,13 +84,13 @@ class Gnss : public BnGnss {
                                    IMeasurementCorrectionsInterface>* iMeasurementCorrections)
            override;

    void reportSvStatus() const;
    std::shared_ptr<GnssConfiguration> mGnssConfiguration;
    std::shared_ptr<GnssPowerIndication> mGnssPowerIndication;
    std::shared_ptr<GnssMeasurementInterface> mGnssMeasurementInterface;

  private:
    void reportLocation(const GnssLocation&) const;
    void reportSvStatus() const;
    void reportSvStatus(const std::vector<IGnssCallback::GnssSvInfo>& svInfoList) const;
    std::vector<IGnssCallback::GnssSvInfo> filterBlocklistedSatellites(
            std::vector<IGnssCallback::GnssSvInfo> gnssSvInfoList) const;
+8 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <aidl/android/hardware/gnss/BnGnss.h>
#include <log/log.h>
#include "DeviceFileReader.h"
#include "Gnss.h"
#include "GnssRawMeasurementParser.h"
#include "GnssReplayUtils.h"
#include "Utils.h"
@@ -126,6 +127,9 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs,
                auto measurement =
                        Utils::getMockMeasurement(enableCorrVecOutputs, enableFullTracking);
                this->reportMeasurement(measurement);
                if (!mLocationEnabled) {
                    mGnss->reportSvStatus();
                }
            }
            intervalMs =
                    (mLocationEnabled) ? std::min(mLocationIntervalMs, mIntervalMs) : mIntervalMs;
@@ -164,6 +168,10 @@ void GnssMeasurementInterface::setLocationEnabled(const bool enabled) {
    mLocationEnabled = enabled;
}

void GnssMeasurementInterface::setGnssInterface(const std::shared_ptr<Gnss>& gnss) {
    mGnss = gnss;
}

void GnssMeasurementInterface::waitForStoppingThreads() {
    for (auto& future : mFutures) {
        ALOGD("Stopping previous thread.");
+4 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include "Utils.h"

namespace aidl::android::hardware::gnss {
class Gnss;

struct GnssMeasurementInterface : public BnGnssMeasurementInterface {
  public:
@@ -39,6 +40,7 @@ struct GnssMeasurementInterface : public BnGnssMeasurementInterface {
            const Options& options) override;
    void setLocationInterval(const int intervalMs);
    void setLocationEnabled(const bool enabled);
    void setGnssInterface(const std::shared_ptr<Gnss>& gnss);

  private:
    void start(const bool enableCorrVecOutputs, const bool enableFullTracking);
@@ -59,6 +61,8 @@ struct GnssMeasurementInterface : public BnGnssMeasurementInterface {

    // Synchronization lock for sCallback
    mutable std::mutex mMutex;

    std::shared_ptr<Gnss> mGnss;
};

}  // namespace aidl::android::hardware::gnss
Loading