blob: 451a10c8cfd877722b2c08c1e136b1d61146cdff [file] [log] [blame]
Sarah Chind2a41192021-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_messaging_utils.h"
18
Sarah Chin91997ac2021-12-29 00:35:12 -080019RadioMessagingResponse::RadioMessagingResponse(RadioServiceTest& parent)
Sarah Chind2a41192021-12-21 11:34:00 -080020 : parent_messaging(parent) {}
21
22ndk::ScopedAStatus RadioMessagingResponse::acknowledgeIncomingGsmSmsWithPduResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -080023 const RadioResponseInfo& info) {
24 rspInfo = info;
25 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -080026 return ndk::ScopedAStatus::ok();
27}
28
29ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingCdmaSmsResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -080030 const RadioResponseInfo& info) {
31 rspInfo = info;
32 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -080033 return ndk::ScopedAStatus::ok();
34}
35
36ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingGsmSmsResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -080037 const RadioResponseInfo& info) {
38 rspInfo = info;
39 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -080040 return ndk::ScopedAStatus::ok();
41}
42
43ndk::ScopedAStatus RadioMessagingResponse::acknowledgeRequest(int32_t /*serial*/) {
44 return ndk::ScopedAStatus::ok();
45}
46
47ndk::ScopedAStatus RadioMessagingResponse::cancelPendingUssdResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -080048 const RadioResponseInfo& info) {
49 rspInfo = info;
50 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -080051 return ndk::ScopedAStatus::ok();
52}
53
Sarah Chin52de0ad2022-01-28 01:02:16 -080054ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse(const RadioResponseInfo& info) {
55 rspInfo = info;
56 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -080057 return ndk::ScopedAStatus::ok();
58}
59
Sarah Chin52de0ad2022-01-28 01:02:16 -080060ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse(const RadioResponseInfo& info) {
61 rspInfo = info;
62 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -080063 return ndk::ScopedAStatus::ok();
64}
65
66ndk::ScopedAStatus RadioMessagingResponse::getCdmaBroadcastConfigResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -080067 const RadioResponseInfo& info, const std::vector<CdmaBroadcastSmsConfigInfo>& /*configs*/) {
68 rspInfo = info;
69 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -080070 return ndk::ScopedAStatus::ok();
71}
72
73ndk::ScopedAStatus RadioMessagingResponse::getGsmBroadcastConfigResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -080074 const RadioResponseInfo& info, const std::vector<GsmBroadcastSmsConfigInfo>& /*configs*/) {
75 rspInfo = info;
76 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -080077 return ndk::ScopedAStatus::ok();
78}
79
Sarah Chin52de0ad2022-01-28 01:02:16 -080080ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& info,
Sarah Chind2a41192021-12-21 11:34:00 -080081 const std::string& /*smsc*/) {
Sarah Chin52de0ad2022-01-28 01:02:16 -080082 rspInfo = info;
83 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -080084 return ndk::ScopedAStatus::ok();
85}
86
87ndk::ScopedAStatus RadioMessagingResponse::reportSmsMemoryStatusResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -080088 const RadioResponseInfo& info) {
89 rspInfo = info;
90 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -080091 return ndk::ScopedAStatus::ok();
92}
93
94ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsExpectMoreResponse(
95 const RadioResponseInfo& info, const SendSmsResult& sms) {
96 rspInfo = info;
97 sendSmsResult = sms;
98 parent_messaging.notify(info.serial);
99 return ndk::ScopedAStatus::ok();
100}
101
102ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsResponse(const RadioResponseInfo& info,
103 const SendSmsResult& sms) {
104 rspInfo = info;
105 sendSmsResult = sms;
106 parent_messaging.notify(info.serial);
107 return ndk::ScopedAStatus::ok();
108}
109
Sarah Chin52de0ad2022-01-28 01:02:16 -0800110ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& info,
Sarah Chind2a41192021-12-21 11:34:00 -0800111 const SendSmsResult& /*sms*/) {
Sarah Chin52de0ad2022-01-28 01:02:16 -0800112 rspInfo = info;
113 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -0800114 return ndk::ScopedAStatus::ok();
115}
116
117ndk::ScopedAStatus RadioMessagingResponse::sendSmsExpectMoreResponse(const RadioResponseInfo& info,
118 const SendSmsResult& sms) {
119 rspInfo = info;
120 sendSmsResult = sms;
121 parent_messaging.notify(info.serial);
122 return ndk::ScopedAStatus::ok();
123}
124
125ndk::ScopedAStatus RadioMessagingResponse::sendSmsResponse(const RadioResponseInfo& info,
126 const SendSmsResult& sms) {
127 rspInfo = info;
128 sendSmsResult = sms;
129 parent_messaging.notify(info.serial);
130 return ndk::ScopedAStatus::ok();
131}
132
Sarah Chin52de0ad2022-01-28 01:02:16 -0800133ndk::ScopedAStatus RadioMessagingResponse::sendUssdResponse(const RadioResponseInfo& info) {
134 rspInfo = info;
135 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -0800136 return ndk::ScopedAStatus::ok();
137}
138
139ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastActivationResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -0800140 const RadioResponseInfo& info) {
141 rspInfo = info;
142 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -0800143 return ndk::ScopedAStatus::ok();
144}
145
146ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastConfigResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -0800147 const RadioResponseInfo& info) {
148 rspInfo = info;
149 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -0800150 return ndk::ScopedAStatus::ok();
151}
152
153ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastActivationResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -0800154 const RadioResponseInfo& info) {
155 rspInfo = info;
156 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -0800157 return ndk::ScopedAStatus::ok();
158}
159
160ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastConfigResponse(
Sarah Chin52de0ad2022-01-28 01:02:16 -0800161 const RadioResponseInfo& info) {
162 rspInfo = info;
163 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -0800164 return ndk::ScopedAStatus::ok();
165}
166
Sarah Chin52de0ad2022-01-28 01:02:16 -0800167ndk::ScopedAStatus RadioMessagingResponse::setSmscAddressResponse(const RadioResponseInfo& info) {
168 rspInfo = info;
169 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -0800170 return ndk::ScopedAStatus::ok();
171}
172
Sarah Chin52de0ad2022-01-28 01:02:16 -0800173ndk::ScopedAStatus RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& info,
Sarah Chind2a41192021-12-21 11:34:00 -0800174 int32_t /*index*/) {
Sarah Chin52de0ad2022-01-28 01:02:16 -0800175 rspInfo = info;
176 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -0800177 return ndk::ScopedAStatus::ok();
178}
179
Sarah Chin52de0ad2022-01-28 01:02:16 -0800180ndk::ScopedAStatus RadioMessagingResponse::writeSmsToSimResponse(const RadioResponseInfo& info,
Sarah Chind2a41192021-12-21 11:34:00 -0800181 int32_t /*index*/) {
Sarah Chin52de0ad2022-01-28 01:02:16 -0800182 rspInfo = info;
183 parent_messaging.notify(info.serial);
Sarah Chind2a41192021-12-21 11:34:00 -0800184 return ndk::ScopedAStatus::ok();
185}