blob: 209728df7f1ee7ef2cceae78642fbfd3794fc0ff [file] [log] [blame]
Yu-Han Yang1e1a6762020-09-30 17:01:53 -07001/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <android/hardware/gnss/BnGnssCallback.h>
20#include "GnssCallbackEventQueue.h"
21
22/* Callback class for data & Event. */
23class GnssCallbackAidl : public android::hardware::gnss::BnGnssCallback {
24 public:
Yu-Han Yang1afbd5f2021-11-24 16:39:13 -080025 GnssCallbackAidl()
26 : capabilities_cbq_("capabilities"),
27 info_cbq_("system_info"),
28 location_cbq_("location"),
29 sv_info_list_cbq_("sv_info"){};
Yu-Han Yang1e1a6762020-09-30 17:01:53 -070030 ~GnssCallbackAidl(){};
31
32 android::binder::Status gnssSetCapabilitiesCb(const int capabilities) override;
Yu-Han Yang1afbd5f2021-11-24 16:39:13 -080033 android::binder::Status gnssStatusCb(const GnssStatusValue status) override;
34 android::binder::Status gnssSvStatusCb(const std::vector<GnssSvInfo>& svInfoList) override;
35 android::binder::Status gnssLocationCb(
36 const android::hardware::gnss::GnssLocation& location) override;
37 android::binder::Status gnssNmeaCb(const int64_t timestamp, const std::string& nmea) override;
38 android::binder::Status gnssAcquireWakelockCb() override;
39 android::binder::Status gnssReleaseWakelockCb() override;
40 android::binder::Status gnssSetSystemInfoCb(const GnssSystemInfo& info) override;
41 android::binder::Status gnssRequestTimeCb() override;
42 android::binder::Status gnssRequestLocationCb(const bool independentFromGnss,
43 const bool isUserEmergency) override;
Yu-Han Yang1e1a6762020-09-30 17:01:53 -070044
45 int last_capabilities_;
Yu-Han Yang1afbd5f2021-11-24 16:39:13 -080046 android::hardware::gnss::IGnssCallback::GnssSystemInfo last_info_;
47 android::hardware::gnss::GnssLocation last_location_;
48
Yu-Han Yang1e1a6762020-09-30 17:01:53 -070049 android::hardware::gnss::common::GnssCallbackEventQueue<int> capabilities_cbq_;
Yu-Han Yang1afbd5f2021-11-24 16:39:13 -080050 android::hardware::gnss::common::GnssCallbackEventQueue<
51 android::hardware::gnss::IGnssCallback::GnssSystemInfo>
52 info_cbq_;
53 android::hardware::gnss::common::GnssCallbackEventQueue<android::hardware::gnss::GnssLocation>
54 location_cbq_;
55 android::hardware::gnss::common::GnssCallbackEventQueue<
56 std::vector<android::hardware::gnss::IGnssCallback::GnssSvInfo>>
57 sv_info_list_cbq_;
Yu-Han Yang1e1a6762020-09-30 17:01:53 -070058};