Yu-Han Yang | 1e1a676 | 2020-09-30 17:01:53 -0700 | [diff] [blame] | 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 | |
Yu-Han Yang | 1afbd5f | 2021-11-24 16:39:13 -0800 | [diff] [blame] | 17 | #define LOG_TAG "GnssCallbackAidl" |
| 18 | |
Yu-Han Yang | 1e1a676 | 2020-09-30 17:01:53 -0700 | [diff] [blame] | 19 | #include "GnssCallbackAidl.h" |
| 20 | #include <log/log.h> |
| 21 | |
Yu-Han Yang | 1afbd5f | 2021-11-24 16:39:13 -0800 | [diff] [blame] | 22 | using android::binder::Status; |
| 23 | using android::hardware::gnss::GnssLocation; |
| 24 | using GnssSvInfo = android::hardware::gnss::IGnssCallback::GnssSvInfo; |
| 25 | using GnssSystemInfo = android::hardware::gnss::IGnssCallback::GnssSystemInfo; |
| 26 | |
| 27 | Status GnssCallbackAidl::gnssSetCapabilitiesCb(const int capabilities) { |
| 28 | ALOGI("Capabilities received %#08x", capabilities); |
Yu-Han Yang | 1e1a676 | 2020-09-30 17:01:53 -0700 | [diff] [blame] | 29 | capabilities_cbq_.store(capabilities); |
Yu-Han Yang | 1afbd5f | 2021-11-24 16:39:13 -0800 | [diff] [blame] | 30 | return Status::ok(); |
| 31 | } |
| 32 | |
| 33 | Status GnssCallbackAidl::gnssStatusCb(const GnssStatusValue /* status */) { |
| 34 | ALOGI("gnssSvStatusCb"); |
| 35 | return Status::ok(); |
| 36 | } |
| 37 | |
| 38 | Status GnssCallbackAidl::gnssSvStatusCb(const std::vector<GnssSvInfo>& svInfoList) { |
| 39 | ALOGI("gnssSvStatusCb. Size = %d", (int)svInfoList.size()); |
| 40 | sv_info_list_cbq_.store(svInfoList); |
| 41 | return Status::ok(); |
| 42 | } |
| 43 | |
| 44 | Status GnssCallbackAidl::gnssLocationCb(const GnssLocation& location) { |
| 45 | ALOGI("Location received"); |
| 46 | location_cbq_.store(location); |
| 47 | return Status::ok(); |
| 48 | } |
| 49 | |
| 50 | Status GnssCallbackAidl::gnssNmeaCb(const int64_t /* timestamp */, const std::string& /* nmea */) { |
| 51 | return Status::ok(); |
| 52 | } |
| 53 | |
| 54 | Status GnssCallbackAidl::gnssAcquireWakelockCb() { |
| 55 | return Status::ok(); |
| 56 | } |
| 57 | |
| 58 | Status GnssCallbackAidl::gnssReleaseWakelockCb() { |
| 59 | return Status::ok(); |
| 60 | } |
| 61 | |
| 62 | Status GnssCallbackAidl::gnssSetSystemInfoCb(const GnssSystemInfo& info) { |
| 63 | ALOGI("gnssSetSystemInfoCb, year=%d, name=%s", info.yearOfHw, info.name.c_str()); |
| 64 | info_cbq_.store(info); |
| 65 | return Status::ok(); |
| 66 | } |
| 67 | |
| 68 | Status GnssCallbackAidl::gnssRequestTimeCb() { |
| 69 | return Status::ok(); |
| 70 | } |
| 71 | |
| 72 | Status GnssCallbackAidl::gnssRequestLocationCb(const bool /* independentFromGnss */, |
| 73 | const bool /* isUserEmergency */) { |
| 74 | return Status::ok(); |
Yu-Han Yang | 1e1a676 | 2020-09-30 17:01:53 -0700 | [diff] [blame] | 75 | } |