1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
- #define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
- #include <android/hardware/gnss/1.1/IGnssCallback.h>
- #include <android/hardware/gnss/1.1/IGnssConfiguration.h>
- #include <hidl/MQDescriptor.h>
- #include <hidl/Status.h>
- #include <mutex>
- #include <unordered_set>
- namespace android {
- namespace hardware {
- namespace gnss {
- namespace V1_1 {
- namespace implementation {
- using ::android::hardware::hidl_array;
- using ::android::hardware::hidl_memory;
- using ::android::hardware::hidl_string;
- using ::android::hardware::hidl_vec;
- using ::android::hardware::Return;
- using ::android::hardware::Void;
- using ::android::sp;
- using BlacklistedSource = ::android::hardware::gnss::V1_1::IGnssConfiguration::BlacklistedSource;
- using GnssConstellationType = V1_0::GnssConstellationType;
- using GnssSvInfo = V1_0::IGnssCallback::GnssSvInfo;
- struct BlacklistedSourceHash {
- inline int operator()(const BlacklistedSource& source) const {
- return int(source.constellation) * 1000 + int(source.svid);
- }
- };
- struct BlacklistedSourceEqual {
- inline bool operator()(const BlacklistedSource& s1, const BlacklistedSource& s2) const {
- return (s1.constellation == s2.constellation) && (s1.svid == s2.svid);
- }
- };
- using BlacklistedSourceSet =
- std::unordered_set<BlacklistedSource, BlacklistedSourceHash, BlacklistedSourceEqual>;
- using BlacklistedConstellationSet = std::unordered_set<GnssConstellationType>;
- struct GnssConfiguration : public IGnssConfiguration {
-
- Return<bool> setSuplEs(bool enabled) override;
- Return<bool> setSuplVersion(uint32_t version) override;
- Return<bool> setSuplMode(hidl_bitfield<SuplMode> mode) override;
- Return<bool> setGpsLock(hidl_bitfield<GpsLock> lock) override;
- Return<bool> setLppProfile(hidl_bitfield<LppProfile> lppProfile) override;
- Return<bool> setGlonassPositioningProtocol(hidl_bitfield<GlonassPosProtocol> protocol) override;
- Return<bool> setEmergencySuplPdn(bool enable) override;
-
- Return<bool> setBlacklist(const hidl_vec<BlacklistedSource>& blacklist) override;
- Return<bool> isBlacklisted(const GnssSvInfo& gnssSvInfo) const;
- std::recursive_mutex& getMutex() const;
- private:
- BlacklistedSourceSet mBlacklistedSourceSet;
- BlacklistedConstellationSet mBlacklistedConstellationSet;
- mutable std::recursive_mutex mMutex;
- };
- }
- }
- }
- }
- }
- #endif
|