commit | 6ad408d962c40b2d4a57b9108e86e9a4010b448b | [log] [tgz] |
---|---|---|
author | Yuchen He <yuchenhe@google.com> | Thu Aug 26 18:16:27 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Aug 26 18:16:27 2021 +0000 |
tree | bd78db947ac92a1c31b7790f7083f02723b758b1 | |
parent | 53b6eaa3d930b60b30dd00f0115540b90500410b [diff] | |
parent | c9160995eccd4d9f3a018e14bd788ac2a3fce8a0 [diff] |
Report default location when location is not available in /dev/gnss0 am: c9160995ec Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15684790 Change-Id: I286580607e9a98286ac7d556ee6aaf8e4582023a
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();