12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #ifndef ANDROID_HARDWARE_GNSS_AIDL_GNSS_H
- #define ANDROID_HARDWARE_GNSS_AIDL_GNSS_H
- #include <aidl/android/hardware/gnss/BnGnss.h>
- #include <aidl/android/hardware/gnss/IGnssCallback.h>
- #include <aidl/android/hardware/gnss/BnGnssPowerIndication.h>
- #include <aidl/android/hardware/gnss/BnGnssMeasurementInterface.h>
- #include <aidl/android/hardware/gnss/BnGnssConfiguration.h>
- #include <aidl/android/hardware/gnss/BnGnssPsds.h>
- #include "location_api/GnssAPIClient.h"
- #include "GnssConfiguration.h"
- #include "GnssPowerIndication.h"
- #include "GnssMeasurementInterface.h"
- namespace android {
- namespace hardware {
- namespace gnss {
- namespace aidl {
- namespace implementation {
- using ::aidl::android::hardware::gnss::GnssConstellationType;
- using ::aidl::android::hardware::gnss::BnGnss;
- using ::aidl::android::hardware::gnss::IGnssCallback;
- using ::aidl::android::hardware::gnss::IGnssPowerIndication;
- using ::aidl::android::hardware::gnss::IGnssMeasurementInterface;
- using ::std::shared_ptr;
- struct Gnss : public BnGnss {
- Gnss();
- ~Gnss();
- ndk::ScopedAStatus setCallback(const shared_ptr<IGnssCallback>& callback) override;
- ndk::ScopedAStatus close() override;
- ::ndk::ScopedAStatus getExtensionPsds(
- shared_ptr<::aidl::android::hardware::gnss::IGnssPsds>* _aidl_return) override {
- return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
- }
- ::ndk::ScopedAStatus getExtensionGnssConfiguration(
- shared_ptr<::aidl::android::hardware::gnss::IGnssConfiguration>* _aidl_return) override;
- ::ndk::ScopedAStatus getExtensionGnssPowerIndication(
- shared_ptr<IGnssPowerIndication>* _aidl_return) override;
- ::ndk::ScopedAStatus getExtensionGnssMeasurement(
- shared_ptr<IGnssMeasurementInterface>* _aidl_return) override;
-
- GnssAPIClient* getApi();
- ndk::ScopedAStatus updateConfiguration(GnssConfig& gnssConfig);
- void handleClientDeath();
- private:
- GnssAPIClient* mApi;
- shared_ptr<GnssConfiguration> mGnssConfiguration = nullptr;
- shared_ptr<GnssPowerIndication> mGnssPowerIndication = nullptr;
- shared_ptr<GnssMeasurementInterface> mGnssMeasurementInterface = nullptr;
- GnssConfig mPendingConfig;
- shared_ptr<IGnssCallback> mGnssCallback = nullptr;
- };
- }
- }
- }
- }
- }
- #endif
|