Sarah Chin | fc5603b | 2021-12-21 11:34:00 -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 | #include "radio_sim_utils.h" |
| 18 | |
| 19 | RadioSimResponse::RadioSimResponse(RadioResponseWaiter& parent) : parent_sim(parent) {} |
| 20 | |
| 21 | ndk::ScopedAStatus RadioSimResponse::acknowledgeRequest(int32_t /*serial*/) { |
| 22 | return ndk::ScopedAStatus::ok(); |
| 23 | } |
| 24 | |
| 25 | ndk::ScopedAStatus RadioSimResponse::areUiccApplicationsEnabledResponse( |
| 26 | const RadioResponseInfo& /*info*/, bool /*enabled*/) { |
| 27 | return ndk::ScopedAStatus::ok(); |
| 28 | } |
| 29 | |
| 30 | ndk::ScopedAStatus RadioSimResponse::changeIccPin2ForAppResponse(const RadioResponseInfo& /*info*/, |
| 31 | int32_t /*remainingRetries*/) { |
| 32 | return ndk::ScopedAStatus::ok(); |
| 33 | } |
| 34 | |
| 35 | ndk::ScopedAStatus RadioSimResponse::changeIccPinForAppResponse(const RadioResponseInfo& /*info*/, |
| 36 | int32_t /*remainingRetries*/) { |
| 37 | return ndk::ScopedAStatus::ok(); |
| 38 | } |
| 39 | |
| 40 | ndk::ScopedAStatus RadioSimResponse::enableUiccApplicationsResponse( |
| 41 | const RadioResponseInfo& /*info*/) { |
| 42 | return ndk::ScopedAStatus::ok(); |
| 43 | } |
| 44 | |
| 45 | ndk::ScopedAStatus RadioSimResponse::getAllowedCarriersResponse( |
| 46 | const RadioResponseInfo& /*info*/, const CarrierRestrictions& /*carriers*/, |
| 47 | SimLockMultiSimPolicy /*multiSimPolicy*/) { |
| 48 | return ndk::ScopedAStatus::ok(); |
| 49 | } |
| 50 | |
| 51 | ndk::ScopedAStatus RadioSimResponse::getCdmaSubscriptionResponse( |
| 52 | const RadioResponseInfo& /*info*/, const std::string& /*mdn*/, const std::string& /*hSid*/, |
| 53 | const std::string& /*hNid*/, const std::string& /*min*/, const std::string& /*prl*/) { |
| 54 | return ndk::ScopedAStatus::ok(); |
| 55 | } |
| 56 | |
| 57 | ndk::ScopedAStatus RadioSimResponse::getCdmaSubscriptionSourceResponse( |
| 58 | const RadioResponseInfo& /*info*/, CdmaSubscriptionSource /*source*/) { |
| 59 | return ndk::ScopedAStatus::ok(); |
| 60 | } |
| 61 | |
| 62 | ndk::ScopedAStatus RadioSimResponse::getFacilityLockForAppResponse( |
| 63 | const RadioResponseInfo& /*info*/, int32_t /*response*/) { |
| 64 | return ndk::ScopedAStatus::ok(); |
| 65 | } |
| 66 | |
| 67 | ndk::ScopedAStatus RadioSimResponse::getIccCardStatusResponse(const RadioResponseInfo& info, |
| 68 | const CardStatus& card_status) { |
| 69 | rspInfo = info; |
| 70 | cardStatus = card_status; |
| 71 | parent_sim.notify(info.serial); |
| 72 | return ndk::ScopedAStatus::ok(); |
| 73 | } |
| 74 | |
| 75 | ndk::ScopedAStatus RadioSimResponse::getImsiForAppResponse(const RadioResponseInfo& /*info*/, |
| 76 | const std::string& /*imsi*/) { |
| 77 | return ndk::ScopedAStatus::ok(); |
| 78 | } |
| 79 | |
| 80 | ndk::ScopedAStatus RadioSimResponse::getSimPhonebookCapacityResponse( |
| 81 | const RadioResponseInfo& info, const PhonebookCapacity& pbCapacity) { |
| 82 | rspInfo = info; |
| 83 | capacity = pbCapacity; |
| 84 | parent_sim.notify(info.serial); |
| 85 | return ndk::ScopedAStatus::ok(); |
| 86 | } |
| 87 | |
| 88 | ndk::ScopedAStatus RadioSimResponse::getSimPhonebookRecordsResponse(const RadioResponseInfo& info) { |
| 89 | rspInfo = info; |
| 90 | parent_sim.notify(info.serial); |
| 91 | return ndk::ScopedAStatus::ok(); |
| 92 | } |
| 93 | |
| 94 | ndk::ScopedAStatus RadioSimResponse::iccCloseLogicalChannelResponse( |
| 95 | const RadioResponseInfo& /*info*/) { |
| 96 | return ndk::ScopedAStatus::ok(); |
| 97 | } |
| 98 | |
| 99 | ndk::ScopedAStatus RadioSimResponse::iccIoForAppResponse(const RadioResponseInfo& /*info*/, |
| 100 | const IccIoResult& /*iccIo*/) { |
| 101 | return ndk::ScopedAStatus::ok(); |
| 102 | } |
| 103 | |
| 104 | ndk::ScopedAStatus RadioSimResponse::iccOpenLogicalChannelResponse( |
| 105 | const RadioResponseInfo& /*info*/, int32_t /*channelId*/, |
| 106 | const std::vector<uint8_t>& /*selectResponse*/) { |
| 107 | return ndk::ScopedAStatus::ok(); |
| 108 | } |
| 109 | |
| 110 | ndk::ScopedAStatus RadioSimResponse::iccTransmitApduBasicChannelResponse( |
| 111 | const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) { |
| 112 | return ndk::ScopedAStatus::ok(); |
| 113 | } |
| 114 | |
| 115 | ndk::ScopedAStatus RadioSimResponse::iccTransmitApduLogicalChannelResponse( |
| 116 | const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) { |
| 117 | return ndk::ScopedAStatus::ok(); |
| 118 | } |
| 119 | |
| 120 | ndk::ScopedAStatus RadioSimResponse::reportStkServiceIsRunningResponse( |
| 121 | const RadioResponseInfo& /*info*/) { |
| 122 | return ndk::ScopedAStatus::ok(); |
| 123 | } |
| 124 | |
| 125 | ndk::ScopedAStatus RadioSimResponse::requestIccSimAuthenticationResponse( |
| 126 | const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) { |
| 127 | return ndk::ScopedAStatus::ok(); |
| 128 | } |
| 129 | |
| 130 | ndk::ScopedAStatus RadioSimResponse::sendEnvelopeResponse(const RadioResponseInfo& /*info*/, |
| 131 | const std::string& /*commandResponse*/) { |
| 132 | return ndk::ScopedAStatus::ok(); |
| 133 | } |
| 134 | |
| 135 | ndk::ScopedAStatus RadioSimResponse::sendEnvelopeWithStatusResponse( |
| 136 | const RadioResponseInfo& /*info*/, const IccIoResult& /*iccIo*/) { |
| 137 | return ndk::ScopedAStatus::ok(); |
| 138 | } |
| 139 | |
| 140 | ndk::ScopedAStatus RadioSimResponse::sendTerminalResponseToSimResponse( |
| 141 | const RadioResponseInfo& /*info*/) { |
| 142 | return ndk::ScopedAStatus::ok(); |
| 143 | } |
| 144 | |
| 145 | ndk::ScopedAStatus RadioSimResponse::setAllowedCarriersResponse(const RadioResponseInfo& /*info*/) { |
| 146 | return ndk::ScopedAStatus::ok(); |
| 147 | } |
| 148 | |
| 149 | ndk::ScopedAStatus RadioSimResponse::setCarrierInfoForImsiEncryptionResponse( |
| 150 | const RadioResponseInfo& info) { |
| 151 | rspInfo = info; |
| 152 | parent_sim.notify(info.serial); |
| 153 | return ndk::ScopedAStatus::ok(); |
| 154 | } |
| 155 | |
| 156 | ndk::ScopedAStatus RadioSimResponse::setCdmaSubscriptionSourceResponse( |
| 157 | const RadioResponseInfo& /*info*/) { |
| 158 | return ndk::ScopedAStatus::ok(); |
| 159 | } |
| 160 | |
| 161 | ndk::ScopedAStatus RadioSimResponse::setFacilityLockForAppResponse( |
| 162 | const RadioResponseInfo& /*info*/, int32_t /*retry*/) { |
| 163 | return ndk::ScopedAStatus::ok(); |
| 164 | } |
| 165 | |
| 166 | ndk::ScopedAStatus RadioSimResponse::setSimCardPowerResponse(const RadioResponseInfo& info) { |
| 167 | rspInfo = info; |
| 168 | parent_sim.notify(info.serial); |
| 169 | return ndk::ScopedAStatus::ok(); |
| 170 | } |
| 171 | |
| 172 | ndk::ScopedAStatus RadioSimResponse::setUiccSubscriptionResponse( |
| 173 | const RadioResponseInfo& /*info*/) { |
| 174 | return ndk::ScopedAStatus::ok(); |
| 175 | } |
| 176 | |
| 177 | ndk::ScopedAStatus RadioSimResponse::supplyIccPin2ForAppResponse(const RadioResponseInfo& /*info*/, |
| 178 | int32_t /*remainingRetries*/) { |
| 179 | return ndk::ScopedAStatus::ok(); |
| 180 | } |
| 181 | |
| 182 | ndk::ScopedAStatus RadioSimResponse::supplyIccPinForAppResponse(const RadioResponseInfo& /*info*/, |
| 183 | int32_t /*remainingRetries*/) { |
| 184 | return ndk::ScopedAStatus::ok(); |
| 185 | } |
| 186 | |
| 187 | ndk::ScopedAStatus RadioSimResponse::supplyIccPuk2ForAppResponse(const RadioResponseInfo& /*info*/, |
| 188 | int32_t /*remainingRetries*/) { |
| 189 | return ndk::ScopedAStatus::ok(); |
| 190 | } |
| 191 | |
| 192 | ndk::ScopedAStatus RadioSimResponse::supplyIccPukForAppResponse(const RadioResponseInfo& /*info*/, |
| 193 | int32_t /*remainingRetries*/) { |
| 194 | return ndk::ScopedAStatus::ok(); |
| 195 | } |
| 196 | |
| 197 | ndk::ScopedAStatus RadioSimResponse::supplySimDepersonalizationResponse( |
| 198 | const RadioResponseInfo& /*info*/, PersoSubstate /*persoType*/, |
| 199 | int32_t /*remainingRetries*/) { |
| 200 | return ndk::ScopedAStatus::ok(); |
| 201 | } |
| 202 | |
| 203 | ndk::ScopedAStatus RadioSimResponse::updateSimPhonebookRecordsResponse( |
| 204 | const RadioResponseInfo& info, int32_t recordIndex) { |
| 205 | rspInfo = info; |
| 206 | updatedRecordIndex = recordIndex; |
| 207 | parent_sim.notify(info.serial); |
| 208 | return ndk::ScopedAStatus::ok(); |
| 209 | } |