Thomas Nguyen | 7ea5df6 | 2022-11-28 16:41:46 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2022 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 | #include <libradiocompat/RadioSatellite.h> |
| 18 | |
| 19 | #include "commonStructs.h" |
| 20 | #include "debug.h" |
| 21 | |
| 22 | #include "collections.h" |
| 23 | |
| 24 | #define RADIO_MODULE "RadioSatellite" |
| 25 | |
| 26 | namespace android::hardware::radio::compat { |
| 27 | |
| 28 | using ::ndk::ScopedAStatus; |
| 29 | namespace aidl = ::aidl::android::hardware::radio::satellite; |
| 30 | constexpr auto ok = &ScopedAStatus::ok; |
| 31 | |
| 32 | std::shared_ptr<aidl::IRadioSatelliteResponse> RadioSatellite::respond() { |
| 33 | return mCallbackManager->response().satelliteCb(); |
| 34 | } |
| 35 | |
| 36 | ScopedAStatus RadioSatellite::responseAcknowledgement() { |
| 37 | LOG(ERROR) << " responseAcknowledgement is unsupported by HIDL HALs"; |
| 38 | return ok(); |
| 39 | } |
| 40 | ScopedAStatus RadioSatellite::getCapabilities(int32_t serial) { |
| 41 | LOG_CALL << serial; |
| 42 | LOG(ERROR) << " getCapabilities is unsupported by HIDL HALs"; |
| 43 | return ok(); |
| 44 | } |
| 45 | ScopedAStatus RadioSatellite::setPower(int32_t serial, bool /*on*/) { |
| 46 | LOG_CALL << serial; |
| 47 | LOG(ERROR) << " setPower is unsupported by HIDL HALs"; |
| 48 | return ok(); |
| 49 | } |
| 50 | ScopedAStatus RadioSatellite::getPowerState(int32_t serial) { |
| 51 | LOG_CALL << serial; |
| 52 | LOG(ERROR) << " getPowerSate is unsupported by HIDL HALs"; |
| 53 | return ok(); |
| 54 | } |
| 55 | ScopedAStatus RadioSatellite::provisionService( |
| 56 | int32_t serial, const std::string& /*imei*/, const std::string& /*msisdn*/, |
| 57 | const std::string& /*imsi*/, |
| 58 | const std::vector< |
| 59 | ::aidl::android::hardware::radio::satellite::SatelliteFeature>& /*features*/) { |
| 60 | LOG_CALL << serial; |
| 61 | LOG(ERROR) << " provisionService is unsupported by HIDL HALs"; |
| 62 | return ok(); |
| 63 | } |
| 64 | ScopedAStatus RadioSatellite::addAllowedSatelliteContacts( |
| 65 | int32_t serial, const std::vector<std::string>& /*contacts*/) { |
| 66 | LOG_CALL << serial; |
| 67 | LOG(ERROR) << " addAllowedSatelliteContacts is unsupported by HIDL HALs"; |
| 68 | return ok(); |
| 69 | } |
| 70 | ScopedAStatus RadioSatellite::removeAllowedSatelliteContacts( |
| 71 | int32_t serial, const std::vector<std::string>& /*contacts*/) { |
| 72 | LOG_CALL << serial; |
| 73 | LOG(ERROR) << " removeAllowedSatelliteContacts is unsupported by HIDL HALs"; |
| 74 | return ok(); |
| 75 | } |
| 76 | ScopedAStatus RadioSatellite::sendMessages(int32_t serial, |
| 77 | const std::vector<std::string>& /*messages*/, |
| 78 | const std::string& /*destination*/, double /*latitude*/, |
| 79 | double /*longitude*/) { |
| 80 | LOG_CALL << serial; |
| 81 | LOG(ERROR) << " sendMessage is unsupported by HIDL HALs"; |
| 82 | return ok(); |
| 83 | } |
| 84 | ScopedAStatus RadioSatellite::getPendingMessages(int32_t serial) { |
| 85 | LOG_CALL << serial; |
| 86 | LOG(ERROR) << " getPendingMessages is unsupported by HIDL HALs"; |
| 87 | return ok(); |
| 88 | } |
| 89 | ScopedAStatus RadioSatellite::getSatelliteMode(int32_t serial) { |
| 90 | LOG_CALL << serial; |
| 91 | LOG(ERROR) << " getSatelliteMode is unsupported by HIDL HALs"; |
| 92 | return ok(); |
| 93 | } |
| 94 | ScopedAStatus RadioSatellite::setIndicationFilter(int32_t serial, int32_t /*filterBitmask*/) { |
| 95 | LOG_CALL << serial; |
| 96 | LOG(ERROR) << " setIndicationFilter is unsupported by HIDL HALs"; |
| 97 | return ok(); |
| 98 | } |
| 99 | ScopedAStatus RadioSatellite::startSendingSatellitePointingInfo(int32_t serial) { |
| 100 | LOG_CALL << serial; |
| 101 | LOG(ERROR) << " startSendingSatellitePointingInfo is unsupported by HIDL HALs"; |
| 102 | return ok(); |
| 103 | } |
| 104 | ScopedAStatus RadioSatellite::stopSendingSatellitePointingInfo(int32_t serial) { |
| 105 | LOG_CALL << serial; |
| 106 | LOG(ERROR) << " stopSendingSatellitePointingInfo is unsupported by HIDL HALs"; |
| 107 | return ok(); |
| 108 | } |
| 109 | ScopedAStatus RadioSatellite::getMaxCharactersPerTextMessage(int32_t serial) { |
| 110 | LOG_CALL << serial; |
| 111 | LOG(ERROR) << " getMaxCharactersPerTextMessage is unsupported by HIDL HALs"; |
| 112 | return ok(); |
| 113 | } |
| 114 | ScopedAStatus RadioSatellite::getTimeForNextSatelliteVisibility(int32_t serial) { |
| 115 | LOG_CALL << serial; |
| 116 | LOG(ERROR) << " getTimeForNextSatelliteVisibility is unsupported by HIDL HALs"; |
| 117 | return ok(); |
| 118 | } |
| 119 | |
| 120 | ScopedAStatus RadioSatellite::setResponseFunctions( |
| 121 | const std::shared_ptr<aidl::IRadioSatelliteResponse>& response, |
| 122 | const std::shared_ptr<aidl::IRadioSatelliteIndication>& indication) { |
| 123 | LOG_CALL << response << ' ' << indication; |
| 124 | mCallbackManager->setResponseFunctions(response, indication); |
| 125 | return ok(); |
| 126 | } |
| 127 | |
| 128 | } // namespace android::hardware::radio::compat |