Shinru Han | 5f33dbe | 2021-12-14 12:06:02 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2021 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 | #define LOG_TAG "AGnssRilAidl" |
| 18 | |
| 19 | #include "AGnssRil.h" |
| 20 | #include <log/log.h> |
| 21 | |
| 22 | namespace aidl::android::hardware::gnss { |
| 23 | |
| 24 | std::shared_ptr<IAGnssRilCallback> AGnssRil::sCallback = nullptr; |
| 25 | |
| 26 | ndk::ScopedAStatus AGnssRil::setCallback(const std::shared_ptr<IAGnssRilCallback>& callback) { |
| 27 | ALOGD("AGnssRil::setCallback"); |
| 28 | std::unique_lock<std::mutex> lock(mMutex); |
| 29 | sCallback = callback; |
| 30 | return ndk::ScopedAStatus::ok(); |
| 31 | } |
| 32 | |
| 33 | ndk::ScopedAStatus AGnssRil::setRefLocation(const AGnssRefLocation& agnssReflocation) { |
| 34 | const AGnssRefLocationCellID& cellInfo = agnssReflocation.cellID; |
| 35 | ALOGD("AGnssRil::setRefLocation: type: %s, mcc: %d, mnc: %d, lac: %d, cid: %ld, tac: %d, pcid: " |
| 36 | "%d, arfcn: %d", |
| 37 | toString(agnssReflocation.type).c_str(), cellInfo.mcc, cellInfo.mnc, cellInfo.lac, |
| 38 | cellInfo.cid, cellInfo.tac, cellInfo.pcid, cellInfo.arfcn); |
| 39 | return ndk::ScopedAStatus::ok(); |
| 40 | } |
| 41 | |
| 42 | ndk::ScopedAStatus AGnssRil::setSetId(SetIDType type, const std::string& setid) { |
| 43 | ALOGD("AGnssRil::setSetId: type:%s, setid: %s", toString(type).c_str(), setid.c_str()); |
| 44 | return ndk::ScopedAStatus::ok(); |
| 45 | } |
| 46 | |
| 47 | ndk::ScopedAStatus AGnssRil::updateNetworkState(const NetworkAttributes& attributes) { |
| 48 | ALOGD("AGnssRil::updateNetworkState: networkHandle: %ld, isConnected: %d, capabilities: %d, " |
| 49 | "apn: %s", |
| 50 | attributes.networkHandle, attributes.isConnected, attributes.capabilities, |
| 51 | attributes.apn.c_str()); |
| 52 | return ndk::ScopedAStatus::ok(); |
| 53 | } |
| 54 | |
| 55 | } // namespace aidl::android::hardware::gnss |