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 | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 31 | ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& info) { |
| 32 | rspInfo = info; |
| 33 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 34 | return ndk::ScopedAStatus::ok(); |
| 35 | } |
| 36 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 37 | ndk::ScopedAStatus RadioVoiceResponse::dialResponse(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 | |
| 43 | ndk::ScopedAStatus RadioVoiceResponse::emergencyDialResponse(const RadioResponseInfo& info) { |
| 44 | rspInfo = info; |
| 45 | parent_voice.notify(info.serial); |
| 46 | return ndk::ScopedAStatus::ok(); |
| 47 | } |
| 48 | |
| 49 | ndk::ScopedAStatus RadioVoiceResponse::exitEmergencyCallbackModeResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 50 | const RadioResponseInfo& info) { |
| 51 | rspInfo = info; |
| 52 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 53 | return ndk::ScopedAStatus::ok(); |
| 54 | } |
| 55 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 56 | ndk::ScopedAStatus RadioVoiceResponse::explicitCallTransferResponse(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 | |
| 62 | ndk::ScopedAStatus RadioVoiceResponse::getCallForwardStatusResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 63 | const RadioResponseInfo& info, const std::vector<CallForwardInfo>& /*callForwardInfos*/) { |
| 64 | rspInfo = info; |
| 65 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 66 | return ndk::ScopedAStatus::ok(); |
| 67 | } |
| 68 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 69 | ndk::ScopedAStatus RadioVoiceResponse::getCallWaitingResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 70 | bool /*enable*/, |
| 71 | int32_t /*serviceClass*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 72 | rspInfo = info; |
| 73 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 74 | return ndk::ScopedAStatus::ok(); |
| 75 | } |
| 76 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 77 | ndk::ScopedAStatus RadioVoiceResponse::getClipResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 78 | ClipStatus /*status*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 79 | rspInfo = info; |
| 80 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 81 | return ndk::ScopedAStatus::ok(); |
| 82 | } |
| 83 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 84 | ndk::ScopedAStatus RadioVoiceResponse::getClirResponse(const RadioResponseInfo& info, int32_t /*n*/, |
| 85 | int32_t /*m*/) { |
| 86 | rspInfo = info; |
| 87 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 88 | return ndk::ScopedAStatus::ok(); |
| 89 | } |
| 90 | |
| 91 | ndk::ScopedAStatus RadioVoiceResponse::getCurrentCallsResponse(const RadioResponseInfo& info, |
| 92 | const std::vector<Call>& calls) { |
| 93 | rspInfo = info; |
| 94 | currentCalls = calls; |
| 95 | parent_voice.notify(info.serial); |
| 96 | return ndk::ScopedAStatus::ok(); |
| 97 | } |
| 98 | |
| 99 | ndk::ScopedAStatus RadioVoiceResponse::getLastCallFailCauseResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 100 | const RadioResponseInfo& info, const LastCallFailCauseInfo& /*failCauseInfo*/) { |
| 101 | rspInfo = info; |
| 102 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 103 | return ndk::ScopedAStatus::ok(); |
| 104 | } |
| 105 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 106 | ndk::ScopedAStatus RadioVoiceResponse::getMuteResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 107 | bool /*enable*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 108 | rspInfo = info; |
| 109 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 110 | return ndk::ScopedAStatus::ok(); |
| 111 | } |
| 112 | |
| 113 | ndk::ScopedAStatus RadioVoiceResponse::getPreferredVoicePrivacyResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 114 | const RadioResponseInfo& info, bool /*enable*/) { |
| 115 | rspInfo = info; |
| 116 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 117 | return ndk::ScopedAStatus::ok(); |
| 118 | } |
| 119 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 120 | ndk::ScopedAStatus RadioVoiceResponse::getTtyModeResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 121 | TtyMode /*mode*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 122 | rspInfo = info; |
| 123 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 124 | return ndk::ScopedAStatus::ok(); |
| 125 | } |
| 126 | |
| 127 | ndk::ScopedAStatus RadioVoiceResponse::handleStkCallSetupRequestFromSimResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 128 | const RadioResponseInfo& info) { |
| 129 | rspInfo = info; |
| 130 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 131 | return ndk::ScopedAStatus::ok(); |
| 132 | } |
| 133 | |
| 134 | ndk::ScopedAStatus RadioVoiceResponse::hangupConnectionResponse(const RadioResponseInfo& info) { |
| 135 | rspInfo = info; |
| 136 | parent_voice.notify(info.serial); |
| 137 | return ndk::ScopedAStatus::ok(); |
| 138 | } |
| 139 | |
| 140 | ndk::ScopedAStatus RadioVoiceResponse::hangupForegroundResumeBackgroundResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 141 | const RadioResponseInfo& info) { |
| 142 | rspInfo = info; |
| 143 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 144 | return ndk::ScopedAStatus::ok(); |
| 145 | } |
| 146 | |
| 147 | ndk::ScopedAStatus RadioVoiceResponse::hangupWaitingOrBackgroundResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 148 | const RadioResponseInfo& info) { |
| 149 | rspInfo = info; |
| 150 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 151 | return ndk::ScopedAStatus::ok(); |
| 152 | } |
| 153 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 154 | ndk::ScopedAStatus RadioVoiceResponse::isVoNrEnabledResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 155 | bool /*enabled*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 156 | rspInfo = info; |
| 157 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 158 | return ndk::ScopedAStatus::ok(); |
| 159 | } |
| 160 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 161 | ndk::ScopedAStatus RadioVoiceResponse::rejectCallResponse(const RadioResponseInfo& info) { |
| 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::sendBurstDtmfResponse(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::sendCdmaFeatureCodeResponse(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::sendDtmfResponse(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::separateConnectionResponse(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 | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 191 | ndk::ScopedAStatus RadioVoiceResponse::setCallForwardResponse(const RadioResponseInfo& info) { |
| 192 | rspInfo = info; |
| 193 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 194 | return ndk::ScopedAStatus::ok(); |
| 195 | } |
| 196 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 197 | ndk::ScopedAStatus RadioVoiceResponse::setCallWaitingResponse(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::setClirResponse(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::setMuteResponse(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 | |
| 215 | ndk::ScopedAStatus RadioVoiceResponse::setPreferredVoicePrivacyResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 216 | const RadioResponseInfo& info) { |
| 217 | rspInfo = info; |
| 218 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 219 | return ndk::ScopedAStatus::ok(); |
| 220 | } |
| 221 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 222 | ndk::ScopedAStatus RadioVoiceResponse::setTtyModeResponse(const RadioResponseInfo& info) { |
| 223 | rspInfo = info; |
| 224 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 225 | return ndk::ScopedAStatus::ok(); |
| 226 | } |
| 227 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 228 | ndk::ScopedAStatus RadioVoiceResponse::setVoNrEnabledResponse(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::startDtmfResponse(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::stopDtmfResponse(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 | |
| 246 | ndk::ScopedAStatus RadioVoiceResponse::switchWaitingOrHoldingAndActiveResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 247 | const RadioResponseInfo& info) { |
| 248 | rspInfo = info; |
| 249 | parent_voice.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 250 | return ndk::ScopedAStatus::ok(); |
| 251 | } |