blob: 4053bf17c878e96e081d0600c21cfe632f650614 [file] [log] [blame]
Yu-Han Yang3fcb7bf2020-06-10 14:59:50 -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/3.0/IGnssPsds.h>
20#include <hidl/MQDescriptor.h>
21#include <hidl/Status.h>
22
23namespace android::hardware::gnss::V3_0::implementation {
24
25using ::android::sp;
26using ::android::hardware::hidl_array;
27using ::android::hardware::hidl_memory;
28using ::android::hardware::hidl_string;
29using ::android::hardware::hidl_vec;
30using ::android::hardware::Return;
31using ::android::hardware::Void;
32
33struct GnssPsds : public V3_0::IGnssPsds {
34 // Methods from V1_0::IGnssXtra follow.
35 Return<bool> setCallback(const sp<V1_0::IGnssXtraCallback>& callback) override;
36 Return<bool> injectXtraData(const hidl_string& xtraData) override;
37
38 // Methods from V3_0::IGnssPsds follow.
39 Return<bool> setCallback_3_0(const sp<V3_0::IGnssPsdsCallback>& callback) override;
40 Return<bool> injectPsdsData_3_0(int32_t psdsType, const hidl_string& psdsData) override;
41
42 private:
43 // Guarded by mMutex
44 static sp<V3_0::IGnssPsdsCallback> sCallback_3_0;
45
46 // Synchronization lock for sCallback_3_0
47 mutable std::mutex mMutex;
48};
49
50} // namespace android::hardware::gnss::V3_0::implementation