Loading gnss/aidl/android/hardware/gnss/IGnssCallback.aidl +6 −3 Original line number Diff line number Diff line Loading @@ -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. */ Loading gnss/aidl/default/Gnss.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading gnss/aidl/default/Gnss.h +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading gnss/aidl/default/GnssMeasurementInterface.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -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; Loading Loading @@ -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."); Loading gnss/aidl/default/GnssMeasurementInterface.h +4 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include "Utils.h" namespace aidl::android::hardware::gnss { class Gnss; struct GnssMeasurementInterface : public BnGnssMeasurementInterface { public: Loading @@ -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); Loading @@ -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
gnss/aidl/android/hardware/gnss/IGnssCallback.aidl +6 −3 Original line number Diff line number Diff line Loading @@ -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. */ Loading
gnss/aidl/default/Gnss.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading
gnss/aidl/default/Gnss.h +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
gnss/aidl/default/GnssMeasurementInterface.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -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; Loading Loading @@ -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."); Loading
gnss/aidl/default/GnssMeasurementInterface.h +4 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include "Utils.h" namespace aidl::android::hardware::gnss { class Gnss; struct GnssMeasurementInterface : public BnGnssMeasurementInterface { public: Loading @@ -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); Loading @@ -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