Supported synchronized fixed location and measurement from device files
Replace NMEA by one row fixed location data
Test: atest VtsHalGnssTargetTest
Test: launch_cvd -cpus 16 -memory_mb 16192 --start_gnss_proxy --gnss_file_path=/usr/local/google/home/yuchenhe/Downloads/raw.txt --fixed_location_file_path=/google/data/rw/users/yu/yuchenhe/input.txt
Bug: 213225295
Change-Id: Ide7bbb3e81a90414496084691227bd95a2e7af18
diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp
index 6331dfd..73f4085 100644
--- a/gnss/aidl/default/Gnss.cpp
+++ b/gnss/aidl/default/Gnss.cpp
@@ -22,6 +22,7 @@
#include "AGnss.h"
#include "AGnssRil.h"
#include "DeviceFileReader.h"
+#include "FixLocationParser.h"
#include "GnssAntennaInfo.h"
#include "GnssBatching.h"
#include "GnssConfiguration.h"
@@ -32,11 +33,9 @@
#include "GnssPsds.h"
#include "GnssVisibilityControl.h"
#include "MeasurementCorrectionsInterface.h"
-#include "NmeaFixInfo.h"
#include "Utils.h"
namespace aidl::android::hardware::gnss {
-using ::android::hardware::gnss::common::NmeaFixInfo;
using ::android::hardware::gnss::common::Utils;
using ndk::ScopedAStatus;
@@ -70,9 +69,12 @@
}
std::unique_ptr<GnssLocation> Gnss::getLocationFromHW() {
+ if (!::android::hardware::gnss::common::ReplayUtils::hasFixedLocationDeviceFile()) {
+ return nullptr;
+ }
std::string inputStr =
::android::hardware::gnss::common::DeviceFileReader::Instance().getLocationData();
- return ::android::hardware::gnss::common::NmeaFixInfo::getAidlLocationFromInputStr(inputStr);
+ return ::android::hardware::gnss::common::FixLocationParser::getLocationFromInputStr(inputStr);
}
ScopedAStatus Gnss::start() {