blob: dd7b1bf26198a6f874a5b94f3c2510bf08dcfce4 [file] [log] [blame]
Sarah Chinfc5603b2021-12-21 11:34:00 -08001/*
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 Chinc83bce42021-12-29 00:35:12 -080019RadioVoiceResponse::RadioVoiceResponse(RadioServiceTest& parent) : parent_voice(parent) {}
Sarah Chinfc5603b2021-12-21 11:34:00 -080020
Sarah Chin912bdf32022-01-28 01:02:16 -080021ndk::ScopedAStatus RadioVoiceResponse::acceptCallResponse(const RadioResponseInfo& info) {
22 rspInfo = info;
23 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080024 return ndk::ScopedAStatus::ok();
25}
26
27ndk::ScopedAStatus RadioVoiceResponse::acknowledgeRequest(int32_t /*serial*/) {
28 return ndk::ScopedAStatus::ok();
29}
30
Sarah Chinca421a62022-01-28 15:54:36 -080031ndk::ScopedAStatus RadioVoiceResponse::cancelPendingUssdResponse(const RadioResponseInfo& info) {
32 rspInfo = info;
33 parent_voice.notify(info.serial);
34 return ndk::ScopedAStatus::ok();
35}
36
Sarah Chin912bdf32022-01-28 01:02:16 -080037ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& info) {
38 rspInfo = info;
39 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080040 return ndk::ScopedAStatus::ok();
41}
42
Sarah Chin912bdf32022-01-28 01:02:16 -080043ndk::ScopedAStatus RadioVoiceResponse::dialResponse(const RadioResponseInfo& info) {
44 rspInfo = info;
45 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080046 return ndk::ScopedAStatus::ok();
47}
48
49ndk::ScopedAStatus RadioVoiceResponse::emergencyDialResponse(const RadioResponseInfo& info) {
50 rspInfo = info;
51 parent_voice.notify(info.serial);
52 return ndk::ScopedAStatus::ok();
53}
54
55ndk::ScopedAStatus RadioVoiceResponse::exitEmergencyCallbackModeResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080056 const RadioResponseInfo& info) {
57 rspInfo = info;
58 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080059 return ndk::ScopedAStatus::ok();
60}
61
Sarah Chin912bdf32022-01-28 01:02:16 -080062ndk::ScopedAStatus RadioVoiceResponse::explicitCallTransferResponse(const RadioResponseInfo& info) {
63 rspInfo = info;
64 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080065 return ndk::ScopedAStatus::ok();
66}
67
68ndk::ScopedAStatus RadioVoiceResponse::getCallForwardStatusResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080069 const RadioResponseInfo& info, const std::vector<CallForwardInfo>& /*callForwardInfos*/) {
70 rspInfo = info;
71 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080072 return ndk::ScopedAStatus::ok();
73}
74
Sarah Chin912bdf32022-01-28 01:02:16 -080075ndk::ScopedAStatus RadioVoiceResponse::getCallWaitingResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -080076 bool /*enable*/,
77 int32_t /*serviceClass*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -080078 rspInfo = info;
79 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080080 return ndk::ScopedAStatus::ok();
81}
82
Sarah Chin912bdf32022-01-28 01:02:16 -080083ndk::ScopedAStatus RadioVoiceResponse::getClipResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -080084 ClipStatus /*status*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -080085 rspInfo = info;
86 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080087 return ndk::ScopedAStatus::ok();
88}
89
Sarah Chin912bdf32022-01-28 01:02:16 -080090ndk::ScopedAStatus RadioVoiceResponse::getClirResponse(const RadioResponseInfo& info, int32_t /*n*/,
91 int32_t /*m*/) {
92 rspInfo = info;
93 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080094 return ndk::ScopedAStatus::ok();
95}
96
97ndk::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
105ndk::ScopedAStatus RadioVoiceResponse::getLastCallFailCauseResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800106 const RadioResponseInfo& info, const LastCallFailCauseInfo& /*failCauseInfo*/) {
107 rspInfo = info;
108 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800109 return ndk::ScopedAStatus::ok();
110}
111
Sarah Chin912bdf32022-01-28 01:02:16 -0800112ndk::ScopedAStatus RadioVoiceResponse::getMuteResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -0800113 bool /*enable*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -0800114 rspInfo = info;
115 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800116 return ndk::ScopedAStatus::ok();
117}
118
119ndk::ScopedAStatus RadioVoiceResponse::getPreferredVoicePrivacyResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800120 const RadioResponseInfo& info, bool /*enable*/) {
121 rspInfo = info;
122 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800123 return ndk::ScopedAStatus::ok();
124}
125
Sarah Chin912bdf32022-01-28 01:02:16 -0800126ndk::ScopedAStatus RadioVoiceResponse::getTtyModeResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -0800127 TtyMode /*mode*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -0800128 rspInfo = info;
129 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800130 return ndk::ScopedAStatus::ok();
131}
132
133ndk::ScopedAStatus RadioVoiceResponse::handleStkCallSetupRequestFromSimResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800134 const RadioResponseInfo& info) {
135 rspInfo = info;
136 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800137 return ndk::ScopedAStatus::ok();
138}
139
140ndk::ScopedAStatus RadioVoiceResponse::hangupConnectionResponse(const RadioResponseInfo& info) {
141 rspInfo = info;
142 parent_voice.notify(info.serial);
143 return ndk::ScopedAStatus::ok();
144}
145
146ndk::ScopedAStatus RadioVoiceResponse::hangupForegroundResumeBackgroundResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800147 const RadioResponseInfo& info) {
148 rspInfo = info;
149 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800150 return ndk::ScopedAStatus::ok();
151}
152
153ndk::ScopedAStatus RadioVoiceResponse::hangupWaitingOrBackgroundResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800154 const RadioResponseInfo& info) {
155 rspInfo = info;
156 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800157 return ndk::ScopedAStatus::ok();
158}
159
Sarah Chin912bdf32022-01-28 01:02:16 -0800160ndk::ScopedAStatus RadioVoiceResponse::isVoNrEnabledResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -0800161 bool /*enabled*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -0800162 rspInfo = info;
163 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800164 return ndk::ScopedAStatus::ok();
165}
166
Sarah Chin912bdf32022-01-28 01:02:16 -0800167ndk::ScopedAStatus RadioVoiceResponse::rejectCallResponse(const RadioResponseInfo& info) {
168 rspInfo = info;
169 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800170 return ndk::ScopedAStatus::ok();
171}
172
Sarah Chin912bdf32022-01-28 01:02:16 -0800173ndk::ScopedAStatus RadioVoiceResponse::sendBurstDtmfResponse(const RadioResponseInfo& info) {
174 rspInfo = info;
175 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800176 return ndk::ScopedAStatus::ok();
177}
178
Sarah Chin912bdf32022-01-28 01:02:16 -0800179ndk::ScopedAStatus RadioVoiceResponse::sendCdmaFeatureCodeResponse(const RadioResponseInfo& info) {
180 rspInfo = info;
181 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800182 return ndk::ScopedAStatus::ok();
183}
184
Sarah Chin912bdf32022-01-28 01:02:16 -0800185ndk::ScopedAStatus RadioVoiceResponse::sendDtmfResponse(const RadioResponseInfo& info) {
186 rspInfo = info;
187 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800188 return ndk::ScopedAStatus::ok();
189}
190
Sarah Chinca421a62022-01-28 15:54:36 -0800191ndk::ScopedAStatus RadioVoiceResponse::sendUssdResponse(const RadioResponseInfo& info) {
192 rspInfo = info;
193 parent_voice.notify(info.serial);
194 return ndk::ScopedAStatus::ok();
195}
196
Sarah Chin912bdf32022-01-28 01:02:16 -0800197ndk::ScopedAStatus RadioVoiceResponse::separateConnectionResponse(const RadioResponseInfo& info) {
198 rspInfo = info;
199 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800200 return ndk::ScopedAStatus::ok();
201}
202
Sarah Chin912bdf32022-01-28 01:02:16 -0800203ndk::ScopedAStatus RadioVoiceResponse::setCallForwardResponse(const RadioResponseInfo& info) {
204 rspInfo = info;
205 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800206 return ndk::ScopedAStatus::ok();
207}
208
Sarah Chin912bdf32022-01-28 01:02:16 -0800209ndk::ScopedAStatus RadioVoiceResponse::setCallWaitingResponse(const RadioResponseInfo& info) {
210 rspInfo = info;
211 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800212 return ndk::ScopedAStatus::ok();
213}
214
Sarah Chin912bdf32022-01-28 01:02:16 -0800215ndk::ScopedAStatus RadioVoiceResponse::setClirResponse(const RadioResponseInfo& info) {
216 rspInfo = info;
217 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800218 return ndk::ScopedAStatus::ok();
219}
220
Sarah Chin912bdf32022-01-28 01:02:16 -0800221ndk::ScopedAStatus RadioVoiceResponse::setMuteResponse(const RadioResponseInfo& info) {
222 rspInfo = info;
223 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800224 return ndk::ScopedAStatus::ok();
225}
226
227ndk::ScopedAStatus RadioVoiceResponse::setPreferredVoicePrivacyResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800228 const RadioResponseInfo& info) {
229 rspInfo = info;
230 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800231 return ndk::ScopedAStatus::ok();
232}
233
Sarah Chin912bdf32022-01-28 01:02:16 -0800234ndk::ScopedAStatus RadioVoiceResponse::setTtyModeResponse(const RadioResponseInfo& info) {
235 rspInfo = info;
236 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800237 return ndk::ScopedAStatus::ok();
238}
239
Sarah Chin912bdf32022-01-28 01:02:16 -0800240ndk::ScopedAStatus RadioVoiceResponse::setVoNrEnabledResponse(const RadioResponseInfo& info) {
241 rspInfo = info;
242 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800243 return ndk::ScopedAStatus::ok();
244}
245
Sarah Chin912bdf32022-01-28 01:02:16 -0800246ndk::ScopedAStatus RadioVoiceResponse::startDtmfResponse(const RadioResponseInfo& info) {
247 rspInfo = info;
248 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800249 return ndk::ScopedAStatus::ok();
250}
251
Sarah Chin912bdf32022-01-28 01:02:16 -0800252ndk::ScopedAStatus RadioVoiceResponse::stopDtmfResponse(const RadioResponseInfo& info) {
253 rspInfo = info;
254 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800255 return ndk::ScopedAStatus::ok();
256}
257
258ndk::ScopedAStatus RadioVoiceResponse::switchWaitingOrHoldingAndActiveResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800259 const RadioResponseInfo& info) {
260 rspInfo = info;
261 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800262 return ndk::ScopedAStatus::ok();
263}