Report default location when location is not available in /dev/gnss0
Test: atest VtsHalGnssTargetTest
Bug: 197579774
Bug: 197825053
Change-Id: I08e761d6023df2954d8a265b4af3e5b5d0aec09c
(cherry picked from commit 1aac7fa45c69ef13f93f3f79f28c5c6424b22e99)
diff --git a/gnss/common/utils/default/include/v2_1/GnssTemplate.h b/gnss/common/utils/default/include/v2_1/GnssTemplate.h
index 131af24..48cab99 100644
--- a/gnss/common/utils/default/include/v2_1/GnssTemplate.h
+++ b/gnss/common/utils/default/include/v2_1/GnssTemplate.h
@@ -223,14 +223,8 @@
this->reportSvStatus(svStatus);
auto currentLocation = getLocationFromHW();
notePowerConsumption();
- if (mGnssFd != -1) {
- // Only report location if the return from hardware is valid
- // note that we can not merge these two "if" together, if didn't
- // get location from hardware, we shouldn't report location, not
- // report the "default" one.
- if (currentLocation != nullptr) {
- this->reportLocation(*currentLocation);
- }
+ if (currentLocation != nullptr) {
+ this->reportLocation(*currentLocation);
} else {
if (sGnssCallback_2_1 != nullptr || sGnssCallback_2_0 != nullptr) {
const auto location = Utils::getMockLocationV2_0();