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_voice_utils.h" |
| 18 | |
Sarah Chin | c83bce4 | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 19 | RadioVoiceResponse::RadioVoiceResponse(RadioServiceTest& parent) : parent_voice(parent) {} |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 20 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 21 | ndk::ScopedAStatus RadioVoiceResponse::acceptCallResponse(const RadioResponseInfo& info) { |
| 22 | rspInfo = info; |
| 23 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 24 | return ndk::ScopedAStatus::ok(); |
| 25 | } |
| 26 | |
| 27 | ndk::ScopedAStatus RadioVoiceResponse::acknowledgeRequest(int32_t /*serial*/) { |
| 28 | return ndk::ScopedAStatus::ok(); |
| 29 | } |
| 30 | |
Sarah Chin | ca421a6 | 2022-01-28 15:54:36 -0800 | [diff] [blame] | 31 | ndk::ScopedAStatus RadioVoiceResponse::cancelPendingUssdResponse(const RadioResponseInfo& info) { |
| 32 | rspInfo = info; |
| 33 | parent_voice.notify(info.serial); |
| 34 | return ndk::ScopedAStatus::ok(); |
| 35 | } |
| 36 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 37 | ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& info) { |
| 38 | rspInfo = info; |
| 39 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 40 | return ndk::ScopedAStatus::ok(); |
| 41 | } |
| 42 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 43 | ndk::ScopedAStatus RadioVoiceResponse::dialResponse(const RadioResponseInfo& info) { |
| 44 | rspInfo = info; |
| 45 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 46 | return ndk::ScopedAStatus::ok(); |
| 47 | } |
| 48 | |
| 49 | ndk::ScopedAStatus RadioVoiceResponse::emergencyDialResponse(const RadioResponseInfo& info) { |
| 50 | rspInfo = info; |
| 51 | parent_voice.notify(info.serial); |
| 52 | return ndk::ScopedAStatus::ok(); |
| 53 | } |
| 54 | |
| 55 | ndk::ScopedAStatus RadioVoiceResponse::exitEmergencyCallbackModeResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 56 | const RadioResponseInfo& info) { |
| 57 | rspInfo = info; |
| 58 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 59 | return ndk::ScopedAStatus::ok(); |
| 60 | } |
| 61 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 62 | ndk::ScopedAStatus RadioVoiceResponse::explicitCallTransferResponse(const RadioResponseInfo& info) { |
| 63 | rspInfo = info; |
| 64 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 65 | return ndk::ScopedAStatus::ok(); |
| 66 | } |
| 67 | |
| 68 | ndk::ScopedAStatus RadioVoiceResponse::getCallForwardStatusResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 69 | const RadioResponseInfo& info, const std::vector<CallForwardInfo>& /*callForwardInfos*/) { |
| 70 | rspInfo = info; |
| 71 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 72 | return ndk::ScopedAStatus::ok(); |
| 73 | } |
| 74 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 75 | ndk::ScopedAStatus RadioVoiceResponse::getCallWaitingResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 76 | bool /*enable*/, |
| 77 | int32_t /*serviceClass*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 78 | rspInfo = info; |
| 79 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 80 | return ndk::ScopedAStatus::ok(); |
| 81 | } |
| 82 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 83 | ndk::ScopedAStatus RadioVoiceResponse::getClipResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 84 | ClipStatus /*status*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 85 | rspInfo = info; |
| 86 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 87 | return ndk::ScopedAStatus::ok(); |
| 88 | } |
| 89 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 90 | ndk::ScopedAStatus RadioVoiceResponse::getClirResponse(const RadioResponseInfo& info, int32_t /*n*/, |
| 91 | int32_t /*m*/) { |
| 92 | rspInfo = info; |
| 93 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 94 | return ndk::ScopedAStatus::ok(); |
| 95 | } |
| 96 | |
| 97 | ndk::ScopedAStatus RadioVoiceResponse::getCurrentCallsResponse(const RadioResponseInfo& info, |
| 98 | const std::vector<Call>& calls) { |
| 99 | rspInfo = info; |
| 100 | currentCalls = calls; |
| 101 | parent_voice.notify(info.serial); |
| 102 | return ndk::ScopedAStatus::ok(); |
| 103 | } |
| 104 | |
| 105 | ndk::ScopedAStatus RadioVoiceResponse::getLastCallFailCauseResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 106 | const RadioResponseInfo& info, const LastCallFailCauseInfo& /*failCauseInfo*/) { |
| 107 | rspInfo = info; |
| 108 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 109 | return ndk::ScopedAStatus::ok(); |
| 110 | } |
| 111 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 112 | ndk::ScopedAStatus RadioVoiceResponse::getMuteResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 113 | bool /*enable*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 114 | rspInfo = info; |
| 115 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 116 | return ndk::ScopedAStatus::ok(); |
| 117 | } |
| 118 | |
| 119 | ndk::ScopedAStatus RadioVoiceResponse::getPreferredVoicePrivacyResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 120 | const RadioResponseInfo& info, bool /*enable*/) { |
| 121 | rspInfo = info; |
| 122 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 123 | return ndk::ScopedAStatus::ok(); |
| 124 | } |
| 125 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 126 | ndk::ScopedAStatus RadioVoiceResponse::getTtyModeResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 127 | TtyMode /*mode*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 128 | rspInfo = info; |
| 129 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 130 | return ndk::ScopedAStatus::ok(); |
| 131 | } |
| 132 | |
| 133 | ndk::ScopedAStatus RadioVoiceResponse::handleStkCallSetupRequestFromSimResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 134 | const RadioResponseInfo& info) { |
| 135 | rspInfo = info; |
| 136 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 137 | return ndk::ScopedAStatus::ok(); |
| 138 | } |
| 139 | |
| 140 | ndk::ScopedAStatus RadioVoiceResponse::hangupConnectionResponse(const RadioResponseInfo& info) { |
| 141 | rspInfo = info; |
| 142 | parent_voice.notify(info.serial); |
| 143 | return ndk::ScopedAStatus::ok(); |
| 144 | } |
| 145 | |
| 146 | ndk::ScopedAStatus RadioVoiceResponse::hangupForegroundResumeBackgroundResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 147 | const RadioResponseInfo& info) { |
| 148 | rspInfo = info; |
| 149 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 150 | return ndk::ScopedAStatus::ok(); |
| 151 | } |
| 152 | |
| 153 | ndk::ScopedAStatus RadioVoiceResponse::hangupWaitingOrBackgroundResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 154 | const RadioResponseInfo& info) { |
| 155 | rspInfo = info; |
| 156 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 157 | return ndk::ScopedAStatus::ok(); |
| 158 | } |
| 159 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 160 | ndk::ScopedAStatus RadioVoiceResponse::isVoNrEnabledResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 161 | bool /*enabled*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 162 | rspInfo = info; |
| 163 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 164 | return ndk::ScopedAStatus::ok(); |
| 165 | } |
| 166 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 167 | ndk::ScopedAStatus RadioVoiceResponse::rejectCallResponse(const RadioResponseInfo& info) { |
| 168 | rspInfo = info; |
| 169 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 170 | return ndk::ScopedAStatus::ok(); |
| 171 | } |
| 172 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 173 | ndk::ScopedAStatus RadioVoiceResponse::sendBurstDtmfResponse(const RadioResponseInfo& info) { |
| 174 | rspInfo = info; |
| 175 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 176 | return ndk::ScopedAStatus::ok(); |
| 177 | } |
| 178 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 179 | ndk::ScopedAStatus RadioVoiceResponse::sendCdmaFeatureCodeResponse(const RadioResponseInfo& info) { |
| 180 | rspInfo = info; |
| 181 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 182 | return ndk::ScopedAStatus::ok(); |
| 183 | } |
| 184 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 185 | ndk::ScopedAStatus RadioVoiceResponse::sendDtmfResponse(const RadioResponseInfo& info) { |
| 186 | rspInfo = info; |
| 187 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 188 | return ndk::ScopedAStatus::ok(); |
| 189 | } |
| 190 | |
Sarah Chin | ca421a6 | 2022-01-28 15:54:36 -0800 | [diff] [blame] | 191 | ndk::ScopedAStatus RadioVoiceResponse::sendUssdResponse(const RadioResponseInfo& info) { |
| 192 | rspInfo = info; |
| 193 | parent_voice.notify(info.serial); |
| 194 | return ndk::ScopedAStatus::ok(); |
| 195 | } |
| 196 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 197 | ndk::ScopedAStatus RadioVoiceResponse::separateConnectionResponse(const RadioResponseInfo& info) { |
| 198 | rspInfo = info; |
| 199 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 200 | return ndk::ScopedAStatus::ok(); |
| 201 | } |
| 202 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 203 | ndk::ScopedAStatus RadioVoiceResponse::setCallForwardResponse(const RadioResponseInfo& info) { |
| 204 | rspInfo = info; |
| 205 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 206 | return ndk::ScopedAStatus::ok(); |
| 207 | } |
| 208 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 209 | ndk::ScopedAStatus RadioVoiceResponse::setCallWaitingResponse(const RadioResponseInfo& info) { |
| 210 | rspInfo = info; |
| 211 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 212 | return ndk::ScopedAStatus::ok(); |
| 213 | } |
| 214 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 215 | ndk::ScopedAStatus RadioVoiceResponse::setClirResponse(const RadioResponseInfo& info) { |
| 216 | rspInfo = info; |
| 217 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 218 | return ndk::ScopedAStatus::ok(); |
| 219 | } |
| 220 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 221 | ndk::ScopedAStatus RadioVoiceResponse::setMuteResponse(const RadioResponseInfo& info) { |
| 222 | rspInfo = info; |
| 223 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 224 | return ndk::ScopedAStatus::ok(); |
| 225 | } |
| 226 | |
| 227 | ndk::ScopedAStatus RadioVoiceResponse::setPreferredVoicePrivacyResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 228 | const RadioResponseInfo& info) { |
| 229 | rspInfo = info; |
| 230 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 231 | return ndk::ScopedAStatus::ok(); |
| 232 | } |
| 233 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 234 | ndk::ScopedAStatus RadioVoiceResponse::setTtyModeResponse(const RadioResponseInfo& info) { |
| 235 | rspInfo = info; |
| 236 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 237 | return ndk::ScopedAStatus::ok(); |
| 238 | } |
| 239 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 240 | ndk::ScopedAStatus RadioVoiceResponse::setVoNrEnabledResponse(const RadioResponseInfo& info) { |
| 241 | rspInfo = info; |
| 242 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 243 | return ndk::ScopedAStatus::ok(); |
| 244 | } |
| 245 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 246 | ndk::ScopedAStatus RadioVoiceResponse::startDtmfResponse(const RadioResponseInfo& info) { |
| 247 | rspInfo = info; |
| 248 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 249 | return ndk::ScopedAStatus::ok(); |
| 250 | } |
| 251 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 252 | ndk::ScopedAStatus RadioVoiceResponse::stopDtmfResponse(const RadioResponseInfo& info) { |
| 253 | rspInfo = info; |
| 254 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 255 | return ndk::ScopedAStatus::ok(); |
| 256 | } |
| 257 | |
| 258 | ndk::ScopedAStatus RadioVoiceResponse::switchWaitingOrHoldingAndActiveResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 259 | const RadioResponseInfo& info) { |
| 260 | rspInfo = info; |
| 261 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 262 | return ndk::ScopedAStatus::ok(); |
| 263 | } |