blob: 95b2d4e72e65c51d28fc07b1b62941fdb9031450 [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 Chin912bdf32022-01-28 01:02:16 -080031ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& info) {
32 rspInfo = info;
33 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080034 return ndk::ScopedAStatus::ok();
35}
36
Sarah Chin912bdf32022-01-28 01:02:16 -080037ndk::ScopedAStatus RadioVoiceResponse::dialResponse(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
43ndk::ScopedAStatus RadioVoiceResponse::emergencyDialResponse(const RadioResponseInfo& info) {
44 rspInfo = info;
45 parent_voice.notify(info.serial);
46 return ndk::ScopedAStatus::ok();
47}
48
49ndk::ScopedAStatus RadioVoiceResponse::exitEmergencyCallbackModeResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080050 const RadioResponseInfo& info) {
51 rspInfo = info;
52 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080053 return ndk::ScopedAStatus::ok();
54}
55
Sarah Chin912bdf32022-01-28 01:02:16 -080056ndk::ScopedAStatus RadioVoiceResponse::explicitCallTransferResponse(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
62ndk::ScopedAStatus RadioVoiceResponse::getCallForwardStatusResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080063 const RadioResponseInfo& info, const std::vector<CallForwardInfo>& /*callForwardInfos*/) {
64 rspInfo = info;
65 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080066 return ndk::ScopedAStatus::ok();
67}
68
Sarah Chin912bdf32022-01-28 01:02:16 -080069ndk::ScopedAStatus RadioVoiceResponse::getCallWaitingResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -080070 bool /*enable*/,
71 int32_t /*serviceClass*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -080072 rspInfo = info;
73 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080074 return ndk::ScopedAStatus::ok();
75}
76
Sarah Chin912bdf32022-01-28 01:02:16 -080077ndk::ScopedAStatus RadioVoiceResponse::getClipResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -080078 ClipStatus /*status*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -080079 rspInfo = info;
80 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080081 return ndk::ScopedAStatus::ok();
82}
83
Sarah Chin912bdf32022-01-28 01:02:16 -080084ndk::ScopedAStatus RadioVoiceResponse::getClirResponse(const RadioResponseInfo& info, int32_t /*n*/,
85 int32_t /*m*/) {
86 rspInfo = info;
87 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080088 return ndk::ScopedAStatus::ok();
89}
90
91ndk::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
99ndk::ScopedAStatus RadioVoiceResponse::getLastCallFailCauseResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800100 const RadioResponseInfo& info, const LastCallFailCauseInfo& /*failCauseInfo*/) {
101 rspInfo = info;
102 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800103 return ndk::ScopedAStatus::ok();
104}
105
Sarah Chin912bdf32022-01-28 01:02:16 -0800106ndk::ScopedAStatus RadioVoiceResponse::getMuteResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -0800107 bool /*enable*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -0800108 rspInfo = info;
109 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800110 return ndk::ScopedAStatus::ok();
111}
112
113ndk::ScopedAStatus RadioVoiceResponse::getPreferredVoicePrivacyResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800114 const RadioResponseInfo& info, bool /*enable*/) {
115 rspInfo = info;
116 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800117 return ndk::ScopedAStatus::ok();
118}
119
Sarah Chin912bdf32022-01-28 01:02:16 -0800120ndk::ScopedAStatus RadioVoiceResponse::getTtyModeResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -0800121 TtyMode /*mode*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -0800122 rspInfo = info;
123 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800124 return ndk::ScopedAStatus::ok();
125}
126
127ndk::ScopedAStatus RadioVoiceResponse::handleStkCallSetupRequestFromSimResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800128 const RadioResponseInfo& info) {
129 rspInfo = info;
130 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800131 return ndk::ScopedAStatus::ok();
132}
133
134ndk::ScopedAStatus RadioVoiceResponse::hangupConnectionResponse(const RadioResponseInfo& info) {
135 rspInfo = info;
136 parent_voice.notify(info.serial);
137 return ndk::ScopedAStatus::ok();
138}
139
140ndk::ScopedAStatus RadioVoiceResponse::hangupForegroundResumeBackgroundResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800141 const RadioResponseInfo& info) {
142 rspInfo = info;
143 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800144 return ndk::ScopedAStatus::ok();
145}
146
147ndk::ScopedAStatus RadioVoiceResponse::hangupWaitingOrBackgroundResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800148 const RadioResponseInfo& info) {
149 rspInfo = info;
150 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800151 return ndk::ScopedAStatus::ok();
152}
153
Sarah Chin912bdf32022-01-28 01:02:16 -0800154ndk::ScopedAStatus RadioVoiceResponse::isVoNrEnabledResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -0800155 bool /*enabled*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -0800156 rspInfo = info;
157 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800158 return ndk::ScopedAStatus::ok();
159}
160
Sarah Chin912bdf32022-01-28 01:02:16 -0800161ndk::ScopedAStatus RadioVoiceResponse::rejectCallResponse(const RadioResponseInfo& info) {
162 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::sendBurstDtmfResponse(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::sendCdmaFeatureCodeResponse(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::sendDtmfResponse(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::separateConnectionResponse(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 Chin912bdf32022-01-28 01:02:16 -0800191ndk::ScopedAStatus RadioVoiceResponse::setCallForwardResponse(const RadioResponseInfo& info) {
192 rspInfo = info;
193 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800194 return ndk::ScopedAStatus::ok();
195}
196
Sarah Chin912bdf32022-01-28 01:02:16 -0800197ndk::ScopedAStatus RadioVoiceResponse::setCallWaitingResponse(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::setClirResponse(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::setMuteResponse(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
215ndk::ScopedAStatus RadioVoiceResponse::setPreferredVoicePrivacyResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800216 const RadioResponseInfo& info) {
217 rspInfo = info;
218 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800219 return ndk::ScopedAStatus::ok();
220}
221
Sarah Chin912bdf32022-01-28 01:02:16 -0800222ndk::ScopedAStatus RadioVoiceResponse::setTtyModeResponse(const RadioResponseInfo& info) {
223 rspInfo = info;
224 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800225 return ndk::ScopedAStatus::ok();
226}
227
Sarah Chin912bdf32022-01-28 01:02:16 -0800228ndk::ScopedAStatus RadioVoiceResponse::setVoNrEnabledResponse(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::startDtmfResponse(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::stopDtmfResponse(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
246ndk::ScopedAStatus RadioVoiceResponse::switchWaitingOrHoldingAndActiveResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800247 const RadioResponseInfo& info) {
248 rspInfo = info;
249 parent_voice.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800250 return ndk::ScopedAStatus::ok();
251}