2 * Copyright (C) 2017 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include <radio_hidl_hal_utils_v1_1.h>
20 * Test IRadio.setSimCardPower() for the response returned.
22 TEST_F(RadioHidlTest_v1_1, setSimCardPower_1_1) {
23 int serial = GetRandomSerialNumber();
25 radio_v1_1->setSimCardPower_1_1(serial, CardPowerState::POWER_DOWN);
26 EXPECT_EQ(std::cv_status::no_timeout, wait());
27 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
28 EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
30 if (cardStatus.cardState == CardState::ABSENT) {
31 ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::NONE ||
32 radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED ||
33 radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
34 radioRsp_v1_1->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE);