blob: 49c08061acab2762a52aac0a13ee5343fd7906a7 [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_messaging_utils.h"
18
Sarah Chinc83bce42021-12-29 00:35:12 -080019RadioMessagingResponse::RadioMessagingResponse(RadioServiceTest& parent)
Sarah Chinfc5603b2021-12-21 11:34:00 -080020 : parent_messaging(parent) {}
21
22ndk::ScopedAStatus RadioMessagingResponse::acknowledgeIncomingGsmSmsWithPduResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080023 const RadioResponseInfo& info) {
24 rspInfo = info;
25 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080026 return ndk::ScopedAStatus::ok();
27}
28
29ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingCdmaSmsResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080030 const RadioResponseInfo& info) {
31 rspInfo = info;
32 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080033 return ndk::ScopedAStatus::ok();
34}
35
36ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingGsmSmsResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080037 const RadioResponseInfo& info) {
38 rspInfo = info;
39 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-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
Sarah Chin912bdf32022-01-28 01:02:16 -080047ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse(const RadioResponseInfo& info) {
48 rspInfo = info;
49 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080050 return ndk::ScopedAStatus::ok();
51}
52
Sarah Chin912bdf32022-01-28 01:02:16 -080053ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse(const RadioResponseInfo& info) {
54 rspInfo = info;
55 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080056 return ndk::ScopedAStatus::ok();
57}
58
59ndk::ScopedAStatus RadioMessagingResponse::getCdmaBroadcastConfigResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080060 const RadioResponseInfo& info, const std::vector<CdmaBroadcastSmsConfigInfo>& /*configs*/) {
61 rspInfo = info;
62 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080063 return ndk::ScopedAStatus::ok();
64}
65
66ndk::ScopedAStatus RadioMessagingResponse::getGsmBroadcastConfigResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080067 const RadioResponseInfo& info, const std::vector<GsmBroadcastSmsConfigInfo>& /*configs*/) {
68 rspInfo = info;
69 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080070 return ndk::ScopedAStatus::ok();
71}
72
Sarah Chin912bdf32022-01-28 01:02:16 -080073ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -080074 const std::string& /*smsc*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -080075 rspInfo = info;
76 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080077 return ndk::ScopedAStatus::ok();
78}
79
80ndk::ScopedAStatus RadioMessagingResponse::reportSmsMemoryStatusResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080081 const RadioResponseInfo& info) {
82 rspInfo = info;
83 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080084 return ndk::ScopedAStatus::ok();
85}
86
87ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsExpectMoreResponse(
88 const RadioResponseInfo& info, const SendSmsResult& sms) {
89 rspInfo = info;
90 sendSmsResult = sms;
91 parent_messaging.notify(info.serial);
92 return ndk::ScopedAStatus::ok();
93}
94
95ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsResponse(const RadioResponseInfo& info,
96 const SendSmsResult& sms) {
97 rspInfo = info;
98 sendSmsResult = sms;
99 parent_messaging.notify(info.serial);
100 return ndk::ScopedAStatus::ok();
101}
102
Sarah Chin912bdf32022-01-28 01:02:16 -0800103ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -0800104 const SendSmsResult& /*sms*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -0800105 rspInfo = info;
106 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800107 return ndk::ScopedAStatus::ok();
108}
109
110ndk::ScopedAStatus RadioMessagingResponse::sendSmsExpectMoreResponse(const RadioResponseInfo& info,
111 const SendSmsResult& sms) {
112 rspInfo = info;
113 sendSmsResult = sms;
114 parent_messaging.notify(info.serial);
115 return ndk::ScopedAStatus::ok();
116}
117
118ndk::ScopedAStatus RadioMessagingResponse::sendSmsResponse(const RadioResponseInfo& info,
119 const SendSmsResult& sms) {
120 rspInfo = info;
121 sendSmsResult = sms;
122 parent_messaging.notify(info.serial);
123 return ndk::ScopedAStatus::ok();
124}
125
Sarah Chinfc5603b2021-12-21 11:34:00 -0800126ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastActivationResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800127 const RadioResponseInfo& info) {
128 rspInfo = info;
129 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800130 return ndk::ScopedAStatus::ok();
131}
132
133ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastConfigResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800134 const RadioResponseInfo& info) {
135 rspInfo = info;
136 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800137 return ndk::ScopedAStatus::ok();
138}
139
140ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastActivationResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800141 const RadioResponseInfo& info) {
142 rspInfo = info;
143 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800144 return ndk::ScopedAStatus::ok();
145}
146
147ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastConfigResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -0800148 const RadioResponseInfo& info) {
149 rspInfo = info;
150 parent_messaging.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 RadioMessagingResponse::setSmscAddressResponse(const RadioResponseInfo& info) {
155 rspInfo = info;
156 parent_messaging.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 RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -0800161 int32_t /*index*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -0800162 rspInfo = info;
163 parent_messaging.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 RadioMessagingResponse::writeSmsToSimResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -0800168 int32_t /*index*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -0800169 rspInfo = info;
170 parent_messaging.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800171 return ndk::ScopedAStatus::ok();
172}