1 /* 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 #include <android/hardware/gnss/2.0/IGnss.h> 19 #include <mutex> 20 21 namespace goldfish { 22 namespace ahg = ::android::hardware::gnss; 23 namespace ahg20 = ahg::V2_0; 24 namespace ahg10 = ahg::V1_0; 25 26 using ::android::sp; 27 using ::android::hardware::hidl_string; 28 using ::android::hardware::hidl_vec; 29 30 class DataSink { 31 public: 32 void gnssLocation(const ahg20::GnssLocation&) const; 33 void gnssSvStatus(const hidl_vec<ahg20::IGnssCallback::GnssSvInfo>&) const; 34 void gnssStatus(const ahg10::IGnssCallback::GnssStatusValue) const; 35 void gnssNmea(const ahg10::GnssUtcTime, const hidl_string&) const; 36 37 void setCallback20(sp<ahg20::IGnssCallback>); 38 void cleanup(); 39 40 private: 41 sp<ahg20::IGnssCallback> cb20; 42 mutable std::mutex mtx; 43 }; 44 45 } // namespace goldfish 46