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_messaging_utils.h"
18
RadioMessagingResponse(RadioServiceTest & parent)19 RadioMessagingResponse::RadioMessagingResponse(RadioServiceTest& parent)
20 : parent_messaging(parent) {}
21
acknowledgeIncomingGsmSmsWithPduResponse(const RadioResponseInfo & info)22 ndk::ScopedAStatus RadioMessagingResponse::acknowledgeIncomingGsmSmsWithPduResponse(
23 const RadioResponseInfo& info) {
24 rspInfo = info;
25 parent_messaging.notify(info.serial);
26 return ndk::ScopedAStatus::ok();
27 }
28
acknowledgeLastIncomingCdmaSmsResponse(const RadioResponseInfo & info)29 ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingCdmaSmsResponse(
30 const RadioResponseInfo& info) {
31 rspInfo = info;
32 parent_messaging.notify(info.serial);
33 return ndk::ScopedAStatus::ok();
34 }
35
acknowledgeLastIncomingGsmSmsResponse(const RadioResponseInfo & info)36 ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingGsmSmsResponse(
37 const RadioResponseInfo& info) {
38 rspInfo = info;
39 parent_messaging.notify(info.serial);
40 return ndk::ScopedAStatus::ok();
41 }
42
acknowledgeRequest(int32_t)43 ndk::ScopedAStatus RadioMessagingResponse::acknowledgeRequest(int32_t /*serial*/) {
44 return ndk::ScopedAStatus::ok();
45 }
46
deleteSmsOnRuimResponse(const RadioResponseInfo & info)47 ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse(const RadioResponseInfo& info) {
48 rspInfo = info;
49 parent_messaging.notify(info.serial);
50 return ndk::ScopedAStatus::ok();
51 }
52
deleteSmsOnSimResponse(const RadioResponseInfo & info)53 ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse(const RadioResponseInfo& info) {
54 rspInfo = info;
55 parent_messaging.notify(info.serial);
56 return ndk::ScopedAStatus::ok();
57 }
58
getCdmaBroadcastConfigResponse(const RadioResponseInfo & info,const std::vector<CdmaBroadcastSmsConfigInfo> &)59 ndk::ScopedAStatus RadioMessagingResponse::getCdmaBroadcastConfigResponse(
60 const RadioResponseInfo& info, const std::vector<CdmaBroadcastSmsConfigInfo>& /*configs*/) {
61 rspInfo = info;
62 parent_messaging.notify(info.serial);
63 return ndk::ScopedAStatus::ok();
64 }
65
getGsmBroadcastConfigResponse(const RadioResponseInfo & info,const std::vector<GsmBroadcastSmsConfigInfo> &)66 ndk::ScopedAStatus RadioMessagingResponse::getGsmBroadcastConfigResponse(
67 const RadioResponseInfo& info, const std::vector<GsmBroadcastSmsConfigInfo>& /*configs*/) {
68 rspInfo = info;
69 parent_messaging.notify(info.serial);
70 return ndk::ScopedAStatus::ok();
71 }
72
getSmscAddressResponse(const RadioResponseInfo & info,const std::string &)73 ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& info,
74 const std::string& /*smsc*/) {
75 rspInfo = info;
76 parent_messaging.notify(info.serial);
77 return ndk::ScopedAStatus::ok();
78 }
79
reportSmsMemoryStatusResponse(const RadioResponseInfo & info)80 ndk::ScopedAStatus RadioMessagingResponse::reportSmsMemoryStatusResponse(
81 const RadioResponseInfo& info) {
82 rspInfo = info;
83 parent_messaging.notify(info.serial);
84 return ndk::ScopedAStatus::ok();
85 }
86
sendCdmaSmsExpectMoreResponse(const RadioResponseInfo & info,const SendSmsResult & sms)87 ndk::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
sendCdmaSmsResponse(const RadioResponseInfo & info,const SendSmsResult & sms)95 ndk::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
sendImsSmsResponse(const RadioResponseInfo & info,const SendSmsResult &)103 ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& info,
104 const SendSmsResult& /*sms*/) {
105 rspInfo = info;
106 parent_messaging.notify(info.serial);
107 return ndk::ScopedAStatus::ok();
108 }
109
sendSmsExpectMoreResponse(const RadioResponseInfo & info,const SendSmsResult & sms)110 ndk::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
sendSmsResponse(const RadioResponseInfo & info,const SendSmsResult & sms)118 ndk::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
setCdmaBroadcastActivationResponse(const RadioResponseInfo & info)126 ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastActivationResponse(
127 const RadioResponseInfo& info) {
128 rspInfo = info;
129 parent_messaging.notify(info.serial);
130 return ndk::ScopedAStatus::ok();
131 }
132
setCdmaBroadcastConfigResponse(const RadioResponseInfo & info)133 ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastConfigResponse(
134 const RadioResponseInfo& info) {
135 rspInfo = info;
136 parent_messaging.notify(info.serial);
137 return ndk::ScopedAStatus::ok();
138 }
139
setGsmBroadcastActivationResponse(const RadioResponseInfo & info)140 ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastActivationResponse(
141 const RadioResponseInfo& info) {
142 rspInfo = info;
143 parent_messaging.notify(info.serial);
144 return ndk::ScopedAStatus::ok();
145 }
146
setGsmBroadcastConfigResponse(const RadioResponseInfo & info)147 ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastConfigResponse(
148 const RadioResponseInfo& info) {
149 rspInfo = info;
150 parent_messaging.notify(info.serial);
151 return ndk::ScopedAStatus::ok();
152 }
153
setSmscAddressResponse(const RadioResponseInfo & info)154 ndk::ScopedAStatus RadioMessagingResponse::setSmscAddressResponse(const RadioResponseInfo& info) {
155 rspInfo = info;
156 parent_messaging.notify(info.serial);
157 return ndk::ScopedAStatus::ok();
158 }
159
writeSmsToRuimResponse(const RadioResponseInfo & info,int32_t)160 ndk::ScopedAStatus RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& info,
161 int32_t /*index*/) {
162 rspInfo = info;
163 parent_messaging.notify(info.serial);
164 return ndk::ScopedAStatus::ok();
165 }
166
writeSmsToSimResponse(const RadioResponseInfo & info,int32_t)167 ndk::ScopedAStatus RadioMessagingResponse::writeSmsToSimResponse(const RadioResponseInfo& info,
168 int32_t /*index*/) {
169 rspInfo = info;
170 parent_messaging.notify(info.serial);
171 return ndk::ScopedAStatus::ok();
172 }
173