summaryrefslogtreecommitdiff
path: root/gnss/aidl/default/GnssConfiguration.cpp
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2022-01-06 04:27:16 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-01-06 04:27:16 +0000
commit43d175037b63de6b55e58f8b94e8c77a767cdd3b (patch)
tree578741d7edc56277cf53c1053105b959db294e7d /gnss/aidl/default/GnssConfiguration.cpp
parentfb14bdb74f8d6ef3c5964a4f8a409c40a8ec27d1 (diff)
parent1afbd5f23e0f72b7f03ed15ce973371f18f9d2c3 (diff)
Merge "Add navigation methods to IGnss AIDL HAL (hardware/interfaces)"
Diffstat (limited to 'gnss/aidl/default/GnssConfiguration.cpp')
-rw-r--r--gnss/aidl/default/GnssConfiguration.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gnss/aidl/default/GnssConfiguration.cpp b/gnss/aidl/default/GnssConfiguration.cpp
index 30e0d8c8b9..96a1aa2a3f 100644
--- a/gnss/aidl/default/GnssConfiguration.cpp
+++ b/gnss/aidl/default/GnssConfiguration.cpp
@@ -49,4 +49,14 @@ bool GnssConfiguration::isBlocklistedV2_1(const GnssSvInfoV2_1& gnssSvInfo) cons
return (mBlocklistedSourceSet.find(source) != mBlocklistedSourceSet.end());
}
+bool GnssConfiguration::isBlocklisted(const IGnssCallback::GnssSvInfo& gnssSvInfo) const {
+ std::unique_lock<std::recursive_mutex> lock(mMutex);
+ if (mBlocklistedConstellationSet.find(gnssSvInfo.constellation) !=
+ mBlocklistedConstellationSet.end()) {
+ return true;
+ }
+ BlocklistedSource source = {.constellation = gnssSvInfo.constellation, .svid = gnssSvInfo.svid};
+ return (mBlocklistedSourceSet.find(source) != mBlocklistedSourceSet.end());
+}
+
} // namespace aidl::android::hardware::gnss