diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp index 5fa11fca1c..f704520abf 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp @@ -416,6 +416,23 @@ TEST_F(RadioHidlTest, getCdmaSubscriptionSource) { } } +/* + * Test IRadio.setCdmaSubscriptionSource() for the response returned. + */ +TEST_F(RadioHidlTest, setCdmaSubscriptionSource) { + int serial = 1; + + radio->setCdmaSubscriptionSource(++serial, CdmaSubscriptionSource::RUIM_SIM); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type); + EXPECT_EQ(serial, radioRsp->rspInfo.serial); + + if (cardStatus.cardState == CardState::ABSENT) { + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::SIM_ABSENT + || radioRsp->rspInfo.error == RadioError::SUBSCRIPTION_NOT_AVAILABLE); + } +} + /* * Test IRadio.getVoiceRadioTechnology() for the response returned. */ @@ -455,7 +472,7 @@ TEST_F(RadioHidlTest, setCellInfoListRate) { int serial = 1; // TODO(sanketpadawe): RIL crashes with value of rate = 10 - radio->setCellInfoListRate(++serial, 0); + radio->setCellInfoListRate(++serial, 10); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type); EXPECT_EQ(serial, radioRsp->rspInfo.serial); diff --git a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp index 3638ccbd87..fa2871d593 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp @@ -28,8 +28,7 @@ TEST_F(RadioHidlTest, getCurrentCalls) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE - || radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS); + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); } } @@ -87,8 +86,7 @@ TEST_F(RadioHidlTest, hangupWaitingOrBackground) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS - || radioRsp->rspInfo.error == RadioError::INVALID_STATE + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE || radioRsp->rspInfo.error == RadioError::MODEM_ERR || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR); } @@ -106,8 +104,7 @@ TEST_F(RadioHidlTest, hangupForegroundResumeBackground) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS - || radioRsp->rspInfo.error == RadioError::INVALID_STATE + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE || radioRsp->rspInfo.error == RadioError::MODEM_ERR || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR); } @@ -125,8 +122,7 @@ TEST_F(RadioHidlTest, switchWaitingOrHoldingAndActive) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS - || radioRsp->rspInfo.error == RadioError::INVALID_STATE + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE || radioRsp->rspInfo.error == RadioError::MODEM_ERR || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR); } @@ -144,8 +140,7 @@ TEST_F(RadioHidlTest, conference) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS - || radioRsp->rspInfo.error == RadioError::INVALID_STATE + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE || radioRsp->rspInfo.error == RadioError::MODEM_ERR || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR); } @@ -163,8 +158,7 @@ TEST_F(RadioHidlTest, rejectCall) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS - || radioRsp->rspInfo.error == RadioError::INVALID_STATE + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE || radioRsp->rspInfo.error == RadioError::MODEM_ERR || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR); } @@ -182,8 +176,7 @@ TEST_F(RadioHidlTest, getLastCallFailCause) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS - || radioRsp->rspInfo.error == RadioError::NONE); + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); } } @@ -218,8 +211,7 @@ TEST_F(RadioHidlTest, cancelPendingUssd) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS - || radioRsp->rspInfo.error == RadioError::INVALID_STATE + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE || radioRsp->rspInfo.error == RadioError::MODEM_ERR || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR); } @@ -319,8 +311,7 @@ TEST_F(RadioHidlTest, acceptCall) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS - || radioRsp->rspInfo.error == RadioError::INVALID_STATE + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE || radioRsp->rspInfo.error == RadioError::MODEM_ERR || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR); } @@ -357,11 +348,30 @@ TEST_F(RadioHidlTest, explicitCallTransfer) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type); EXPECT_EQ(serial, radioRsp->rspInfo.serial); + if (cardStatus.cardState == CardState::ABSENT) { + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE + || radioRsp->rspInfo.error == RadioError::MODEM_ERR + || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR); + } +} + +/* + * Test IRadio.sendCDMAFeatureCode() for the response returned. + */ +TEST_F(RadioHidlTest, sendCDMAFeatureCode) { + int serial = 1; + + radio->sendCDMAFeatureCode(serial, hidl_string()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type); + EXPECT_EQ(serial, radioRsp->rspInfo.serial); + if (cardStatus.cardState == CardState::ABSENT) { ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS || radioRsp->rspInfo.error == RadioError::INVALID_STATE || radioRsp->rspInfo.error == RadioError::MODEM_ERR - || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR); + || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR + || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR); } } @@ -414,8 +424,7 @@ TEST_F(RadioHidlTest, stopDtmf) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS - || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::SYSTEM_ERR || radioRsp->rspInfo.error == RadioError::MODEM_ERR || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR); } @@ -450,8 +459,7 @@ TEST_F(RadioHidlTest, getMute) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS - || radioRsp->rspInfo.error == RadioError::NONE); + ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); } } diff --git a/radio/1.0/vts/functional/radio_response.cpp b/radio/1.0/vts/functional/radio_response.cpp index 87590036ee..c889a18ad7 100644 --- a/radio/1.0/vts/functional/radio_response.cpp +++ b/radio/1.0/vts/functional/radio_response.cpp @@ -496,7 +496,9 @@ Return RadioResponse::setLocationUpdatesResponse( return Void(); } -Return RadioResponse::setCdmaSubscriptionSourceResponse(const RadioResponseInfo& /*info*/) { +Return RadioResponse::setCdmaSubscriptionSourceResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent.notify(); return Void(); } @@ -539,7 +541,9 @@ Return RadioResponse::getPreferredVoicePrivacyResponse( return Void(); } -Return RadioResponse::sendCDMAFeatureCodeResponse(const RadioResponseInfo& /*info*/) { +Return RadioResponse::sendCDMAFeatureCodeResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent.notify(); return Void(); }