From 21e28b71daa904e7110bada74c1559accd69a67a Mon Sep 17 00:00:00 2001 From: Jayachandran C Date: Wed, 3 May 2017 00:42:51 -0700 Subject: [PATCH] VTS: Fix IRadio.setAllowedCarriers and IRadio.nvResetConfig 1) IRadio.setAllowedCarriers Fix IRadio.setAllowedCarriers to pass no restrictions. Passing restrictions will block all other SIM cards until a new IRadio.setAllowedCarriers with no restriction is invoked. Even factory reset will not recover. 2) IRadio.nvResetConfig IRadio.nvResetConfig with ResetNvType RELOAD causes radio restart. All subsuquent scripts fail with cause RADIO_NOT_AVAILABLE. Fix to use ResetNvType ERASE which does not restart the radio. Test: VTS Bug: 37946160 Change-Id: Ib671758414cc97e1a596358306f89eed13918c48 --- .../vts/functional/radio_hidl_hal_misc.cpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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 d6ac9d616b..65b055ce91 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp @@ -556,7 +556,7 @@ TEST_F(RadioHidlTest, nvWriteCdmaPrl) { TEST_F(RadioHidlTest, nvResetConfig) { int serial = 1; - radio->nvResetConfig(++serial, ResetNvType::RELOAD); + radio->nvResetConfig(++serial, ResetNvType::ERASE); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type); EXPECT_EQ(serial, radioRsp->rspInfo.serial); @@ -733,6 +733,8 @@ TEST_F(RadioHidlTest, getModemActivityInfo) { TEST_F(RadioHidlTest, setAllowedCarriers) { int serial = 1; CarrierRestrictions carriers; + + /* Carrier restriction with one carrier */ memset(&carriers, 0, sizeof(carriers)); carriers.allowedCarriers.resize(1); carriers.excludedCarriers.resize(0); @@ -749,6 +751,20 @@ TEST_F(RadioHidlTest, setAllowedCarriers) { if (cardStatus.cardState == CardState::ABSENT) { ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); } + + /* Reset back to no carrier restriction */ + memset(&carriers, 0, sizeof(carriers)); + carriers.allowedCarriers.resize(0); + carriers.excludedCarriers.resize(0); + + radio->setAllowedCarriers(++serial, true, carriers); + 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::NONE); + } } /* @@ -816,4 +832,4 @@ TEST_F(RadioHidlTest, setSimCardPower) { ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE || radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED); } -} \ No newline at end of file +}