blob: b646ef615a3b0d6ee313a8851b57c306ac473285 [file] [log] [blame]
Thomas Nguyen7ea5df62022-11-28 16:41:46 -08001/*
2 * Copyright (C) 2022 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 <aidl/android/hardware/radio/config/IRadioConfig.h>
Thomas Nguyen7ea5df62022-11-28 16:41:46 -080018#include <android/binder_manager.h>
19
20#include "radio_satellite_utils.h"
21
22#define ASSERT_OK(ret) ASSERT_TRUE(((ret).isOk()))
23
24void RadioSatelliteTest::SetUp() {
Sarah China1efe7a2023-05-02 21:11:41 -070025 RadioServiceTest::SetUp();
Thomas Nguyen7ea5df62022-11-28 16:41:46 -080026 std::string serviceName = GetParam();
27
28 if (!isServiceValidForDeviceConfiguration(serviceName)) {
29 ALOGI("Skipped the radio satellite tests due to device configuration.");
30 GTEST_SKIP();
31 }
32
Sarah China1efe7a2023-05-02 21:11:41 -070033 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) {
34 ALOGI("Skipping test because satellite is not supported in device.");
35 GTEST_SKIP();
36 }
37
Thomas Nguyen7ea5df62022-11-28 16:41:46 -080038 satellite = IRadioSatellite::fromBinder(
39 ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
40 ASSERT_NE(nullptr, satellite.get());
41
42 rsp_satellite = ndk::SharedRefBase::make<RadioSatelliteResponse>(*this);
43 ASSERT_NE(nullptr, rsp_satellite.get());
44
Thomas Nguyen7ea5df62022-11-28 16:41:46 -080045 ind_satellite = ndk::SharedRefBase::make<RadioSatelliteIndication>(*this);
46 ASSERT_NE(nullptr, ind_satellite.get());
47
48 satellite->setResponseFunctions(rsp_satellite, ind_satellite);
49
50 // Assert IRadioConfig exists before testing
51 radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder(
52 AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default")));
53 ASSERT_NE(nullptr, radio_config.get());
54}
55
56/*
57 * Test IRadioSatellite.getCapabilities() for the response returned.
58 */
59TEST_P(RadioSatelliteTest, getCapabilities) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -080060 serial = GetRandomSerialNumber();
61 ndk::ScopedAStatus res = satellite->getCapabilities(serial);
62 ASSERT_OK(res);
63 EXPECT_EQ(std::cv_status::no_timeout, wait());
64 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
65 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
66
67 ALOGI("getCapabilities, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
68
69 ASSERT_TRUE(CheckAnyOfErrors(
70 rsp_satellite->rspInfo.error,
71 {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
72 RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
73 RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
74 RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
75 RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
76 RadioError::SYSTEM_ERR}));
77}
78
79/*
80 * Test IRadioSatellite.setPower() for the response returned.
81 */
82TEST_P(RadioSatelliteTest, setPower) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -080083 serial = GetRandomSerialNumber();
84 ndk::ScopedAStatus res = satellite->setPower(serial, true);
85 ASSERT_OK(res);
86 EXPECT_EQ(std::cv_status::no_timeout, wait());
87 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
88 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
89
90 ALOGI("setPower, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
91
92 ASSERT_TRUE(CheckAnyOfErrors(
93 rsp_satellite->rspInfo.error,
94 {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
95 RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
96 RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
97 RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
98 RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
99 RadioError::SYSTEM_ERR}));
100}
101
102/*
103 * Test IRadioSatellite.getPowerSate() for the response returned.
104 */
105TEST_P(RadioSatelliteTest, getPowerSate) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800106 serial = GetRandomSerialNumber();
107 ndk::ScopedAStatus res = satellite->getPowerState(serial);
108 ASSERT_OK(res);
109 EXPECT_EQ(std::cv_status::no_timeout, wait());
110 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
111 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
112
Sarah China1efe7a2023-05-02 21:11:41 -0700113 ALOGI("getPowerState, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800114
115 ASSERT_TRUE(CheckAnyOfErrors(
116 rsp_satellite->rspInfo.error,
117 {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
118 RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
119 RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
120 RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
121 RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
122 RadioError::SYSTEM_ERR}));
123}
124
125/*
126 * Test IRadioSatellite.provisionService() for the response returned.
127 */
128TEST_P(RadioSatelliteTest, provisionService) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800129 serial = GetRandomSerialNumber();
130 std::string imei = "imei";
131 std::string msisdn = "msisdn";
132 std::string imsi = "imsi";
133 const std::vector<SatelliteFeature> features{
134 SatelliteFeature::SOS_SMS, SatelliteFeature::EMERGENCY_SMS, SatelliteFeature::SMS};
135 ndk::ScopedAStatus res = satellite->provisionService(serial, imei, msisdn, imsi, features);
136 ASSERT_OK(res);
137 EXPECT_EQ(std::cv_status::no_timeout, wait());
138 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
139 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
140
141 ALOGI("provisionService, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
142
143 ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error,
144 {RadioError::NONE,
145 RadioError::ABORTED,
146 RadioError::ACCESS_BARRED,
147 RadioError::CANCELLED,
148 RadioError::FEATURE_NOT_SUPPORTED,
149 RadioError::INTERNAL_ERR,
150 RadioError::INVALID_ARGUMENTS,
151 RadioError::INVALID_MODEM_STATE,
152 RadioError::INVALID_SIM_STATE,
153 RadioError::INVALID_STATE,
154 RadioError::MODEM_ERR,
155 RadioError::MODEM_INCOMPATIBLE,
156 RadioError::NETWORK_ERR,
157 RadioError::NETWORK_NOT_READY,
158 RadioError::NETWORK_REJECT,
159 RadioError::NETWORK_TIMEOUT,
160 RadioError::NO_MEMORY,
161 RadioError::NO_NETWORK_FOUND,
162 RadioError::NO_RESOURCES,
163 RadioError::NO_SATELLITE_SIGNAL,
164 RadioError::NO_SUBSCRIPTION,
165 RadioError::OPERATION_NOT_ALLOWED,
166 RadioError::RADIO_NOT_AVAILABLE,
167 RadioError::RADIO_TECHNOLOGY_NOT_SUPPORTED,
168 RadioError::REQUEST_NOT_SUPPORTED,
169 RadioError::REQUEST_RATE_LIMITED,
170 RadioError::SIM_ABSENT,
171 RadioError::SIM_BUSY,
172 RadioError::SIM_ERR,
173 RadioError::SIM_FULL,
174 RadioError::SUBSCRIBER_NOT_AUTHORIZED,
175 RadioError::SYSTEM_ERR}));
176}
177
178/*
179 * Test IRadioSatellite.addAllowedSatelliteContacts() for the response returned.
180 */
181TEST_P(RadioSatelliteTest, addAllowedSatelliteContacts) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800182 serial = GetRandomSerialNumber();
183 const std::vector<std::string> contacts = {"contact 1", "contact 2"};
184 ndk::ScopedAStatus res = satellite->addAllowedSatelliteContacts(serial, contacts);
185 ASSERT_OK(res);
186 EXPECT_EQ(std::cv_status::no_timeout, wait());
187 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
188 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
189
190 ALOGI("addAllowedSatelliteContacts, rspInfo.error = %s\n",
191 toString(rsp_satellite->rspInfo.error).c_str());
192
193 ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error,
194 {RadioError::NONE,
195 RadioError::ABORTED,
196 RadioError::ACCESS_BARRED,
197 RadioError::CANCELLED,
198 RadioError::INTERNAL_ERR,
199 RadioError::INVALID_ARGUMENTS,
200 RadioError::INVALID_CONTACT,
201 RadioError::INVALID_MODEM_STATE,
202 RadioError::INVALID_SIM_STATE,
203 RadioError::INVALID_STATE,
204 RadioError::MODEM_ERR,
205 RadioError::NETWORK_ERR,
206 RadioError::NETWORK_NOT_READY,
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800207 RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE,
208 RadioError::OPERATION_NOT_ALLOWED,
209 RadioError::RADIO_NOT_AVAILABLE,
210 RadioError::REQUEST_NOT_SUPPORTED,
211 RadioError::REQUEST_RATE_LIMITED,
212 RadioError::SIM_ABSENT,
213 RadioError::SIM_BUSY,
214 RadioError::SIM_ERR,
215 RadioError::SIM_FULL,
216 RadioError::SYSTEM_ERR,
217 RadioError::UNIDENTIFIED_SUBSCRIBER}));
218}
219
220/*
221 * Test IRadioSatellite.removeAllowedSatelliteContacts() for the response returned.
222 */
223TEST_P(RadioSatelliteTest, removeAllowedSatelliteContacts) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800224 serial = GetRandomSerialNumber();
225 const std::vector<std::string> contacts = {"contact 1", "contact 2"};
226 ndk::ScopedAStatus res = satellite->removeAllowedSatelliteContacts(serial, contacts);
227 ASSERT_OK(res);
228 EXPECT_EQ(std::cv_status::no_timeout, wait());
229 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
230 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
231
232 ALOGI("removeAllowedSatelliteContacts, rspInfo.error = %s\n",
233 toString(rsp_satellite->rspInfo.error).c_str());
234
235 ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error,
236 {RadioError::NONE,
237 RadioError::ABORTED,
238 RadioError::ACCESS_BARRED,
239 RadioError::CANCELLED,
240 RadioError::INTERNAL_ERR,
241 RadioError::INVALID_ARGUMENTS,
242 RadioError::INVALID_CONTACT,
243 RadioError::INVALID_MODEM_STATE,
244 RadioError::INVALID_SIM_STATE,
245 RadioError::INVALID_STATE,
246 RadioError::MODEM_ERR,
247 RadioError::NETWORK_ERR,
248 RadioError::NETWORK_NOT_READY,
249 RadioError::NETWORK_REJECT,
250 RadioError::NETWORK_TIMEOUT,
251 RadioError::NO_MEMORY,
252 RadioError::NO_NETWORK_FOUND,
253 RadioError::NO_RESOURCES,
254 RadioError::NO_SATELLITE_SIGNAL,
255 RadioError::NO_SUBSCRIPTION,
256 RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE,
257 RadioError::OPERATION_NOT_ALLOWED,
258 RadioError::RADIO_NOT_AVAILABLE,
259 RadioError::REQUEST_NOT_SUPPORTED,
260 RadioError::REQUEST_RATE_LIMITED,
261 RadioError::SIM_ABSENT,
262 RadioError::SIM_BUSY,
263 RadioError::SIM_ERR,
264 RadioError::SIM_FULL,
265 RadioError::SYSTEM_ERR,
266 RadioError::UNIDENTIFIED_SUBSCRIBER}));
267}
268
269/*
270 * Test IRadioSatellite.sendMessages() for the response returned.
271 */
272TEST_P(RadioSatelliteTest, sendMessages) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800273 serial = GetRandomSerialNumber();
274 const std::vector<std::string> messages = {"message 1", "message 2"};
275 std::string destination = "0123456789";
276 ndk::ScopedAStatus res = satellite->sendMessages(serial, messages, destination, 1.0, 2.0);
277 ASSERT_OK(res);
278 EXPECT_EQ(std::cv_status::no_timeout, wait());
279 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
280 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
281
282 ALOGI("sendMessages, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
283
284 ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error,
285 {RadioError::NONE,
286 RadioError::ABORTED,
287 RadioError::ACCESS_BARRED,
288 RadioError::BLOCKED_DUE_TO_CALL,
289 RadioError::CANCELLED,
290 RadioError::ENCODING_ERR,
291 RadioError::ENCODING_NOT_SUPPORTED,
292 RadioError::INTERNAL_ERR,
293 RadioError::INVALID_ARGUMENTS,
294 RadioError::INVALID_MODEM_STATE,
295 RadioError::INVALID_SIM_STATE,
296 RadioError::INVALID_SMS_FORMAT,
297 RadioError::INVALID_STATE,
298 RadioError::MODEM_ERR,
299 RadioError::NETWORK_ERR,
300 RadioError::NETWORK_NOT_READY,
301 RadioError::NETWORK_REJECT,
302 RadioError::NETWORK_TIMEOUT,
303 RadioError::NO_MEMORY,
304 RadioError::NO_NETWORK_FOUND,
305 RadioError::NO_RESOURCES,
306 RadioError::NO_SMS_TO_ACK,
307 RadioError::NO_SATELLITE_SIGNAL,
308 RadioError::NO_SUBSCRIPTION,
309 RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE,
310 RadioError::OPERATION_NOT_ALLOWED,
311 RadioError::RADIO_NOT_AVAILABLE,
312 RadioError::REQUEST_NOT_SUPPORTED,
313 RadioError::REQUEST_RATE_LIMITED,
314 RadioError::SIM_ABSENT,
315 RadioError::SIM_BUSY,
316 RadioError::SIM_ERR,
317 RadioError::SIM_FULL,
318 RadioError::SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED,
319 RadioError::SMS_SEND_FAIL_RETRY,
320 RadioError::SYSTEM_ERR,
321 RadioError::SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL,
322 RadioError::UNIDENTIFIED_SUBSCRIBER}));
323}
324
325/*
326 * Test IRadioSatellite.getPendingMessages() for the response returned.
327 */
328TEST_P(RadioSatelliteTest, getPendingMessages) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800329 serial = GetRandomSerialNumber();
330 ndk::ScopedAStatus res = satellite->getPendingMessages(serial);
331 ASSERT_OK(res);
332 EXPECT_EQ(std::cv_status::no_timeout, wait());
333 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
334 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
335
336 ALOGI("getPendingMessages, rspInfo.error = %s\n",
337 toString(rsp_satellite->rspInfo.error).c_str());
338
339 ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error,
340 {RadioError::NONE,
341 RadioError::ABORTED,
342 RadioError::ACCESS_BARRED,
343 RadioError::BLOCKED_DUE_TO_CALL,
344 RadioError::CANCELLED,
345 RadioError::ENCODING_ERR,
346 RadioError::ENCODING_NOT_SUPPORTED,
347 RadioError::INTERNAL_ERR,
348 RadioError::INVALID_ARGUMENTS,
349 RadioError::INVALID_MODEM_STATE,
350 RadioError::INVALID_SIM_STATE,
351 RadioError::INVALID_SMS_FORMAT,
352 RadioError::INVALID_STATE,
353 RadioError::MODEM_ERR,
354 RadioError::NETWORK_ERR,
355 RadioError::NETWORK_NOT_READY,
356 RadioError::NETWORK_REJECT,
357 RadioError::NETWORK_TIMEOUT,
358 RadioError::NO_MEMORY,
359 RadioError::NO_NETWORK_FOUND,
360 RadioError::NO_RESOURCES,
361 RadioError::NO_SMS_TO_ACK,
362 RadioError::NO_SATELLITE_SIGNAL,
363 RadioError::NO_SUBSCRIPTION,
364 RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE,
365 RadioError::OPERATION_NOT_ALLOWED,
366 RadioError::RADIO_NOT_AVAILABLE,
367 RadioError::REQUEST_NOT_SUPPORTED,
368 RadioError::REQUEST_RATE_LIMITED,
369 RadioError::SIM_ABSENT,
370 RadioError::SIM_BUSY,
371 RadioError::SIM_ERR,
372 RadioError::SIM_FULL,
373 RadioError::SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED,
374 RadioError::SYSTEM_ERR,
375 RadioError::SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL}));
376}
377
378/*
379 * Test IRadioSatellite.getSatelliteMode() for the response returned.
380 */
381TEST_P(RadioSatelliteTest, getSatelliteMode) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800382 serial = GetRandomSerialNumber();
383 ndk::ScopedAStatus res = satellite->getSatelliteMode(serial);
384 ASSERT_OK(res);
385 EXPECT_EQ(std::cv_status::no_timeout, wait());
386 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
387 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
388
389 ALOGI("getSatelliteMode, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str());
390
391 ASSERT_TRUE(CheckAnyOfErrors(
392 rsp_satellite->rspInfo.error,
393 {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
394 RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
395 RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
396 RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
397 RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
398 RadioError::SYSTEM_ERR}));
399}
400
401/*
402 * Test IRadioSatellite.setIndicationFilter() for the response returned.
403 */
404TEST_P(RadioSatelliteTest, setIndicationFilter) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800405 serial = GetRandomSerialNumber();
406 ndk::ScopedAStatus res = satellite->setIndicationFilter(serial, 0);
407 ASSERT_OK(res);
408 EXPECT_EQ(std::cv_status::no_timeout, wait());
409 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
410 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
411
412 ALOGI("setIndicationFilter, rspInfo.error = %s\n",
413 toString(rsp_satellite->rspInfo.error).c_str());
414
415 ASSERT_TRUE(CheckAnyOfErrors(
416 rsp_satellite->rspInfo.error,
417 {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
418 RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
419 RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
420 RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
421 RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
422 RadioError::SYSTEM_ERR}));
423}
424
425/*
426 * Test IRadioSatellite.startSendingSatellitePointingInfo() for the response returned.
427 */
428TEST_P(RadioSatelliteTest, startSendingSatellitePointingInfo) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800429 serial = GetRandomSerialNumber();
430 ndk::ScopedAStatus res = satellite->startSendingSatellitePointingInfo(serial);
431 ASSERT_OK(res);
432 EXPECT_EQ(std::cv_status::no_timeout, wait());
433 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
434 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
435
436 ALOGI("startSendingSatellitePointingInfo, rspInfo.error = %s\n",
437 toString(rsp_satellite->rspInfo.error).c_str());
438
439 ASSERT_TRUE(CheckAnyOfErrors(
440 rsp_satellite->rspInfo.error,
441 {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
442 RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
443 RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
444 RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
445 RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
446 RadioError::SYSTEM_ERR}));
447}
448
449/*
450 * Test IRadioSatellite.stopSatelliteLocationUpdate() for the response returned.
451 */
452TEST_P(RadioSatelliteTest, stopSatelliteLocationUpdate) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800453 serial = GetRandomSerialNumber();
454 ndk::ScopedAStatus res = satellite->stopSendingSatellitePointingInfo(serial);
455 ASSERT_OK(res);
456 EXPECT_EQ(std::cv_status::no_timeout, wait());
457 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
458 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
459
460 ALOGI("stopSendingSatellitePointingInfo, rspInfo.error = %s\n",
461 toString(rsp_satellite->rspInfo.error).c_str());
462
463 ASSERT_TRUE(CheckAnyOfErrors(
464 rsp_satellite->rspInfo.error,
465 {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
466 RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
467 RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
468 RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
469 RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
470 RadioError::SYSTEM_ERR}));
471}
472
473/*
474 * Test IRadioSatellite.getMaxCharactersPerTextMessage() for the response returned.
475 */
476TEST_P(RadioSatelliteTest, getMaxCharactersPerTextMessage) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800477 serial = GetRandomSerialNumber();
478 ndk::ScopedAStatus res = satellite->getMaxCharactersPerTextMessage(serial);
479 ASSERT_OK(res);
480 EXPECT_EQ(std::cv_status::no_timeout, wait());
481 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
482 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
483
484 ALOGI("getMaxCharactersPerTextMessage, rspInfo.error = %s\n",
485 toString(rsp_satellite->rspInfo.error).c_str());
486
487 ASSERT_TRUE(CheckAnyOfErrors(
488 rsp_satellite->rspInfo.error,
489 {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
490 RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
491 RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
492 RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
493 RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
494 RadioError::SYSTEM_ERR}));
495}
496
497/*
498 * Test IRadioSatellite.getTimeForNextSatelliteVisibility() for the response returned.
499 */
500TEST_P(RadioSatelliteTest, getTimeForNextSatelliteVisibility) {
Thomas Nguyen7ea5df62022-11-28 16:41:46 -0800501 serial = GetRandomSerialNumber();
502 ndk::ScopedAStatus res = satellite->getTimeForNextSatelliteVisibility(serial);
503 ASSERT_OK(res);
504 EXPECT_EQ(std::cv_status::no_timeout, wait());
505 EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type);
506 EXPECT_EQ(serial, rsp_satellite->rspInfo.serial);
507
508 ALOGI("getTimeForNextSatelliteVisibility, rspInfo.error = %s\n",
509 toString(rsp_satellite->rspInfo.error).c_str());
510
511 ASSERT_TRUE(CheckAnyOfErrors(
512 rsp_satellite->rspInfo.error,
513 {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS,
514 RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE,
515 RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
516 RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE,
517 RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED,
518 RadioError::SYSTEM_ERR}));
Sarah China1efe7a2023-05-02 21:11:41 -0700519}