blob: e9b68cc465ea2c215f2ba777e8221e63b3f47dbb [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
Sarah Chin912bdf32022-01-28 01:02:16 -080017#include <aidl/android/hardware/radio/RadioConst.h>
Sarah Chinfc5603b2021-12-21 11:34:00 -080018#include <aidl/android/hardware/radio/config/IRadioConfig.h>
Sarah Chinfc5603b2021-12-21 11:34:00 -080019#include <android/binder_manager.h>
20
21#include "radio_sim_utils.h"
22
23#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
24
25void RadioSimTest::SetUp() {
Sarah China1efe7a2023-05-02 21:11:41 -070026 RadioServiceTest::SetUp();
Sarah Chinfc5603b2021-12-21 11:34:00 -080027 std::string serviceName = GetParam();
28
29 if (!isServiceValidForDeviceConfiguration(serviceName)) {
30 ALOGI("Skipped the test due to device configuration.");
31 GTEST_SKIP();
32 }
33
34 radio_sim = IRadioSim::fromBinder(
35 ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
36 ASSERT_NE(nullptr, radio_sim.get());
37
38 radioRsp_sim = ndk::SharedRefBase::make<RadioSimResponse>(*this);
39 ASSERT_NE(nullptr, radioRsp_sim.get());
40
Sarah Chinfc5603b2021-12-21 11:34:00 -080041 radioInd_sim = ndk::SharedRefBase::make<RadioSimIndication>(*this);
42 ASSERT_NE(nullptr, radioInd_sim.get());
43
44 radio_sim->setResponseFunctions(radioRsp_sim, radioInd_sim);
Sarah Chinc83bce42021-12-29 00:35:12 -080045 // Assert SIM is present before testing
46 updateSimCardStatus();
47 EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState);
Sarah Chinfc5603b2021-12-21 11:34:00 -080048
49 // Assert IRadioConfig exists before testing
Sarah Chinc83bce42021-12-29 00:35:12 -080050 radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder(
51 AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default")));
52 ASSERT_NE(nullptr, radio_config.get());
Sarah Chinfc5603b2021-12-21 11:34:00 -080053}
54
Sarah Chinc83bce42021-12-29 00:35:12 -080055void RadioSimTest::updateSimCardStatus() {
Sarah Chinfc5603b2021-12-21 11:34:00 -080056 serial = GetRandomSerialNumber();
57 radio_sim->getIccCardStatus(serial);
58 EXPECT_EQ(std::cv_status::no_timeout, wait());
Sarah Chinc83bce42021-12-29 00:35:12 -080059 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
60 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
61 EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
Sarah Chinfc5603b2021-12-21 11:34:00 -080062}
63
64/*
65 * Test IRadioSim.setSimCardPower() for the response returned.
66 */
67TEST_P(RadioSimTest, setSimCardPower) {
joonhunshind519aea2023-10-31 03:06:54 +000068 if (telephony_flags::enforce_telephony_feature_mapping()) {
69 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
70 GTEST_SKIP() << "Skipping setSimCardPower "
71 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
72 }
73 }
74
Sarah Chinfc5603b2021-12-21 11:34:00 -080075 /* Test setSimCardPower power down */
76 serial = GetRandomSerialNumber();
77 radio_sim->setSimCardPower(serial, CardPowerState::POWER_DOWN);
78 EXPECT_EQ(std::cv_status::no_timeout, wait());
79 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
80 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
81 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
82 {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
83 RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ERR}));
84
85 // setSimCardPower does not return until the request is handled, and should not trigger
86 // CardStatus::STATE_ABSENT when turning off power
87 if (radioRsp_sim->rspInfo.error == RadioError::NONE) {
88 /* Wait some time for setting sim power down and then verify it */
89 updateSimCardStatus();
90 // We cannot assert the consistency of CardState here due to b/203031664
91 // EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState);
92 // applications should be an empty vector of AppStatus
93 EXPECT_EQ(0, cardStatus.applications.size());
94 }
95
96 // Give some time for modem to fully power down the SIM card
97 sleep(MODEM_SET_SIM_POWER_DELAY_IN_SECONDS);
98
99 /* Test setSimCardPower power up */
100 serial = GetRandomSerialNumber();
101 radio_sim->setSimCardPower(serial, CardPowerState::POWER_UP);
102 EXPECT_EQ(std::cv_status::no_timeout, wait());
103 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
104 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
105 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
106 {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
107 RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ERR}));
108
109 // Give some time for modem to fully power up the SIM card
110 sleep(MODEM_SET_SIM_POWER_DELAY_IN_SECONDS);
111
112 // setSimCardPower does not return until the request is handled. Just verify that we still
113 // have CardStatus::STATE_PRESENT after turning the power back on
114 if (radioRsp_sim->rspInfo.error == RadioError::NONE) {
115 updateSimCardStatus();
Tim Lin8a6a1d32022-03-31 21:06:57 +0800116 updateSimSlotStatus(cardStatus.slotMap.physicalSlotId);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800117 EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState);
sandeepjs5561b4b2022-02-15 11:41:28 +0000118 EXPECT_EQ(CardStatus::STATE_PRESENT, slotStatus.cardState);
119 if (CardStatus::STATE_PRESENT == slotStatus.cardState) {
120 ASSERT_TRUE(slotStatus.portInfo[0].portActive);
sandeepjsbaa9f952024-07-11 14:57:08 +0000121 if (cardStatus.supportedMepMode == aidl::android::hardware::radio::config::
122 MultipleEnabledProfilesMode::MEP_A1 ||
123 cardStatus.supportedMepMode == aidl::android::hardware::radio::config::
124 MultipleEnabledProfilesMode::MEP_A2) {
125 EXPECT_EQ(1, cardStatus.slotMap.portId);
126 } else {
127 EXPECT_EQ(0, cardStatus.slotMap.portId);
128 }
sandeepjs5561b4b2022-02-15 11:41:28 +0000129 }
Sarah Chinfc5603b2021-12-21 11:34:00 -0800130 }
131}
132
133/*
134 * Test IRadioSim.setCarrierInfoForImsiEncryption() for the response returned.
135 */
136TEST_P(RadioSimTest, setCarrierInfoForImsiEncryption) {
joonhunshind519aea2023-10-31 03:06:54 +0000137 if (telephony_flags::enforce_telephony_feature_mapping()) {
138 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
139 GTEST_SKIP() << "Skipping setCarrierInfoForImsiEncryption "
140 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
141 }
142 }
143
Sarah Chinfc5603b2021-12-21 11:34:00 -0800144 serial = GetRandomSerialNumber();
145 ImsiEncryptionInfo imsiInfo;
146 imsiInfo.mcc = "310";
147 imsiInfo.mnc = "004";
148 imsiInfo.carrierKey = (std::vector<uint8_t>){1, 2, 3, 4, 5, 6};
149 imsiInfo.keyIdentifier = "Test";
150 imsiInfo.expirationTime = 20180101;
151 imsiInfo.keyType = ImsiEncryptionInfo::PUBLIC_KEY_TYPE_EPDG;
152
153 radio_sim->setCarrierInfoForImsiEncryption(serial, imsiInfo);
154 EXPECT_EQ(std::cv_status::no_timeout, wait());
155 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
156 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
157
158 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
159 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
160 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
161 }
162}
163
164/*
165 * Test IRadioSim.getSimPhonebookRecords() for the response returned.
166 */
167TEST_P(RadioSimTest, getSimPhonebookRecords) {
joonhunshind519aea2023-10-31 03:06:54 +0000168 if (telephony_flags::enforce_telephony_feature_mapping()) {
169 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
170 GTEST_SKIP() << "Skipping getSimPhonebookRecords "
171 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
172 }
173 }
174
Sarah Chinfc5603b2021-12-21 11:34:00 -0800175 serial = GetRandomSerialNumber();
176 radio_sim->getSimPhonebookRecords(serial);
177 EXPECT_EQ(std::cv_status::no_timeout, wait());
178 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
179 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
180 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
181 ASSERT_TRUE(
182 CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
183 {RadioError::INVALID_SIM_STATE, RadioError::RADIO_NOT_AVAILABLE,
184 RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS,
185 RadioError::REQUEST_NOT_SUPPORTED},
186 CHECK_GENERAL_ERROR));
187 } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
188 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
189 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED},
190 CHECK_GENERAL_ERROR));
191 }
192}
193
194/*
195 * Test IRadioSim.getSimPhonebookCapacity for the response returned.
196 */
197TEST_P(RadioSimTest, getSimPhonebookCapacity) {
joonhunshind519aea2023-10-31 03:06:54 +0000198 if (telephony_flags::enforce_telephony_feature_mapping()) {
199 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
200 GTEST_SKIP() << "Skipping getSimPhonebookCapacity "
201 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
202 }
203 }
204
Sarah Chinfc5603b2021-12-21 11:34:00 -0800205 serial = GetRandomSerialNumber();
206 radio_sim->getSimPhonebookCapacity(serial);
207 EXPECT_EQ(std::cv_status::no_timeout, wait());
208 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
209 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
210 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
211 ASSERT_TRUE(
212 CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
213 {RadioError::INVALID_SIM_STATE, RadioError::RADIO_NOT_AVAILABLE,
214 RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS,
215 RadioError::REQUEST_NOT_SUPPORTED},
216 CHECK_GENERAL_ERROR));
217 } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
218 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
219 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED},
220 CHECK_GENERAL_ERROR));
221
222 PhonebookCapacity pbCapacity = radioRsp_sim->capacity;
223 if (pbCapacity.maxAdnRecords > 0) {
224 EXPECT_TRUE(pbCapacity.maxNameLen > 0 && pbCapacity.maxNumberLen > 0);
225 EXPECT_TRUE(pbCapacity.usedAdnRecords <= pbCapacity.maxAdnRecords);
226 }
227
228 if (pbCapacity.maxEmailRecords > 0) {
229 EXPECT_TRUE(pbCapacity.maxEmailLen > 0);
230 EXPECT_TRUE(pbCapacity.usedEmailRecords <= pbCapacity.maxEmailRecords);
231 }
232
233 if (pbCapacity.maxAdditionalNumberRecords > 0) {
234 EXPECT_TRUE(pbCapacity.maxAdditionalNumberLen > 0);
235 EXPECT_TRUE(pbCapacity.usedAdditionalNumberRecords <=
236 pbCapacity.maxAdditionalNumberRecords);
237 }
238 }
239}
240
241/*
242 * Test IRadioSim.updateSimPhonebookRecords() for the response returned.
243 */
244TEST_P(RadioSimTest, updateSimPhonebookRecords) {
joonhunshind519aea2023-10-31 03:06:54 +0000245 if (telephony_flags::enforce_telephony_feature_mapping()) {
246 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
247 GTEST_SKIP() << "Skipping updateSimPhonebookRecords "
248 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
249 }
250 }
251
Sarah Chinfc5603b2021-12-21 11:34:00 -0800252 serial = GetRandomSerialNumber();
253 radio_sim->getSimPhonebookCapacity(serial);
254 EXPECT_EQ(std::cv_status::no_timeout, wait());
255 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
256 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
257 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
258 ASSERT_TRUE(
259 CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
260 {RadioError::INVALID_SIM_STATE, RadioError::RADIO_NOT_AVAILABLE,
261 RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS,
262 RadioError::REQUEST_NOT_SUPPORTED},
263 CHECK_GENERAL_ERROR));
264 } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
265 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
266 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED},
267 CHECK_GENERAL_ERROR));
268 PhonebookCapacity pbCapacity = radioRsp_sim->capacity;
269
270 serial = GetRandomSerialNumber();
271 radio_sim->getSimPhonebookRecords(serial);
272
273 EXPECT_EQ(std::cv_status::no_timeout, wait());
274 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
275 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
276 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
277 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED},
278 CHECK_GENERAL_ERROR));
279
280 if (pbCapacity.maxAdnRecords > 0 && pbCapacity.usedAdnRecords < pbCapacity.maxAdnRecords) {
281 // Add a phonebook record
282 PhonebookRecordInfo recordInfo;
283 recordInfo.recordId = 0;
284 recordInfo.name = "ABC";
285 recordInfo.number = "1234567890";
286 serial = GetRandomSerialNumber();
287 radio_sim->updateSimPhonebookRecords(serial, recordInfo);
288
289 EXPECT_EQ(std::cv_status::no_timeout, wait());
290 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
291 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
292 EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
293 int index = radioRsp_sim->updatedRecordIndex;
294 EXPECT_TRUE(index > 0);
295
296 // Deleted a phonebook record
297 recordInfo.recordId = index;
298 recordInfo.name = "";
299 recordInfo.number = "";
300 serial = GetRandomSerialNumber();
301 radio_sim->updateSimPhonebookRecords(serial, recordInfo);
302
303 EXPECT_EQ(std::cv_status::no_timeout, wait());
304 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
305 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
306 EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
307 }
308 }
309}
Sarah Chin912bdf32022-01-28 01:02:16 -0800310
311/*
312 * Test IRadioSim.enableUiccApplications() for the response returned.
313 * For SIM ABSENT case.
314 */
315TEST_P(RadioSimTest, togglingUiccApplicationsSimAbsent) {
joonhunshind519aea2023-10-31 03:06:54 +0000316 if (telephony_flags::enforce_telephony_feature_mapping()) {
317 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
318 GTEST_SKIP() << "Skipping togglingUiccApplicationsSimAbsent "
319 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
320 }
321 }
322
Sarah Chin912bdf32022-01-28 01:02:16 -0800323 // This test case only test SIM ABSENT case.
324 if (cardStatus.cardState != CardStatus::STATE_ABSENT) return;
325
326 // Disable Uicc applications.
327 serial = GetRandomSerialNumber();
328 radio_sim->enableUiccApplications(serial, false);
329 EXPECT_EQ(std::cv_status::no_timeout, wait());
330 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
331 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
332 // As SIM is absent, RadioError::SIM_ABSENT should be thrown.
333 EXPECT_EQ(RadioError::SIM_ABSENT, radioRsp_sim->rspInfo.error);
334
335 // Query Uicc application enablement.
336 serial = GetRandomSerialNumber();
337 radio_sim->areUiccApplicationsEnabled(serial);
338 EXPECT_EQ(std::cv_status::no_timeout, wait());
339 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
340 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
341 // As SIM is absent, RadioError::SIM_ABSENT should be thrown.
342 EXPECT_EQ(RadioError::SIM_ABSENT, radioRsp_sim->rspInfo.error);
343}
344
345/*
346 * Test IRadioSim.enableUiccApplications() for the response returned.
347 * For SIM PRESENT case.
348 */
349TEST_P(RadioSimTest, togglingUiccApplicationsSimPresent) {
joonhunshind519aea2023-10-31 03:06:54 +0000350 if (telephony_flags::enforce_telephony_feature_mapping()) {
351 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
352 GTEST_SKIP() << "Skipping togglingUiccApplicationsSimPresent "
353 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
354 }
355 }
356
Sarah Chin912bdf32022-01-28 01:02:16 -0800357 // This test case only test SIM ABSENT case.
358 if (cardStatus.cardState != CardStatus::STATE_PRESENT) return;
359 if (cardStatus.applications.size() == 0) return;
360
361 // Disable Uicc applications.
362 serial = GetRandomSerialNumber();
363 radio_sim->enableUiccApplications(serial, false);
364 EXPECT_EQ(std::cv_status::no_timeout, wait());
365 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
366 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
367 // As SIM is present, there shouldn't be error.
368 EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
369
370 // Query Uicc application enablement.
371 serial = GetRandomSerialNumber();
372 radio_sim->areUiccApplicationsEnabled(serial);
373 EXPECT_EQ(std::cv_status::no_timeout, wait());
374 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
375 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
376 // As SIM is present, there shouldn't be error.
377 EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
378 ASSERT_FALSE(radioRsp_sim->areUiccApplicationsEnabled);
379
380 // Enable Uicc applications.
381 serial = GetRandomSerialNumber();
382 radio_sim->enableUiccApplications(serial, true);
383 EXPECT_EQ(std::cv_status::no_timeout, wait());
384 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
385 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
386 // As SIM is present, there shouldn't be error.
387 EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
388
389 // Query Uicc application enablement.
390 serial = GetRandomSerialNumber();
391 radio_sim->areUiccApplicationsEnabled(serial);
392 EXPECT_EQ(std::cv_status::no_timeout, wait());
393 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
394 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
395 // As SIM is present, there shouldn't be error.
396 EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
397 ASSERT_TRUE(radioRsp_sim->areUiccApplicationsEnabled);
398}
399
400/*
401 * Test IRadioSim.areUiccApplicationsEnabled() for the response returned.
402 */
403TEST_P(RadioSimTest, areUiccApplicationsEnabled) {
joonhunshind519aea2023-10-31 03:06:54 +0000404 if (telephony_flags::enforce_telephony_feature_mapping()) {
405 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
406 GTEST_SKIP() << "Skipping areUiccApplicationsEnabled "
407 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
408 }
409 }
410
Sarah Chin912bdf32022-01-28 01:02:16 -0800411 // Disable Uicc applications.
412 serial = GetRandomSerialNumber();
413 radio_sim->areUiccApplicationsEnabled(serial);
414 EXPECT_EQ(std::cv_status::no_timeout, wait());
415 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
416 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
417
418 // If SIM is absent, RadioError::SIM_ABSENT should be thrown. Otherwise there shouldn't be any
419 // error.
420 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
421 EXPECT_EQ(RadioError::SIM_ABSENT, radioRsp_sim->rspInfo.error);
422 } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
423 EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
424 }
425}
426
427/*
428 * Test IRadioSim.getAllowedCarriers() for the response returned.
429 */
430TEST_P(RadioSimTest, getAllowedCarriers) {
joonhunshind519aea2023-10-31 03:06:54 +0000431 if (telephony_flags::enforce_telephony_feature_mapping()) {
432 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
433 GTEST_SKIP() << "Skipping getAllowedCarriers "
434 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
435 }
436 }
437
Sarah Chin912bdf32022-01-28 01:02:16 -0800438 serial = GetRandomSerialNumber();
439
440 radio_sim->getAllowedCarriers(serial);
441 EXPECT_EQ(std::cv_status::no_timeout, wait());
442 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
443 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
444
445 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
446 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
447}
448
449/**
450 * Test IRadioSim.setAllowedCarriers() for the response returned.
451 */
452TEST_P(RadioSimTest, setAllowedCarriers) {
joonhunshind519aea2023-10-31 03:06:54 +0000453 if (telephony_flags::enforce_telephony_feature_mapping()) {
454 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
455 GTEST_SKIP() << "Skipping setAllowedCarriers "
456 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
457 }
458 }
459
Sarah Chin912bdf32022-01-28 01:02:16 -0800460 serial = GetRandomSerialNumber();
461 CarrierRestrictions carrierRestrictions;
462 memset(&carrierRestrictions, 0, sizeof(carrierRestrictions));
463 carrierRestrictions.allowedCarriers.resize(1);
464 carrierRestrictions.excludedCarriers.resize(0);
465 carrierRestrictions.allowedCarriers[0].mcc = std::string("123");
466 carrierRestrictions.allowedCarriers[0].mnc = std::string("456");
467 carrierRestrictions.allowedCarriers[0].matchType = Carrier::MATCH_TYPE_ALL;
468 carrierRestrictions.allowedCarriers[0].matchData = std::string();
Sarah Chin912bdf32022-01-28 01:02:16 -0800469 carrierRestrictions.allowedCarriersPrioritized = true;
470 SimLockMultiSimPolicy multisimPolicy = SimLockMultiSimPolicy::NO_MULTISIM_POLICY;
471
472 radio_sim->setAllowedCarriers(serial, carrierRestrictions, multisimPolicy);
473 EXPECT_EQ(std::cv_status::no_timeout, wait());
474 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
475 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
476
477 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
478 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
479
480 if (radioRsp_sim->rspInfo.error == RadioError::NONE) {
481 /* Verify the update of the SIM status. This might need some time */
482 if (cardStatus.cardState != CardStatus::STATE_ABSENT) {
483 updateSimCardStatus();
484 auto startTime = std::chrono::system_clock::now();
485 while (cardStatus.cardState != CardStatus::STATE_RESTRICTED &&
486 std::chrono::duration_cast<std::chrono::seconds>(
487 std::chrono::system_clock::now() - startTime)
488 .count() < 30) {
489 /* Set 2 seconds as interval to check card status */
490 sleep(2);
491 updateSimCardStatus();
492 }
Sarah Chin0623bdd2022-02-16 11:09:26 -0800493 // TODO: uncomment once CF fully supports setAllowedCarriers
494 // EXPECT_EQ(CardStatus::STATE_RESTRICTED, cardStatus.cardState);
Sarah Chin912bdf32022-01-28 01:02:16 -0800495 }
496
497 /* Verify that configuration was set correctly, retrieving it from the modem */
498 serial = GetRandomSerialNumber();
499
500 radio_sim->getAllowedCarriers(serial);
501 EXPECT_EQ(std::cv_status::no_timeout, wait());
502 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
503 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
504 EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
505
506 EXPECT_EQ(1, radioRsp_sim->carrierRestrictionsResp.allowedCarriers.size());
507 EXPECT_EQ(0, radioRsp_sim->carrierRestrictionsResp.excludedCarriers.size());
508 ASSERT_TRUE(std::string("123") ==
509 radioRsp_sim->carrierRestrictionsResp.allowedCarriers[0].mcc);
510 ASSERT_TRUE(std::string("456") ==
511 radioRsp_sim->carrierRestrictionsResp.allowedCarriers[0].mnc);
512 EXPECT_EQ(Carrier::MATCH_TYPE_ALL,
513 radioRsp_sim->carrierRestrictionsResp.allowedCarriers[0].matchType);
514 ASSERT_TRUE(radioRsp_sim->carrierRestrictionsResp.allowedCarriersPrioritized);
515 EXPECT_EQ(SimLockMultiSimPolicy::NO_MULTISIM_POLICY, radioRsp_sim->multiSimPolicyResp);
516
517 sleep(10);
518
519 /**
520 * Another test case of the API to cover to allow carrier.
521 * If the API is supported, this is also used to reset to no carrier restriction
522 * status for cardStatus.
523 */
524 memset(&carrierRestrictions, 0, sizeof(carrierRestrictions));
525 carrierRestrictions.allowedCarriers.resize(0);
526 carrierRestrictions.excludedCarriers.resize(0);
527 carrierRestrictions.allowedCarriersPrioritized = false;
528
529 serial = GetRandomSerialNumber();
530 radio_sim->setAllowedCarriers(serial, carrierRestrictions, multisimPolicy);
531 EXPECT_EQ(std::cv_status::no_timeout, wait());
532 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
533 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
534
535 EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
536
537 if (cardStatus.cardState != CardStatus::STATE_ABSENT) {
538 /* Resetting back to no carrier restriction needs some time */
539 updateSimCardStatus();
540 auto startTime = std::chrono::system_clock::now();
541 while (cardStatus.cardState == CardStatus::STATE_RESTRICTED &&
542 std::chrono::duration_cast<std::chrono::seconds>(
543 std::chrono::system_clock::now() - startTime)
544 .count() < 10) {
545 /* Set 2 seconds as interval to check card status */
546 sleep(2);
547 updateSimCardStatus();
548 }
549 EXPECT_NE(CardStatus::STATE_RESTRICTED, cardStatus.cardState);
550 sleep(10);
551 }
552 }
553}
554
555/*
556 * Test IRadioSim.getIccCardStatus() for the response returned.
557 */
558TEST_P(RadioSimTest, getIccCardStatus) {
joonhunshind519aea2023-10-31 03:06:54 +0000559 if (telephony_flags::enforce_telephony_feature_mapping()) {
560 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
561 GTEST_SKIP() << "Skipping getIccCardStatus "
562 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
563 }
564 }
565
Sarah Chin912bdf32022-01-28 01:02:16 -0800566 EXPECT_LE(cardStatus.applications.size(), RadioConst::CARD_MAX_APPS);
567 EXPECT_LT(cardStatus.gsmUmtsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS);
568 EXPECT_LT(cardStatus.cdmaSubscriptionAppIndex, RadioConst::CARD_MAX_APPS);
569 EXPECT_LT(cardStatus.imsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS);
Sarah Chin912bdf32022-01-28 01:02:16 -0800570}
571
572/*
573 * Test IRadioSim.supplyIccPinForApp() for the response returned
574 */
575TEST_P(RadioSimTest, supplyIccPinForApp) {
joonhunshind519aea2023-10-31 03:06:54 +0000576 if (telephony_flags::enforce_telephony_feature_mapping()) {
577 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
578 GTEST_SKIP() << "Skipping supplyIccPinForApp "
579 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
580 }
581 }
582
Sarah Chin912bdf32022-01-28 01:02:16 -0800583 serial = GetRandomSerialNumber();
584
585 // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
586 // 3GPP2 apps only
587 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
588 if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
589 cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
590 cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
591 cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
592 radio_sim->supplyIccPinForApp(serial, std::string("test1"),
593 cardStatus.applications[i].aidPtr);
594 EXPECT_EQ(std::cv_status::no_timeout, wait());
595 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
596 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
597 ASSERT_TRUE(CheckAnyOfErrors(
598 radioRsp_sim->rspInfo.error,
599 {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED}));
600 }
601 }
Sarah Chin912bdf32022-01-28 01:02:16 -0800602}
603
604/*
605 * Test IRadioSim.supplyIccPukForApp() for the response returned.
606 */
607TEST_P(RadioSimTest, supplyIccPukForApp) {
joonhunshind519aea2023-10-31 03:06:54 +0000608 if (telephony_flags::enforce_telephony_feature_mapping()) {
609 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
610 GTEST_SKIP() << "Skipping supplyIccPukForApp "
611 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
612 }
613 }
614
Sarah Chin912bdf32022-01-28 01:02:16 -0800615 serial = GetRandomSerialNumber();
616
617 // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
618 // 3GPP2 apps only
619 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
620 if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
621 cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
622 cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
623 cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
624 radio_sim->supplyIccPukForApp(serial, std::string("test1"), std::string("test2"),
625 cardStatus.applications[i].aidPtr);
626 EXPECT_EQ(std::cv_status::no_timeout, wait());
627 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
628 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
629 ASSERT_TRUE(CheckAnyOfErrors(
630 radioRsp_sim->rspInfo.error,
631 {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE}));
632 }
633 }
Sarah Chin912bdf32022-01-28 01:02:16 -0800634}
635
636/*
637 * Test IRadioSim.supplyIccPin2ForApp() for the response returned.
638 */
639TEST_P(RadioSimTest, supplyIccPin2ForApp) {
joonhunshind519aea2023-10-31 03:06:54 +0000640 if (telephony_flags::enforce_telephony_feature_mapping()) {
641 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
642 GTEST_SKIP() << "Skipping supplyIccPin2ForApp "
643 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
644 }
645 }
646
Sarah Chin912bdf32022-01-28 01:02:16 -0800647 serial = GetRandomSerialNumber();
648
649 // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
650 // 3GPP2 apps only
651 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
652 if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
653 cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
654 cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
655 cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
656 radio_sim->supplyIccPin2ForApp(serial, std::string("test1"),
657 cardStatus.applications[i].aidPtr);
658 EXPECT_EQ(std::cv_status::no_timeout, wait());
659 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
660 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
661 ASSERT_TRUE(
662 CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
663 {RadioError::PASSWORD_INCORRECT,
664 RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_PUK2}));
665 }
666 }
Sarah Chin912bdf32022-01-28 01:02:16 -0800667}
668
669/*
670 * Test IRadioSim.supplyIccPuk2ForApp() for the response returned.
671 */
672TEST_P(RadioSimTest, supplyIccPuk2ForApp) {
joonhunshind519aea2023-10-31 03:06:54 +0000673 if (telephony_flags::enforce_telephony_feature_mapping()) {
674 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
675 GTEST_SKIP() << "Skipping supplyIccPuk2ForApp "
676 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
677 }
678 }
679
Sarah Chin912bdf32022-01-28 01:02:16 -0800680 serial = GetRandomSerialNumber();
681
682 // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
683 // 3GPP2 apps only
684 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
685 if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
686 cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
687 cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
688 cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
689 radio_sim->supplyIccPuk2ForApp(serial, std::string("test1"), std::string("test2"),
690 cardStatus.applications[i].aidPtr);
691 EXPECT_EQ(std::cv_status::no_timeout, wait());
692 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
693 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
694 ASSERT_TRUE(CheckAnyOfErrors(
695 radioRsp_sim->rspInfo.error,
696 {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE}));
697 }
698 }
Sarah Chin912bdf32022-01-28 01:02:16 -0800699}
700
701/*
702 * Test IRadioSim.changeIccPinForApp() for the response returned.
703 */
704TEST_P(RadioSimTest, changeIccPinForApp) {
joonhunshind519aea2023-10-31 03:06:54 +0000705 if (telephony_flags::enforce_telephony_feature_mapping()) {
706 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
707 GTEST_SKIP() << "Skipping changeIccPinForApp "
708 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
709 }
710 }
711
Sarah Chin912bdf32022-01-28 01:02:16 -0800712 serial = GetRandomSerialNumber();
713
714 // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
715 // 3GPP2 apps only
716 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
717 if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
718 cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
719 cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
720 cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
721 radio_sim->changeIccPinForApp(serial, std::string("test1"), std::string("test2"),
722 cardStatus.applications[i].aidPtr);
723 EXPECT_EQ(std::cv_status::no_timeout, wait());
724 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
725 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
726 ASSERT_TRUE(CheckAnyOfErrors(
727 radioRsp_sim->rspInfo.error,
728 {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED}));
729 }
730 }
Sarah Chin912bdf32022-01-28 01:02:16 -0800731}
732
733/*
734 * Test IRadioSim.changeIccPin2ForApp() for the response returned.
735 */
736TEST_P(RadioSimTest, changeIccPin2ForApp) {
joonhunshind519aea2023-10-31 03:06:54 +0000737 if (telephony_flags::enforce_telephony_feature_mapping()) {
738 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
739 GTEST_SKIP() << "Skipping changeIccPin2ForApp "
740 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
741 }
742 }
743
Sarah Chin912bdf32022-01-28 01:02:16 -0800744 serial = GetRandomSerialNumber();
745
746 // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
747 // 3GPP2 apps only
748 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
749 if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
750 cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
751 cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
752 cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
753 radio_sim->changeIccPin2ForApp(serial, std::string("test1"), std::string("test2"),
754 cardStatus.applications[i].aidPtr);
755 EXPECT_EQ(std::cv_status::no_timeout, wait());
756 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
757 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
758 ASSERT_TRUE(
759 CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
760 {RadioError::PASSWORD_INCORRECT,
761 RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_PUK2}));
762 }
763 }
Sarah Chin912bdf32022-01-28 01:02:16 -0800764}
765
766/*
Sarah Chin912bdf32022-01-28 01:02:16 -0800767 * Test IRadioSim.getImsiForApp() for the response returned.
768 */
Sarah Chinca421a62022-01-28 15:54:36 -0800769TEST_P(RadioSimTest, getImsiForApp) {
joonhunshind519aea2023-10-31 03:06:54 +0000770 if (telephony_flags::enforce_telephony_feature_mapping()) {
771 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
772 GTEST_SKIP() << "Skipping getImsiForApp "
773 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
774 }
775 }
776
Sarah Chin912bdf32022-01-28 01:02:16 -0800777 serial = GetRandomSerialNumber();
778
779 // Check success returned while getting imsi for 3GPP and 3GPP2 apps only
780 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
781 if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
782 cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
783 cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
784 cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
785 radio_sim->getImsiForApp(serial, cardStatus.applications[i].aidPtr);
786 EXPECT_EQ(std::cv_status::no_timeout, wait());
787 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
788 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
789 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, {RadioError::NONE},
790 CHECK_GENERAL_ERROR));
791
792 // IMSI (MCC+MNC+MSIN) is at least 6 digits, but not more than 15
793 if (radioRsp_sim->rspInfo.error == RadioError::NONE) {
794 EXPECT_NE(radioRsp_sim->imsi, std::string());
795 EXPECT_GE((int)(radioRsp_sim->imsi).size(), 6);
796 EXPECT_LE((int)(radioRsp_sim->imsi).size(), 15);
797 }
798 }
799 }
Sarah Chin912bdf32022-01-28 01:02:16 -0800800}
801
802/*
803 * Test IRadioSim.iccIoForApp() for the response returned.
804 */
805TEST_P(RadioSimTest, iccIoForApp) {
joonhunshind519aea2023-10-31 03:06:54 +0000806 if (telephony_flags::enforce_telephony_feature_mapping()) {
807 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
808 GTEST_SKIP() << "Skipping iccIoForApp "
809 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
810 }
811 }
812
Sarah Chin912bdf32022-01-28 01:02:16 -0800813 serial = GetRandomSerialNumber();
814
815 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
816 IccIo iccIo;
817 iccIo.command = 0xc0;
818 iccIo.fileId = 0x6f11;
819 iccIo.path = std::string("3F007FFF");
820 iccIo.p1 = 0;
821 iccIo.p2 = 0;
822 iccIo.p3 = 0;
823 iccIo.data = std::string();
824 iccIo.pin2 = std::string();
825 iccIo.aid = cardStatus.applications[i].aidPtr;
826
827 radio_sim->iccIoForApp(serial, iccIo);
828 EXPECT_EQ(std::cv_status::no_timeout, wait());
829 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
830 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
831 }
Sarah Chin912bdf32022-01-28 01:02:16 -0800832}
833
834/*
835 * Test IRadioSim.iccTransmitApduBasicChannel() for the response returned.
836 */
837TEST_P(RadioSimTest, iccTransmitApduBasicChannel) {
joonhunshind519aea2023-10-31 03:06:54 +0000838 if (telephony_flags::enforce_telephony_feature_mapping()) {
839 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
840 GTEST_SKIP() << "Skipping iccTransmitApduBasicChannel "
841 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
842 }
843 }
844
Sarah Chin912bdf32022-01-28 01:02:16 -0800845 serial = GetRandomSerialNumber();
846 SimApdu msg;
847 memset(&msg, 0, sizeof(msg));
848 msg.data = std::string();
849
850 radio_sim->iccTransmitApduBasicChannel(serial, msg);
851 EXPECT_EQ(std::cv_status::no_timeout, wait());
852 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
853 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
Sarah Chin912bdf32022-01-28 01:02:16 -0800854}
855
856/*
857 * Test IRadioSim.iccOpenLogicalChannel() for the response returned.
858 */
859TEST_P(RadioSimTest, iccOpenLogicalChannel) {
joonhunshind519aea2023-10-31 03:06:54 +0000860 if (telephony_flags::enforce_telephony_feature_mapping()) {
861 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
862 GTEST_SKIP() << "Skipping iccOpenLogicalChannel "
863 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
864 }
865 }
866
Sarah Chin912bdf32022-01-28 01:02:16 -0800867 serial = GetRandomSerialNumber();
868 int p2 = 0x04;
869 // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
870 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
871 radio_sim->iccOpenLogicalChannel(serial, cardStatus.applications[i].aidPtr, p2);
872 EXPECT_EQ(std::cv_status::no_timeout, wait());
873 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
874 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
875 }
Sarah Chin912bdf32022-01-28 01:02:16 -0800876}
877
878/*
879 * Test IRadioSim.iccCloseLogicalChannel() for the response returned.
880 */
881TEST_P(RadioSimTest, iccCloseLogicalChannel) {
joonhunshind519aea2023-10-31 03:06:54 +0000882 if (telephony_flags::enforce_telephony_feature_mapping()) {
883 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
884 GTEST_SKIP() << "Skipping iccCloseLogicalChannel "
885 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
886 }
887 }
888
Sarah Chin912bdf32022-01-28 01:02:16 -0800889 serial = GetRandomSerialNumber();
890 // Try closing invalid channel and check INVALID_ARGUMENTS returned as error
891 radio_sim->iccCloseLogicalChannel(serial, 0);
892 EXPECT_EQ(std::cv_status::no_timeout, wait());
893 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
894 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
895
896 EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp_sim->rspInfo.error);
Sarah Chin912bdf32022-01-28 01:02:16 -0800897}
898
899/*
Muralidhar Reddyc13d0d62023-01-18 18:45:14 +0000900 * Test IRadioSim.iccCloseLogicalChannelWithSessionInfo() for the response returned.
901 */
902TEST_P(RadioSimTest, iccCloseLogicalChannelWithSessionInfo) {
joonhunshind519aea2023-10-31 03:06:54 +0000903 if (telephony_flags::enforce_telephony_feature_mapping()) {
904 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
905 GTEST_SKIP() << "Skipping iccCloseLogicalChannelWithSessionInfo "
906 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
907 }
908 }
909
Muralidhar Reddyeb1c6172023-04-12 12:55:19 +0000910 int32_t aidl_version;
911 ndk::ScopedAStatus aidl_status = radio_sim->getInterfaceVersion(&aidl_version);
912 ASSERT_OK(aidl_status);
913 if (aidl_version < 2) {
914 ALOGI("Skipped the test since"
915 " iccCloseLogicalChannelWithSessionInfo is not supported on version < 2");
916 GTEST_SKIP();
917 }
Muralidhar Reddyc13d0d62023-01-18 18:45:14 +0000918 serial = GetRandomSerialNumber();
919 SessionInfo info;
920 memset(&info, 0, sizeof(info));
921 info.sessionId = 0;
922 info.isEs10 = false;
923
924 // Try closing invalid channel and check INVALID_ARGUMENTS returned as error
925 radio_sim->iccCloseLogicalChannelWithSessionInfo(serial, info);
926 EXPECT_EQ(std::cv_status::no_timeout, wait());
927 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
928 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
929
930 EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp_sim->rspInfo.error);
Muralidhar Reddyc13d0d62023-01-18 18:45:14 +0000931}
932
933/*
Sarah Chin912bdf32022-01-28 01:02:16 -0800934 * Test IRadioSim.iccTransmitApduLogicalChannel() for the response returned.
935 */
936TEST_P(RadioSimTest, iccTransmitApduLogicalChannel) {
joonhunshind519aea2023-10-31 03:06:54 +0000937 if (telephony_flags::enforce_telephony_feature_mapping()) {
938 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
939 GTEST_SKIP() << "Skipping iccTransmitApduLogicalChannel "
940 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
941 }
942 }
943
Sarah Chin912bdf32022-01-28 01:02:16 -0800944 serial = GetRandomSerialNumber();
945 SimApdu msg;
946 memset(&msg, 0, sizeof(msg));
947 msg.data = std::string();
948
949 radio_sim->iccTransmitApduLogicalChannel(serial, msg);
950 EXPECT_EQ(std::cv_status::no_timeout, wait());
951 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
952 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
Sarah Chin912bdf32022-01-28 01:02:16 -0800953}
954
955/*
956 * Test IRadioSim.requestIccSimAuthentication() for the response returned.
957 */
958TEST_P(RadioSimTest, requestIccSimAuthentication) {
joonhunshind519aea2023-10-31 03:06:54 +0000959 if (telephony_flags::enforce_telephony_feature_mapping()) {
960 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
961 GTEST_SKIP() << "Skipping requestIccSimAuthentication "
962 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
963 }
964 }
965
Sarah Chin912bdf32022-01-28 01:02:16 -0800966 serial = GetRandomSerialNumber();
967
968 // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS
969 // or REQUEST_NOT_SUPPORTED returned as error.
970 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
971 radio_sim->requestIccSimAuthentication(serial, 0, std::string("test"),
972 cardStatus.applications[i].aidPtr);
973 EXPECT_EQ(std::cv_status::no_timeout, wait());
974 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
975 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
976 ASSERT_TRUE(CheckAnyOfErrors(
977 radioRsp_sim->rspInfo.error,
978 {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
979 }
Sarah Chin912bdf32022-01-28 01:02:16 -0800980}
981
982/*
983 * Test IRadioSim.getFacilityLockForApp() for the response returned.
984 */
985TEST_P(RadioSimTest, getFacilityLockForApp) {
joonhunshind519aea2023-10-31 03:06:54 +0000986 if (telephony_flags::enforce_telephony_feature_mapping()) {
987 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
988 GTEST_SKIP() << "Skipping getFacilityLockForApp "
989 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
990 }
991 }
992
Sarah Chin912bdf32022-01-28 01:02:16 -0800993 serial = GetRandomSerialNumber();
994 std::string facility = "";
995 std::string password = "";
996 int32_t serviceClass = 1;
997 std::string appId = "";
998
999 radio_sim->getFacilityLockForApp(serial, facility, password, serviceClass, appId);
1000
1001 EXPECT_EQ(std::cv_status::no_timeout, wait());
1002 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
1003 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
1004
1005 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
1006 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
1007 {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR},
1008 CHECK_GENERAL_ERROR));
1009 }
1010}
1011
1012/*
1013 * Test IRadioSim.setFacilityLockForApp() for the response returned.
1014 */
1015TEST_P(RadioSimTest, setFacilityLockForApp) {
joonhunshind519aea2023-10-31 03:06:54 +00001016 if (telephony_flags::enforce_telephony_feature_mapping()) {
1017 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
1018 GTEST_SKIP() << "Skipping setFacilityLockForApp "
1019 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
1020 }
1021 }
1022
Sarah Chin912bdf32022-01-28 01:02:16 -08001023 serial = GetRandomSerialNumber();
1024 std::string facility = "";
1025 bool lockState = false;
1026 std::string password = "";
1027 int32_t serviceClass = 1;
1028 std::string appId = "";
1029
1030 radio_sim->setFacilityLockForApp(serial, facility, lockState, password, serviceClass, appId);
1031
1032 EXPECT_EQ(std::cv_status::no_timeout, wait());
1033 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
1034 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
1035
1036 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
1037 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
1038 {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR},
1039 CHECK_GENERAL_ERROR));
1040 }
1041}
1042
1043/*
1044 * Test IRadioSim.getCdmaSubscription() for the response returned.
1045 */
1046TEST_P(RadioSimTest, getCdmaSubscription) {
joonhunshind519aea2023-10-31 03:06:54 +00001047 if (telephony_flags::enforce_telephony_feature_mapping()) {
1048 if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
1049 GTEST_SKIP() << "Skipping getCdmaSubscription "
1050 "due to undefined FEATURE_TELEPHONY_CDMA";
1051 }
1052 }
1053
Sarah Chin912bdf32022-01-28 01:02:16 -08001054 serial = GetRandomSerialNumber();
1055
1056 radio_sim->getCdmaSubscription(serial);
1057 EXPECT_EQ(std::cv_status::no_timeout, wait());
1058 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
1059 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
1060
1061 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
1062 ASSERT_TRUE(CheckAnyOfErrors(
1063 radioRsp_sim->rspInfo.error,
1064 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT}));
1065 }
Sarah Chin912bdf32022-01-28 01:02:16 -08001066}
1067
1068/*
1069 * Test IRadioSim.getCdmaSubscriptionSource() for the response returned.
1070 */
1071TEST_P(RadioSimTest, getCdmaSubscriptionSource) {
joonhunshind519aea2023-10-31 03:06:54 +00001072 if (telephony_flags::enforce_telephony_feature_mapping()) {
1073 if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
1074 GTEST_SKIP() << "Skipping getCdmaSubscriptionSource "
1075 "due to undefined FEATURE_TELEPHONY_CDMA";
1076 }
1077 }
1078
Sarah Chin912bdf32022-01-28 01:02:16 -08001079 serial = GetRandomSerialNumber();
1080
1081 radio_sim->getCdmaSubscriptionSource(serial);
1082 EXPECT_EQ(std::cv_status::no_timeout, wait());
1083 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
1084 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
1085
1086 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
1087 ASSERT_TRUE(CheckAnyOfErrors(
1088 radioRsp_sim->rspInfo.error,
1089 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT}));
1090 }
Sarah Chin912bdf32022-01-28 01:02:16 -08001091}
1092
1093/*
1094 * Test IRadioSim.setCdmaSubscriptionSource() for the response returned.
1095 */
1096TEST_P(RadioSimTest, setCdmaSubscriptionSource) {
joonhunshind519aea2023-10-31 03:06:54 +00001097 if (telephony_flags::enforce_telephony_feature_mapping()) {
1098 if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
1099 GTEST_SKIP() << "Skipping setCdmaSubscriptionSource "
1100 "due to undefined FEATURE_TELEPHONY_CDMA";
1101 }
1102 }
1103
Sarah Chin912bdf32022-01-28 01:02:16 -08001104 serial = GetRandomSerialNumber();
1105
1106 radio_sim->setCdmaSubscriptionSource(serial, CdmaSubscriptionSource::RUIM_SIM);
1107 EXPECT_EQ(std::cv_status::no_timeout, wait());
1108 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
1109 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
1110
1111 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
1112 ASSERT_TRUE(CheckAnyOfErrors(
1113 radioRsp_sim->rspInfo.error,
1114 {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::SUBSCRIPTION_NOT_AVAILABLE},
1115 CHECK_GENERAL_ERROR));
1116 }
Sarah Chin912bdf32022-01-28 01:02:16 -08001117}
1118
1119/*
1120 * Test IRadioSim.setUiccSubscription() for the response returned.
1121 */
1122TEST_P(RadioSimTest, setUiccSubscription) {
joonhunshind519aea2023-10-31 03:06:54 +00001123 if (telephony_flags::enforce_telephony_feature_mapping()) {
1124 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
1125 GTEST_SKIP() << "Skipping setUiccSubscription "
1126 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
1127 }
1128 }
1129
Sarah Chin912bdf32022-01-28 01:02:16 -08001130 serial = GetRandomSerialNumber();
1131 SelectUiccSub item;
1132 memset(&item, 0, sizeof(item));
1133
1134 radio_sim->setUiccSubscription(serial, item);
1135 EXPECT_EQ(std::cv_status::no_timeout, wait());
1136 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
1137 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
1138
1139 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
1140 ASSERT_TRUE(
1141 CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
1142 {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
1143 RadioError::MODEM_ERR, RadioError::SUBSCRIPTION_NOT_SUPPORTED},
1144 CHECK_GENERAL_ERROR));
1145 }
Sarah Chin912bdf32022-01-28 01:02:16 -08001146}
1147
1148/*
1149 * Test IRadioSim.sendEnvelope() for the response returned.
1150 */
1151TEST_P(RadioSimTest, sendEnvelope) {
joonhunshind519aea2023-10-31 03:06:54 +00001152 if (telephony_flags::enforce_telephony_feature_mapping()) {
1153 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
1154 GTEST_SKIP() << "Skipping sendEnvelope "
1155 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
1156 }
1157 }
1158
Sarah Chin912bdf32022-01-28 01:02:16 -08001159 serial = GetRandomSerialNumber();
1160
1161 // Test with sending empty string
1162 std::string content = "";
1163
1164 radio_sim->sendEnvelope(serial, content);
1165
1166 EXPECT_EQ(std::cv_status::no_timeout, wait());
1167 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
1168 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
1169
1170 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
1171 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
1172 {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
1173 RadioError::MODEM_ERR, RadioError::SIM_ABSENT},
1174 CHECK_GENERAL_ERROR));
1175 }
Sarah Chin912bdf32022-01-28 01:02:16 -08001176}
1177
1178/*
1179 * Test IRadioSim.sendTerminalResponseToSim() for the response returned.
1180 */
1181TEST_P(RadioSimTest, sendTerminalResponseToSim) {
joonhunshind519aea2023-10-31 03:06:54 +00001182 if (telephony_flags::enforce_telephony_feature_mapping()) {
1183 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
1184 GTEST_SKIP() << "Skipping sendTerminalResponseToSim "
1185 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
1186 }
1187 }
1188
Sarah Chin912bdf32022-01-28 01:02:16 -08001189 serial = GetRandomSerialNumber();
1190
1191 // Test with sending empty string
1192 std::string commandResponse = "";
1193
1194 radio_sim->sendTerminalResponseToSim(serial, commandResponse);
1195
1196 EXPECT_EQ(std::cv_status::no_timeout, wait());
1197 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
1198 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
1199
1200 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
1201 ASSERT_TRUE(CheckAnyOfErrors(
1202 radioRsp_sim->rspInfo.error,
1203 {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::SIM_ABSENT},
1204 CHECK_GENERAL_ERROR));
1205 }
Sarah Chin912bdf32022-01-28 01:02:16 -08001206}
1207
1208/*
1209 * Test IRadioSim.reportStkServiceIsRunning() for the response returned.
1210 */
1211TEST_P(RadioSimTest, reportStkServiceIsRunning) {
joonhunshind519aea2023-10-31 03:06:54 +00001212 if (telephony_flags::enforce_telephony_feature_mapping()) {
1213 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
1214 GTEST_SKIP() << "Skipping reportStkServiceIsRunning "
1215 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
1216 }
1217 }
1218
Sarah Chin912bdf32022-01-28 01:02:16 -08001219 serial = GetRandomSerialNumber();
1220
1221 radio_sim->reportStkServiceIsRunning(serial);
1222
1223 EXPECT_EQ(std::cv_status::no_timeout, wait());
1224 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
1225 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
1226
1227 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
1228 ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, {RadioError::NONE},
1229 CHECK_GENERAL_ERROR));
1230 }
Sarah Chin912bdf32022-01-28 01:02:16 -08001231}
1232
1233/*
1234 * Test IRadioSim.sendEnvelopeWithStatus() for the response returned with empty
1235 * string.
1236 */
1237TEST_P(RadioSimTest, sendEnvelopeWithStatus) {
joonhunshind519aea2023-10-31 03:06:54 +00001238 if (telephony_flags::enforce_telephony_feature_mapping()) {
1239 if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
1240 GTEST_SKIP() << "Skipping sendEnvelopeWithStatus "
1241 "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
1242 }
1243 }
1244
Sarah Chin912bdf32022-01-28 01:02:16 -08001245 serial = GetRandomSerialNumber();
1246
1247 // Test with sending empty string
1248 std::string contents = "";
1249
1250 radio_sim->sendEnvelopeWithStatus(serial, contents);
1251
1252 EXPECT_EQ(std::cv_status::no_timeout, wait());
1253 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
1254 EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
1255
1256 if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
1257 ASSERT_TRUE(CheckAnyOfErrors(
1258 radioRsp_sim->rspInfo.error,
1259 {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR, RadioError::SIM_ABSENT},
1260 CHECK_GENERAL_ERROR));
1261 }
Sarah Chin912bdf32022-01-28 01:02:16 -08001262}