Support vendor GNSS file properties for AAOS virtualization

The Android Automotive trout device uses GNSS HAL for fetching
location data from a live GNSS adapter, not a mock file. We also have
an established naming convention for console port names that is carried
over from the Bluetooth use case.

Add support for a vendor uart port for GNSS in addition to the existing
Cuttlefish debug property, in order to enable trout to establish a
connection to the host GNSS agent

Bug: 213489959
Test: build flash and boot
Change-Id: Id2d2134bb6ea60adef1072295c4f623463bfb010
This commit is contained in:
Enrico Granata
2022-02-23 10:50:35 -07:00
parent 3870153fac
commit 9447139c92

View File

@@ -16,24 +16,42 @@
#include "GnssReplayUtils.h"
#include <array>
namespace android {
namespace hardware {
namespace gnss {
namespace common {
std::string ReplayUtils::getGnssPath() {
char devname_value[PROPERTY_VALUE_MAX] = "";
if (property_get("debug.location.gnss.devname", devname_value, NULL) > 0) {
return devname_value;
std::array<char, PROPERTY_VALUE_MAX> devname_value;
devname_value.fill(0);
if (property_get("debug.location.gnss.devname", devname_value.begin(), NULL) > 0) {
return devname_value.begin();
}
devname_value.fill(0);
if (property_get("vendor.ser.gnss-uart", devname_value.begin(), NULL) > 0) {
return devname_value.begin();
}
return GNSS_PATH;
}
std::string ReplayUtils::getFixedLocationPath() {
char devname_value[PROPERTY_VALUE_MAX] = "";
if (property_get("debug.location.fixedlocation.devname", devname_value, NULL) > 0) {
return devname_value;
std::array<char, PROPERTY_VALUE_MAX> devname_value;
devname_value.fill(0);
if (property_get("debug.location.fixedlocation.devname", devname_value.begin(), NULL) > 0) {
return devname_value.begin();
}
devname_value.fill(0);
if (property_get("vendor.ser.gnss-uart", devname_value.begin(), NULL) > 0) {
return devname_value.begin();
}
return FIXED_LOCATION_PATH;
}