mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Unset Vertical Accuracy, Speed Accruacy and Bearing Accuracy fields as some chipsets
set them in pre-Android-O devices. Test: Existing unit tests still pass. Change-Id: I542a2d82d16c1017859ad08060f30a0187664ffd
This commit is contained in:
@@ -28,7 +28,10 @@ GnssLocation convertToGnssLocation(GpsLocation* location) {
|
||||
GnssLocation gnssLocation = {};
|
||||
if (location != nullptr) {
|
||||
gnssLocation = {
|
||||
.gnssLocationFlags = location->flags,
|
||||
// Bit operation AND with 1f below is needed to clear vertical accuracy,
|
||||
// speed accuracy and bearing accuracy flags as some vendors are found
|
||||
// to be setting these bits in pre-Android-O devices
|
||||
.gnssLocationFlags = static_cast<uint16_t>(location->flags & 0x1f),
|
||||
.latitudeDegrees = location->latitude,
|
||||
.longitudeDegrees = location->longitude,
|
||||
.altitudeMeters = location->altitude,
|
||||
|
||||
Reference in New Issue
Block a user