blob: 77a25068202a3ec884ba85f7d25cfc5bac5a8d6b [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
Yu-Han Yang1afbd5f2021-11-24 16:39:13 -080017#define LOG_TAG "GnssCallbackAidl"
18
Yu-Han Yang1e1a6762020-09-30 17:01:53 -070019#include "GnssCallbackAidl.h"
20#include <log/log.h>
21
Yu-Han Yang1afbd5f2021-11-24 16:39:13 -080022using android::binder::Status;
23using android::hardware::gnss::GnssLocation;
24using GnssSvInfo = android::hardware::gnss::IGnssCallback::GnssSvInfo;
25using GnssSystemInfo = android::hardware::gnss::IGnssCallback::GnssSystemInfo;
26
27Status GnssCallbackAidl::gnssSetCapabilitiesCb(const int capabilities) {
28 ALOGI("Capabilities received %#08x", capabilities);
Yu-Han Yang1e1a6762020-09-30 17:01:53 -070029 capabilities_cbq_.store(capabilities);
Yu-Han Yang1afbd5f2021-11-24 16:39:13 -080030 return Status::ok();
31}
32
33Status GnssCallbackAidl::gnssStatusCb(const GnssStatusValue /* status */) {
34 ALOGI("gnssSvStatusCb");
35 return Status::ok();
36}
37
38Status 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
44Status GnssCallbackAidl::gnssLocationCb(const GnssLocation& location) {
45 ALOGI("Location received");
46 location_cbq_.store(location);
47 return Status::ok();
48}
49
50Status GnssCallbackAidl::gnssNmeaCb(const int64_t /* timestamp */, const std::string& /* nmea */) {
51 return Status::ok();
52}
53
54Status GnssCallbackAidl::gnssAcquireWakelockCb() {
55 return Status::ok();
56}
57
58Status GnssCallbackAidl::gnssReleaseWakelockCb() {
59 return Status::ok();
60}
61
62Status 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
68Status GnssCallbackAidl::gnssRequestTimeCb() {
69 return Status::ok();
70}
71
72Status GnssCallbackAidl::gnssRequestLocationCb(const bool /* independentFromGnss */,
73 const bool /* isUserEmergency */) {
74 return Status::ok();
Yu-Han Yang1e1a6762020-09-30 17:01:53 -070075}