diff --git a/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp b/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
index 8c4ccf6..2c1eb60 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
@@ -22,7 +22,7 @@
  * Test IRadio.setGsmBroadcastConfig() for the response returned.
  */
 TEST_F(RadioHidlTest, setGsmBroadcastConfig) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Create GsmBroadcastSmsConfigInfo #1
     GsmBroadcastSmsConfigInfo gbSmsConfig1;
@@ -85,7 +85,7 @@
  * Test IRadio.getGsmBroadcastConfig() for the response returned.
  */
 TEST_F(RadioHidlTest, getGsmBroadcastConfig) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getGsmBroadcastConfig(serial);
 
@@ -105,7 +105,7 @@
  * Test IRadio.setCdmaBroadcastConfig() for the response returned.
  */
 TEST_F(RadioHidlTest, setCdmaBroadcastConfig) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     CdmaBroadcastSmsConfigInfo cbSmsConfig;
     cbSmsConfig.serviceCategory = 4096;
@@ -132,7 +132,7 @@
  * Test IRadio.getCdmaBroadcastConfig() for the response returned.
  */
 TEST_F(RadioHidlTest, getCdmaBroadcastConfig) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getCdmaBroadcastConfig(serial);
 
@@ -150,7 +150,7 @@
  * Test IRadio.setCdmaBroadcastActivation() for the response returned.
  */
 TEST_F(RadioHidlTest, setCdmaBroadcastActivation) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     bool activate = false;
 
     radio->setCdmaBroadcastActivation(serial, activate);
@@ -170,7 +170,7 @@
  * Test IRadio.setGsmBroadcastActivation() for the response returned.
  */
 TEST_F(RadioHidlTest, setGsmBroadcastActivation) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     bool activate = false;
 
     radio->setGsmBroadcastActivation(serial, activate);
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
index 9496688..4f10f11 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
@@ -22,7 +22,7 @@
  * Test IRadio.getDataRegistrationState() for the response returned.
  */
 TEST_F(RadioHidlTest, getDataRegistrationState) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getDataRegistrationState(serial);
 
@@ -39,7 +39,7 @@
  * Test IRadio.setupDataCall() for the response returned.
  */
 TEST_F(RadioHidlTest, setupDataCall) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     RadioTechnology radioTechnology = RadioTechnology::LTE;
 
@@ -70,7 +70,7 @@
     radio->setupDataCall(serial, radioTechnology, dataProfileInfo, modemCognitive, roamingAllowed,
                          isRoaming);
 
-    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(std::cv_status::no_timeout, wait(300));
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
@@ -87,7 +87,7 @@
  * Test IRadio.deactivateDataCall() for the response returned.
  */
 TEST_F(RadioHidlTest, deactivateDataCall) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     int cid = 1;
     bool reasonRadioShutDown = false;
 
@@ -109,7 +109,7 @@
  * Test IRadio.getDataCallList() for the response returned.
  */
 TEST_F(RadioHidlTest, getDataCallList) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getDataCallList(serial);
 
@@ -128,7 +128,7 @@
  * Test IRadio.setInitialAttachApn() for the response returned.
  */
 TEST_F(RadioHidlTest, setInitialAttachApn) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     DataProfileInfo dataProfileInfo;
     memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
@@ -171,7 +171,7 @@
  * Test IRadio.setDataAllowed() for the response returned.
  */
 TEST_F(RadioHidlTest, setDataAllowed) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     bool allow = true;
 
     radio->setDataAllowed(serial, allow);
@@ -189,7 +189,7 @@
  * Test IRadio.setDataProfile() for the response returned.
  */
 TEST_F(RadioHidlTest, setDataProfile) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Create a dataProfileInfo
     DataProfileInfo dataProfileInfo;
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
index e6c8934..e6837ce 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
@@ -30,7 +30,7 @@
  * Test IRadio.supplyIccPinForApp() for the response returned
  */
 TEST_F(RadioHidlTest, supplyIccPinForApp) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
     // 3GPP2 apps only
@@ -53,7 +53,7 @@
  * Test IRadio.supplyIccPukForApp() for the response returned.
  */
 TEST_F(RadioHidlTest, supplyIccPukForApp) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
     // 3GPP2 apps only
@@ -76,7 +76,7 @@
  * Test IRadio.supplyIccPin2ForApp() for the response returned.
  */
 TEST_F(RadioHidlTest, supplyIccPin2ForApp) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
     // 3GPP2 apps only
@@ -99,7 +99,7 @@
  * Test IRadio.supplyIccPuk2ForApp() for the response returned.
  */
 TEST_F(RadioHidlTest, supplyIccPuk2ForApp) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
     // 3GPP2 apps only
@@ -122,7 +122,7 @@
  * Test IRadio.changeIccPinForApp() for the response returned.
  */
 TEST_F(RadioHidlTest, changeIccPinForApp) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
     // 3GPP2 apps only
@@ -145,7 +145,7 @@
  * Test IRadio.changeIccPin2ForApp() for the response returned.
  */
 TEST_F(RadioHidlTest, changeIccPin2ForApp) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
     // 3GPP2 apps only
@@ -168,7 +168,7 @@
  * Test IRadio.getImsiForApp() for the response returned.
  */
 TEST_F(RadioHidlTest, getImsiForApp) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Check success returned while getting imsi for 3GPP and 3GPP2 apps only
     for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
@@ -196,7 +196,7 @@
  * Test IRadio.iccIOForApp() for the response returned.
  */
 TEST_F(RadioHidlTest, iccIOForApp) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
         IccIo iccIo;
@@ -221,7 +221,7 @@
  * Test IRadio.iccTransmitApduBasicChannel() for the response returned.
  */
 TEST_F(RadioHidlTest, iccTransmitApduBasicChannel) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     SimApdu msg;
     memset(&msg, 0, sizeof(msg));
     msg.data = hidl_string();
@@ -238,7 +238,7 @@
  * Test IRadio.iccOpenLogicalChannel() for the response returned.
  */
 TEST_F(RadioHidlTest, iccOpenLogicalChannel) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     int p2 = 0x04;
     // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
     for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
@@ -253,7 +253,7 @@
  * Test IRadio.iccCloseLogicalChannel() for the response returned.
  */
 TEST_F(RadioHidlTest, iccCloseLogicalChannel) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     // Try closing invalid channel and check INVALID_ARGUMENTS returned as error
     radio->iccCloseLogicalChannel(serial, 0);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -267,7 +267,7 @@
  * Test IRadio.iccTransmitApduLogicalChannel() for the response returned.
  */
 TEST_F(RadioHidlTest, iccTransmitApduLogicalChannel) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     SimApdu msg;
     memset(&msg, 0, sizeof(msg));
     msg.data = hidl_string();
@@ -284,17 +284,18 @@
  * Test IRadio.requestIccSimAuthentication() for the response returned.
  */
 TEST_F(RadioHidlTest, requestIccSimAuthentication) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS
-    // returned as error.
+    // or REQUEST_NOT_SUPPORTED returned as error.
     for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
         radio->requestIccSimAuthentication(serial, 0, hidl_string("test"),
                                            cardStatus.applications[i].aidPtr);
         EXPECT_EQ(std::cv_status::no_timeout, wait());
         EXPECT_EQ(serial, radioRsp->rspInfo.serial);
         EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
-        EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
+        ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::INVALID_ARGUMENTS,
+                                                               RadioError::REQUEST_NOT_SUPPORTED}));
     }
 }
 
@@ -302,7 +303,7 @@
  * Test IRadio.supplyNetworkDepersonalization() for the response returned.
  */
 TEST_F(RadioHidlTest, supplyNetworkDepersonalization) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->supplyNetworkDepersonalization(serial, hidl_string("test"));
     EXPECT_EQ(std::cv_status::no_timeout, wait());
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp b/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
index 4574678..4331c06 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
@@ -22,7 +22,7 @@
  * Test IRadio.getClir() for the response returned.
  */
 TEST_F(RadioHidlTest, getClir) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getClir(serial);
 
@@ -40,7 +40,7 @@
  * Test IRadio.setClir() for the response returned.
  */
 TEST_F(RadioHidlTest, setClir) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     int32_t status = 1;
 
     radio->setClir(serial, status);
@@ -58,7 +58,7 @@
  * Test IRadio.getFacilityLockForApp() for the response returned.
  */
 TEST_F(RadioHidlTest, getFacilityLockForApp) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     std::string facility = "";
     std::string password = "";
     int32_t serviceClass = 1;
@@ -81,7 +81,7 @@
  * Test IRadio.setFacilityLockForApp() for the response returned.
  */
 TEST_F(RadioHidlTest, setFacilityLockForApp) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     std::string facility = "";
     bool lockState = false;
     std::string password = "";
@@ -105,7 +105,7 @@
  * Test IRadio.setBarringPassword() for the response returned.
  */
 TEST_F(RadioHidlTest, setBarringPassword) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     std::string facility = "";
     std::string oldPassword = "";
     std::string newPassword = "";
@@ -128,7 +128,7 @@
  * Test IRadio.getClip() for the response returned.
  */
 TEST_F(RadioHidlTest, getClip) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getClip(serial);
 
@@ -146,7 +146,7 @@
  * Test IRadio.setSuppServiceNotifications() for the response returned.
  */
 TEST_F(RadioHidlTest, setSuppServiceNotifications) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     bool enable = false;
 
     radio->setSuppServiceNotifications(serial, enable);
@@ -165,7 +165,7 @@
  * Test IRadio.requestIsimAuthentication() for the response returned.
  */
 TEST_F(RadioHidlTest, requestIsimAuthentication) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     std::string challenge = "";
 
     radio->requestIsimAuthentication(serial, challenge);
@@ -187,7 +187,7 @@
  * Test IRadio.getImsRegistrationState() for the response returned.
  */
 TEST_F(RadioHidlTest, getImsRegistrationState) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getImsRegistrationState(serial);
 
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 e5268f6..6b7add5 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
@@ -20,7 +20,7 @@
  * Test IRadio.getSignalStrength() for the response returned.
  */
 TEST_F(RadioHidlTest, getSignalStrength) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getSignalStrength(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -36,7 +36,7 @@
  * Test IRadio.getVoiceRegistrationState() for the response returned.
  */
 TEST_F(RadioHidlTest, getVoiceRegistrationState) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getVoiceRegistrationState(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -52,7 +52,7 @@
  * Test IRadio.getOperator() for the response returned.
  */
 TEST_F(RadioHidlTest, getOperator) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getOperator(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -68,7 +68,7 @@
  * Test IRadio.setRadioPower() for the response returned.
  */
 TEST_F(RadioHidlTest, setRadioPower) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setRadioPower(serial, 1);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -84,7 +84,7 @@
  * Test IRadio.getNetworkSelectionMode() for the response returned.
  */
 TEST_F(RadioHidlTest, getNetworkSelectionMode) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getNetworkSelectionMode(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -100,7 +100,7 @@
  * Test IRadio.setNetworkSelectionModeAutomatic() for the response returned.
  */
 TEST_F(RadioHidlTest, setNetworkSelectionModeAutomatic) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setNetworkSelectionModeAutomatic(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -119,7 +119,7 @@
  * Test IRadio.setNetworkSelectionModeManual() for the response returned.
  */
 TEST_F(RadioHidlTest, setNetworkSelectionModeManual) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setNetworkSelectionModeManual(serial, "123456");
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -138,7 +138,7 @@
  * Test IRadio.getAvailableNetworks() for the response returned.
  */
 TEST_F(RadioHidlTest, getAvailableNetworks) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getAvailableNetworks(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait(300));
@@ -159,7 +159,7 @@
  * Test IRadio.getBasebandVersion() for the response returned.
  */
 TEST_F(RadioHidlTest, getBasebandVersion) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getBasebandVersion(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -175,7 +175,7 @@
  * Test IRadio.setBandMode() for the response returned.
  */
 TEST_F(RadioHidlTest, setBandMode) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setBandMode(serial, RadioBandMode::BAND_MODE_USA);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -192,7 +192,7 @@
  * Test IRadio.getAvailableBandModes() for the response returned.
  */
 TEST_F(RadioHidlTest, getAvailableBandModes) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getAvailableBandModes(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -208,7 +208,7 @@
  * Test IRadio.setPreferredNetworkType() for the response returned.
  */
 TEST_F(RadioHidlTest, setPreferredNetworkType) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setPreferredNetworkType(serial, PreferredNetworkType::GSM_ONLY);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -225,7 +225,7 @@
  * Test IRadio.getPreferredNetworkType() for the response returned.
  */
 TEST_F(RadioHidlTest, getPreferredNetworkType) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getPreferredNetworkType(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -241,7 +241,7 @@
  * Test IRadio.getNeighboringCids() for the response returned.
  */
 TEST_F(RadioHidlTest, getNeighboringCids) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getNeighboringCids(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -259,7 +259,7 @@
  * Test IRadio.setLocationUpdates() for the response returned.
  */
 TEST_F(RadioHidlTest, setLocationUpdates) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setLocationUpdates(serial, true);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -276,7 +276,7 @@
  * Test IRadio.setCdmaRoamingPreference() for the response returned.
  */
 TEST_F(RadioHidlTest, setCdmaRoamingPreference) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setCdmaRoamingPreference(serial, CdmaRoamingType::HOME_NETWORK);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -294,7 +294,7 @@
  * Test IRadio.getCdmaRoamingPreference() for the response returned.
  */
 TEST_F(RadioHidlTest, getCdmaRoamingPreference) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getCdmaRoamingPreference(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -313,7 +313,7 @@
  * Test IRadio.getTTYMode() for the response returned.
  */
 TEST_F(RadioHidlTest, getTTYMode) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getTTYMode(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -329,7 +329,7 @@
  * Test IRadio.setTTYMode() for the response returned.
  */
 TEST_F(RadioHidlTest, setTTYMode) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setTTYMode(serial, TtyMode::OFF);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -345,7 +345,7 @@
  * Test IRadio.setPreferredVoicePrivacy() for the response returned.
  */
 TEST_F(RadioHidlTest, setPreferredVoicePrivacy) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setPreferredVoicePrivacy(serial, true);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -362,7 +362,7 @@
  * Test IRadio.getPreferredVoicePrivacy() for the response returned.
  */
 TEST_F(RadioHidlTest, getPreferredVoicePrivacy) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getPreferredVoicePrivacy(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -379,7 +379,7 @@
  * Test IRadio.getCDMASubscription() for the response returned.
  */
 TEST_F(RadioHidlTest, getCDMASubscription) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getCDMASubscription(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -397,7 +397,7 @@
  * Test IRadio.getDeviceIdentity() for the response returned.
  */
 TEST_F(RadioHidlTest, getDeviceIdentity) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getDeviceIdentity(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -414,7 +414,7 @@
  * Test IRadio.exitEmergencyCallbackMode() for the response returned.
  */
 TEST_F(RadioHidlTest, exitEmergencyCallbackMode) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->exitEmergencyCallbackMode(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -432,7 +432,7 @@
  * Test IRadio.getCdmaSubscriptionSource() for the response returned.
  */
 TEST_F(RadioHidlTest, getCdmaSubscriptionSource) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getCdmaSubscriptionSource(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -450,7 +450,7 @@
  * Test IRadio.setCdmaSubscriptionSource() for the response returned.
  */
 TEST_F(RadioHidlTest, setCdmaSubscriptionSource) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setCdmaSubscriptionSource(serial, CdmaSubscriptionSource::RUIM_SIM);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -469,7 +469,7 @@
  * Test IRadio.getVoiceRadioTechnology() for the response returned.
  */
 TEST_F(RadioHidlTest, getVoiceRadioTechnology) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getVoiceRadioTechnology(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -485,7 +485,7 @@
  * Test IRadio.getCellInfoList() for the response returned.
  */
 TEST_F(RadioHidlTest, getCellInfoList) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getCellInfoList(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -503,7 +503,7 @@
  * Test IRadio.setCellInfoListRate() for the response returned.
  */
 TEST_F(RadioHidlTest, setCellInfoListRate) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // TODO(sanketpadawe): RIL crashes with value of rate = 10
     radio->setCellInfoListRate(serial, 10);
@@ -521,7 +521,7 @@
  * Test IRadio.nvReadItem() for the response returned.
  */
 TEST_F(RadioHidlTest, nvReadItem) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->nvReadItem(serial, NvItem::LTE_BAND_ENABLE_25);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -538,7 +538,7 @@
  * Test IRadio.nvWriteItem() for the response returned.
  */
 TEST_F(RadioHidlTest, nvWriteItem) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     NvWriteItem item;
     memset(&item, 0, sizeof(item));
     item.value = hidl_string();
@@ -558,7 +558,7 @@
  * Test IRadio.nvWriteCdmaPrl() for the response returned.
  */
 TEST_F(RadioHidlTest, nvWriteCdmaPrl) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     std::vector<uint8_t> prl = {1, 2, 3, 4, 5};
 
     radio->nvWriteCdmaPrl(serial, hidl_vec<uint8_t>(prl));
@@ -576,9 +576,9 @@
  * Test IRadio.nvResetConfig() for the response returned.
  */
 TEST_F(RadioHidlTest, nvResetConfig) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
-    radio->nvResetConfig(++serial, ResetNvType::ERASE);
+    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);
@@ -593,7 +593,7 @@
  * Test IRadio.setUiccSubscription() for the response returned.
  */
 TEST_F(RadioHidlTest, setUiccSubscription) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     SelectUiccSub item;
     memset(&item, 0, sizeof(item));
 
@@ -615,7 +615,7 @@
  * Test IRadio.getHardwareConfig() for the response returned.
  */
 TEST_F(RadioHidlTest, getHardwareConfig) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getHardwareConfig(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -632,7 +632,7 @@
  * Test IRadio.requestShutdown() for the response returned.
  */
 TEST_F(RadioHidlTest, requestShutdown) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->requestShutdown(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -649,7 +649,7 @@
  * Test IRadio.getRadioCapability() for the response returned.
  */
 TEST_F(RadioHidlTest, getRadioCapability) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getRadioCapability(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -665,7 +665,7 @@
  * Test IRadio.setRadioCapability() for the response returned.
  */
 TEST_F(RadioHidlTest, setRadioCapability) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     RadioCapability rc;
     memset(&rc, 0, sizeof(rc));
     rc.logicalModemUuid = hidl_string();
@@ -686,7 +686,7 @@
  * Test IRadio.startLceService() for the response returned.
  */
 TEST_F(RadioHidlTest, startLceService) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->startLceService(serial, 5, true);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -704,7 +704,7 @@
  * Test IRadio.stopLceService() for the response returned.
  */
 TEST_F(RadioHidlTest, stopLceService) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->stopLceService(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -722,7 +722,7 @@
  * Test IRadio.pullLceData() for the response returned.
  */
 TEST_F(RadioHidlTest, pullLceData) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->pullLceData(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -741,7 +741,7 @@
  * Test IRadio.getModemActivityInfo() for the response returned.
  */
 TEST_F(RadioHidlTest, getModemActivityInfo) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getModemActivityInfo(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -758,7 +758,7 @@
  * Test IRadio.setAllowedCarriers() for the response returned.
  */
 TEST_F(RadioHidlTest, setAllowedCarriers) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     CarrierRestrictions carriers;
     memset(&carriers, 0, sizeof(carriers));
     carriers.allowedCarriers.resize(1);
@@ -778,12 +778,26 @@
                                      {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
     }
 
+    /* Setting to carrier restriction needs some time */
+    updateSimCardStatus();
+    auto startTime = std::chrono::system_clock::now();
+    while (cardStatus.cardState != CardState::RESTRICTED &&
+           std::chrono::duration_cast<chrono::seconds>(std::chrono::system_clock::now() - startTime)
+                   .count() < 10) {
+        /* Set 2 seconds as interval to check card status */
+        sleep(2);
+        updateSimCardStatus();
+    }
+    EXPECT_EQ(CardState::RESTRICTED, cardStatus.cardState);
+    sleep(10);
+
     /* Reset back to no carrier restriction */
     memset(&carriers, 0, sizeof(carriers));
     carriers.allowedCarriers.resize(0);
     carriers.excludedCarriers.resize(0);
 
-    radio->setAllowedCarriers(++serial, true, carriers);
+    serial = GetRandomSerialNumber();
+    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);
@@ -792,13 +806,26 @@
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error,
                                      {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
     }
+
+    /* Resetting back to no carrier restriction needs some time */
+    updateSimCardStatus();
+    startTime = std::chrono::system_clock::now();
+    while (cardStatus.cardState == CardState::RESTRICTED &&
+           std::chrono::duration_cast<chrono::seconds>(std::chrono::system_clock::now() - startTime)
+                   .count() < 10) {
+        /* Set 2 seconds as interval to check card status */
+        sleep(2);
+        updateSimCardStatus();
+    }
+    EXPECT_NE(CardState::RESTRICTED, cardStatus.cardState);
+    sleep(10);
 }
 
 /*
  * Test IRadio.getAllowedCarriers() for the response returned.
  */
 TEST_F(RadioHidlTest, getAllowedCarriers) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getAllowedCarriers(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -815,7 +842,7 @@
  * Test IRadio.sendDeviceState() for the response returned.
  */
 TEST_F(RadioHidlTest, sendDeviceState) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->sendDeviceState(serial, DeviceStateType::POWER_SAVE_MODE, true);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -834,7 +861,7 @@
  * Test IRadio.setIndicationFilter() for the response returned.
  */
 TEST_F(RadioHidlTest, setIndicationFilter) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setIndicationFilter(serial, 1);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -853,7 +880,7 @@
  * Test IRadio.setSimCardPower() for the response returned.
  */
 TEST_F(RadioHidlTest, setSimCardPower) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setSimCardPower(serial, true);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
index 469f03a..9e41429 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
@@ -22,14 +22,14 @@
  * Test IRadio.sendSms() for the response returned.
  */
 TEST_F(RadioHidlTest, sendSms) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     GsmSmsMessage msg;
     msg.smscPdu = "";
     msg.pdu = "01000b916105770203f3000006d4f29c3e9b01";
 
     radio->sendSms(serial, msg);
 
-    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(std::cv_status::no_timeout, wait(300));
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
@@ -46,7 +46,7 @@
  * Test IRadio.sendSMSExpectMore() for the response returned.
  */
 TEST_F(RadioHidlTest, sendSMSExpectMore) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     GsmSmsMessage msg;
     msg.smscPdu = "";
     msg.pdu = "01000b916105770203f3000006d4f29c3e9b01";
@@ -56,7 +56,7 @@
     // TODO(shuoq): add more test for this API when inserted sim card is
     // considered
 
-    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(std::cv_status::no_timeout, wait(300));
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
 
@@ -72,7 +72,7 @@
  * Test IRadio.acknowledgeLastIncomingGsmSms() for the response returned.
  */
 TEST_F(RadioHidlTest, acknowledgeLastIncomingGsmSms) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     bool success = true;
 
     radio->acknowledgeLastIncomingGsmSms(serial, success,
@@ -93,7 +93,7 @@
  * Test IRadio.acknowledgeIncomingGsmSmsWithPdu() for the response returned.
  */
 TEST_F(RadioHidlTest, acknowledgeIncomingGsmSmsWithPdu) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     bool success = true;
     std::string ackPdu = "";
 
@@ -112,7 +112,7 @@
  * Test IRadio.sendCdmaSms() for the response returned.
  */
 TEST_F(RadioHidlTest, sendCdmaSms) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Create a CdmaSmsAddress
     CdmaSmsAddress cdmaSmsAddress;
@@ -156,7 +156,7 @@
  * Test IRadio.acknowledgeLastIncomingCdmaSms() for the response returned.
  */
 TEST_F(RadioHidlTest, acknowledgeLastIncomingCdmaSms) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Create a CdmaSmsAck
     CdmaSmsAck cdmaSmsAck;
@@ -180,7 +180,7 @@
  * Test IRadio.sendImsSms() for the response returned.
  */
 TEST_F(RadioHidlTest, sendImsSms) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Create a CdmaSmsAddress
     CdmaSmsAddress cdmaSmsAddress;
@@ -230,7 +230,7 @@
  * Test IRadio.getSmscAddress() for the response returned.
  */
 TEST_F(RadioHidlTest, getSmscAddress) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getSmscAddress(serial);
 
@@ -250,7 +250,7 @@
  * Test IRadio.setSmscAddress() for the response returned.
  */
 TEST_F(RadioHidlTest, setSmscAddress) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     hidl_string address = hidl_string("smscAddress");
 
     radio->setSmscAddress(serial, address);
@@ -271,7 +271,7 @@
  * Test IRadio.writeSmsToSim() for the response returned.
  */
 TEST_F(RadioHidlTest, writeSmsToSim) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     SmsWriteArgs smsWriteArgs;
     smsWriteArgs.status = SmsWriteArgsStatus::REC_UNREAD;
     smsWriteArgs.smsc = "";
@@ -297,7 +297,7 @@
  * Test IRadio.deleteSmsOnSim() for the response returned.
  */
 TEST_F(RadioHidlTest, deleteSmsOnSim) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     int index = 1;
 
     radio->deleteSmsOnSim(serial, index);
@@ -320,7 +320,7 @@
  * Test IRadio.writeSmsToRuim() for the response returned.
  */
 TEST_F(RadioHidlTest, writeSmsToRuim) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Create a CdmaSmsAddress
     CdmaSmsAddress cdmaSmsAddress;
@@ -371,7 +371,7 @@
  * Test IRadio.deleteSmsOnRuim() for the response returned.
  */
 TEST_F(RadioHidlTest, deleteSmsOnRuim) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     int index = 1;
 
     // Create a CdmaSmsAddress
@@ -422,7 +422,7 @@
  * Test IRadio.reportSmsMemoryStatus() for the response returned.
  */
 TEST_F(RadioHidlTest, reportSmsMemoryStatus) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     bool available = true;
 
     radio->reportSmsMemoryStatus(serial, available);
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
index 411d74c..a3b5029 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
@@ -22,7 +22,7 @@
  * Test IRadio.sendEnvelope() for the response returned.
  */
 TEST_F(RadioHidlTest, sendEnvelope) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Test with sending empty string
     std::string content = "";
@@ -45,7 +45,7 @@
  * Test IRadio.sendTerminalResponseToSim() for the response returned.
  */
 TEST_F(RadioHidlTest, sendTerminalResponseToSim) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Test with sending empty string
     std::string commandResponse = "";
@@ -68,7 +68,7 @@
  * Test IRadio.handleStkCallSetupRequestFromSim() for the response returned.
  */
 TEST_F(RadioHidlTest, handleStkCallSetupRequestFromSim) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     bool accept = false;
 
     radio->handleStkCallSetupRequestFromSim(serial, accept);
@@ -89,7 +89,7 @@
  * Test IRadio.reportStkServiceIsRunning() for the response returned.
  */
 TEST_F(RadioHidlTest, reportStkServiceIsRunning) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->reportStkServiceIsRunning(serial);
 
@@ -108,7 +108,7 @@
  * string.
  */
 TEST_F(RadioHidlTest, sendEnvelopeWithStatus) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     // Test with sending empty string
     std::string contents = "";
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
index e3e7004..984fa1c 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
@@ -31,22 +31,21 @@
 
     radio->setResponseFunctions(radioRsp, radioInd);
 
-    int serial = GetRandomSerialNumber();
-    radio->getIccCardStatus(serial);
-    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    updateSimCardStatus();
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
     EXPECT_EQ(serial, radioRsp->rspInfo.serial);
     EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
 
-    /* Vts Testing with Sim Absent only. This needs to be removed later in P when sim present
-     * scenarios will be tested. */
-    EXPECT_EQ(CardState::ABSENT, cardStatus.cardState);
+    /* Enforce Vts Testing with Sim Status Present only. */
+    EXPECT_EQ(CardState::PRESENT, cardStatus.cardState);
 }
 
-void RadioHidlTest::notify() {
+void RadioHidlTest::notify(int receivedSerial) {
     std::unique_lock<std::mutex> lock(mtx);
-    count++;
-    cv.notify_one();
+    if (serial == receivedSerial) {
+        count++;
+        cv.notify_one();
+    }
 }
 
 std::cv_status RadioHidlTest::wait(int sec) {
@@ -62,4 +61,10 @@
     }
     count--;
     return status;
-}
\ No newline at end of file
+}
+
+void RadioHidlTest::updateSimCardStatus() {
+    serial = GetRandomSerialNumber();
+    radio->getIccCardStatus(serial);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h b/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h
index 6b95ab0..e86f3ac 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h
+++ b/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h
@@ -518,11 +518,17 @@
     std::condition_variable cv;
     int count;
 
+    /* Serial number for radio request */
+    int serial;
+
+    /* Update Sim Card Status */
+    void updateSimCardStatus();
+
    public:
     virtual void SetUp() override;
 
     /* Used as a mechanism to inform the test about data/event callback */
-    void notify();
+    void notify(int receivedSerial);
 
     /* Test code calls this function to wait for response */
     std::cv_status wait(int sec = TIMEOUT_PERIOD);
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 b3d5648..4eddcf4 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
@@ -20,7 +20,7 @@
  * Test IRadio.getCurrentCalls() for the response returned.
  */
 TEST_F(RadioHidlTest, getCurrentCalls) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getCurrentCalls(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -36,7 +36,7 @@
  * Test IRadio.dial() for the response returned.
  */
 TEST_F(RadioHidlTest, dial) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Dial dialInfo;
     memset(&dialInfo, 0, sizeof(dialInfo));
@@ -63,7 +63,7 @@
  * Test IRadio.hangup() for the response returned.
  */
 TEST_F(RadioHidlTest, hangup) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->hangup(serial, 1);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -82,7 +82,7 @@
  * Test IRadio.hangupWaitingOrBackground() for the response returned.
  */
 TEST_F(RadioHidlTest, hangupWaitingOrBackground) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->hangupWaitingOrBackground(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -100,7 +100,7 @@
  * Test IRadio.hangupForegroundResumeBackground() for the response returned.
  */
 TEST_F(RadioHidlTest, hangupForegroundResumeBackground) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->hangupForegroundResumeBackground(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -118,7 +118,7 @@
  * Test IRadio.switchWaitingOrHoldingAndActive() for the response returned.
  */
 TEST_F(RadioHidlTest, switchWaitingOrHoldingAndActive) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->switchWaitingOrHoldingAndActive(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -136,7 +136,7 @@
  * Test IRadio.conference() for the response returned.
  */
 TEST_F(RadioHidlTest, conference) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->conference(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -154,7 +154,7 @@
  * Test IRadio.rejectCall() for the response returned.
  */
 TEST_F(RadioHidlTest, rejectCall) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->rejectCall(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -172,7 +172,7 @@
  * Test IRadio.getLastCallFailCause() for the response returned.
  */
 TEST_F(RadioHidlTest, getLastCallFailCause) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getLastCallFailCause(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -189,7 +189,7 @@
  * Test IRadio.sendUssd() for the response returned.
  */
 TEST_F(RadioHidlTest, sendUssd) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     radio->sendUssd(serial, hidl_string("test"));
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
@@ -207,7 +207,7 @@
  * Test IRadio.cancelPendingUssd() for the response returned.
  */
 TEST_F(RadioHidlTest, cancelPendingUssd) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->cancelPendingUssd(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -226,7 +226,7 @@
  * Test IRadio.getCallForwardStatus() for the response returned.
  */
 TEST_F(RadioHidlTest, getCallForwardStatus) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     CallForwardInfo callInfo;
     memset(&callInfo, 0, sizeof(callInfo));
     callInfo.number = hidl_string();
@@ -248,7 +248,7 @@
  * Test IRadio.setCallForward() for the response returned.
  */
 TEST_F(RadioHidlTest, setCallForward) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     CallForwardInfo callInfo;
     memset(&callInfo, 0, sizeof(callInfo));
     callInfo.number = hidl_string();
@@ -270,7 +270,7 @@
  * Test IRadio.getCallWaiting() for the response returned.
  */
 TEST_F(RadioHidlTest, getCallWaiting) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getCallWaiting(serial, 1);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -289,7 +289,7 @@
  * Test IRadio.setCallWaiting() for the response returned.
  */
 TEST_F(RadioHidlTest, setCallWaiting) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setCallWaiting(serial, true, 1);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -308,7 +308,7 @@
  * Test IRadio.acceptCall() for the response returned.
  */
 TEST_F(RadioHidlTest, acceptCall) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->acceptCall(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -326,7 +326,7 @@
  * Test IRadio.separateConnection() for the response returned.
  */
 TEST_F(RadioHidlTest, separateConnection) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->separateConnection(serial, 1);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -345,7 +345,7 @@
  * Test IRadio.explicitCallTransfer() for the response returned.
  */
 TEST_F(RadioHidlTest, explicitCallTransfer) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->explicitCallTransfer(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -363,7 +363,7 @@
  * Test IRadio.sendCDMAFeatureCode() for the response returned.
  */
 TEST_F(RadioHidlTest, sendCDMAFeatureCode) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->sendCDMAFeatureCode(serial, hidl_string());
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -383,7 +383,7 @@
  * Test IRadio.sendDtmf() for the response returned.
  */
 TEST_F(RadioHidlTest, sendDtmf) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->sendDtmf(serial, "1");
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -403,7 +403,7 @@
  * Test IRadio.startDtmf() for the response returned.
  */
 TEST_F(RadioHidlTest, startDtmf) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->startDtmf(serial, "1");
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -423,7 +423,7 @@
  * Test IRadio.stopDtmf() for the response returned.
  */
 TEST_F(RadioHidlTest, stopDtmf) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->stopDtmf(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -442,7 +442,7 @@
  * Test IRadio.setMute() for the response returned.
  */
 TEST_F(RadioHidlTest, setMute) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->setMute(serial, true);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -460,7 +460,7 @@
  * Test IRadio.getMute() for the response returned.
  */
 TEST_F(RadioHidlTest, getMute) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->getMute(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -476,7 +476,7 @@
  * Test IRadio.sendBurstDtmf() for the response returned.
  */
 TEST_F(RadioHidlTest, sendBurstDtmf) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio->sendBurstDtmf(serial, "1", 0, 0);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
diff --git a/radio/1.0/vts/functional/radio_response.cpp b/radio/1.0/vts/functional/radio_response.cpp
index 434d488..93d5557 100644
--- a/radio/1.0/vts/functional/radio_response.cpp
+++ b/radio/1.0/vts/functional/radio_response.cpp
@@ -24,69 +24,69 @@
                                                      const CardStatus& card_status) {
     rspInfo = info;
     cardStatus = card_status;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::supplyIccPinForAppResponse(const RadioResponseInfo& info,
                                                        int32_t /*remainingRetries*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::supplyIccPukForAppResponse(const RadioResponseInfo& info,
                                                        int32_t /*remainingRetries*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::supplyIccPin2ForAppResponse(const RadioResponseInfo& info,
                                                         int32_t /*remainingRetries*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::supplyIccPuk2ForAppResponse(const RadioResponseInfo& info,
                                                         int32_t /*remainingRetries*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::changeIccPinForAppResponse(const RadioResponseInfo& info,
                                                        int32_t /*remainingRetries*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::changeIccPin2ForAppResponse(const RadioResponseInfo& info,
                                                         int32_t /*remainingRetries*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::supplyNetworkDepersonalizationResponse(const RadioResponseInfo& info,
                                                                    int32_t /*remainingRetries*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getCurrentCallsResponse(
     const RadioResponseInfo& info, const ::android::hardware::hidl_vec<Call>& /*calls*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::dialResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -94,72 +94,72 @@
                                                   const ::android::hardware::hidl_string& imsi) {
     rspInfo = info;
     this->imsi = imsi;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::hangupConnectionResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::hangupWaitingOrBackgroundResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::hangupForegroundResumeBackgroundResponse(
     const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::switchWaitingOrHoldingAndActiveResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::conferenceResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::rejectCallResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getLastCallFailCauseResponse(
     const RadioResponseInfo& info, const LastCallFailCauseInfo& /*failCauseInfo*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getSignalStrengthResponse(const RadioResponseInfo& info,
                                                       const SignalStrength& /*sig_strength*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getVoiceRegistrationStateResponse(
     const RadioResponseInfo& info, const VoiceRegStateResult& /*voiceRegResponse*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getDataRegistrationStateResponse(
     const RadioResponseInfo& info, const DataRegStateResult& /*dataRegResponse*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -168,19 +168,19 @@
     const ::android::hardware::hidl_string& /*shortName*/,
     const ::android::hardware::hidl_string& /*numeric*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setRadioPowerResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::sendDtmfResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -188,7 +188,7 @@
                                             const SendSmsResult& sms) {
     rspInfo = info;
     sendSmsResult = sms;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -196,14 +196,14 @@
                                                       const SendSmsResult& sms) {
     rspInfo = info;
     sendSmsResult = sms;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setupDataCallResponse(const RadioResponseInfo& info,
                                                   const SetupDataCallResult& /*dcResponse*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -211,32 +211,32 @@
                                                 const IccIoResult& iccIo) {
     rspInfo = info;
     this->iccIoResult = iccIo;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::sendUssdResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::cancelPendingUssdResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getClirResponse(const RadioResponseInfo& info, int32_t /*n*/,
                                             int32_t /*m*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setClirResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -244,84 +244,84 @@
     const RadioResponseInfo& info, const ::android::hardware::hidl_vec<CallForwardInfo>&
     /*callForwardInfos*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setCallForwardResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getCallWaitingResponse(const RadioResponseInfo& info, bool /*enable*/,
                                                    int32_t /*serviceClass*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setCallWaitingResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::acknowledgeLastIncomingGsmSmsResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::acceptCallResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::deactivateDataCallResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getFacilityLockForAppResponse(const RadioResponseInfo& info,
                                                           int32_t /*response*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setFacilityLockForAppResponse(const RadioResponseInfo& info,
                                                           int32_t /*retry*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setBarringPasswordResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getNetworkSelectionModeResponse(const RadioResponseInfo& info,
                                                             bool /*manual*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setNetworkSelectionModeAutomaticResponse(
     const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setNetworkSelectionModeManualResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -329,50 +329,50 @@
     const RadioResponseInfo& info,
     const ::android::hardware::hidl_vec<OperatorInfo>& /*networkInfos*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::startDtmfResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::stopDtmfResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getBasebandVersionResponse(
     const RadioResponseInfo& info, const ::android::hardware::hidl_string& /*version*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::separateConnectionResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setMuteResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getMuteResponse(const RadioResponseInfo& info, bool /*enable*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getClipResponse(const RadioResponseInfo& info, ClipStatus /*status*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -380,7 +380,7 @@
     const RadioResponseInfo& info,
     const ::android::hardware::hidl_vec<SetupDataCallResult>& /*dcResponse*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -397,26 +397,26 @@
 
 Return<void> RadioResponse::setSuppServiceNotificationsResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::writeSmsToSimResponse(const RadioResponseInfo& info, int32_t index) {
     rspInfo = info;
     writeSmsToSimIndex = index;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::deleteSmsOnSimResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setBandModeResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -424,46 +424,46 @@
     const RadioResponseInfo& info,
     const ::android::hardware::hidl_vec<RadioBandMode>& /*bandModes*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::sendEnvelopeResponse(
     const RadioResponseInfo& info, const ::android::hardware::hidl_string& /*commandResponse*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::sendTerminalResponseToSimResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::handleStkCallSetupRequestFromSimResponse(
     const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::explicitCallTransferResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setPreferredNetworkTypeResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getPreferredNetworkTypeResponse(const RadioResponseInfo& info,
                                                             PreferredNetworkType /*nw_type*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -471,69 +471,69 @@
     const RadioResponseInfo& info,
     const ::android::hardware::hidl_vec<NeighboringCell>& /*cells*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setLocationUpdatesResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setCdmaSubscriptionSourceResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setCdmaRoamingPreferenceResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getCdmaRoamingPreferenceResponse(const RadioResponseInfo& info,
                                                              CdmaRoamingType /*type*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setTTYModeResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getTTYModeResponse(const RadioResponseInfo& info, TtyMode /*mode*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setPreferredVoicePrivacyResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getPreferredVoicePrivacyResponse(const RadioResponseInfo& info,
                                                              bool /*enable*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::sendCDMAFeatureCodeResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::sendBurstDtmfResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -541,13 +541,13 @@
                                                 const SendSmsResult& sms) {
     rspInfo = info;
     sendSmsResult = sms;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::acknowledgeLastIncomingCdmaSmsResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -555,19 +555,19 @@
     const RadioResponseInfo& info,
     const ::android::hardware::hidl_vec<GsmBroadcastSmsConfigInfo>& /*configs*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setGsmBroadcastConfigResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setGsmBroadcastActivationResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -575,19 +575,19 @@
     const RadioResponseInfo& info,
     const ::android::hardware::hidl_vec<CdmaBroadcastSmsConfigInfo>& /*configs*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setCdmaBroadcastConfigResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setCdmaBroadcastActivationResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -598,20 +598,20 @@
     const ::android::hardware::hidl_string& /*min*/,
     const ::android::hardware::hidl_string& /*prl*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::writeSmsToRuimResponse(const RadioResponseInfo& info, uint32_t index) {
     rspInfo = info;
     writeSmsToRuimIndex = index;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::deleteSmsOnRuimResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -621,13 +621,13 @@
     const ::android::hardware::hidl_string& /*esn*/,
     const ::android::hardware::hidl_string& /*meid*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::exitEmergencyCallbackModeResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -635,79 +635,79 @@
                                                    const ::android::hardware::hidl_string& smsc) {
     rspInfo = info;
     smscAddress = smsc;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setSmscAddressResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::reportSmsMemoryStatusResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::reportStkServiceIsRunningResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getCdmaSubscriptionSourceResponse(const RadioResponseInfo& info,
                                                               CdmaSubscriptionSource /*source*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::requestIsimAuthenticationResponse(
     const RadioResponseInfo& info, const ::android::hardware::hidl_string& /*response*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::acknowledgeIncomingGsmSmsWithPduResponse(
     const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::sendEnvelopeWithStatusResponse(const RadioResponseInfo& info,
                                                            const IccIoResult& /*iccIo*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getVoiceRadioTechnologyResponse(const RadioResponseInfo& info,
                                                             RadioTechnology /*rat*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getCellInfoListResponse(
     const RadioResponseInfo& info, const ::android::hardware::hidl_vec<CellInfo>& /*cellInfo*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setCellInfoListRateResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setInitialAttachApnResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -715,7 +715,7 @@
                                                             bool /*isRegistered*/,
                                                             RadioTechnologyFamily /*ratFamily*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -723,7 +723,7 @@
                                                const SendSmsResult& sms) {
     rspInfo = info;
     sendSmsResult = sms;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -731,7 +731,7 @@
                                                                 const IccIoResult& result) {
     rspInfo = info;
     this->iccIoResult = result;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -740,13 +740,13 @@
     const ::android::hardware::hidl_vec<int8_t>& /*selectResponse*/) {
     rspInfo = info;
     this->channelId = channelId;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::iccCloseLogicalChannelResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -754,44 +754,44 @@
                                                                   const IccIoResult& result) {
     rspInfo = info;
     this->iccIoResult = result;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::nvReadItemResponse(const RadioResponseInfo& info,
                                                const ::android::hardware::hidl_string& /*result*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::nvWriteItemResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::nvResetConfigResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setUiccSubscriptionResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setDataAllowedResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -799,7 +799,7 @@
     const RadioResponseInfo& info,
     const ::android::hardware::hidl_vec<HardwareConfig>& /*config*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -807,68 +807,68 @@
                                                                 const IccIoResult& result) {
     rspInfo = info;
     this->iccIoResult = result;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setDataProfileResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::requestShutdownResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getRadioCapabilityResponse(const RadioResponseInfo& info,
                                                        const RadioCapability& /*rc*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setRadioCapabilityResponse(const RadioResponseInfo& info,
                                                        const RadioCapability& /*rc*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::startLceServiceResponse(const RadioResponseInfo& info,
                                                     const LceStatusInfo& /*statusInfo*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::stopLceServiceResponse(const RadioResponseInfo& info,
                                                    const LceStatusInfo& /*statusInfo*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::pullLceDataResponse(const RadioResponseInfo& info,
                                                 const LceDataInfo& /*lceInfo*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::getModemActivityInfoResponse(
     const RadioResponseInfo& info, const ActivityStatsInfo& /*activityInfo*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setAllowedCarriersResponse(const RadioResponseInfo& info,
                                                        int32_t /*numAllowed*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
@@ -876,25 +876,25 @@
                                                        bool /*allAllowed*/,
                                                        const CarrierRestrictions& /*carriers*/) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::sendDeviceStateResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setIndicationFilterResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse::setSimCardPowerResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent.notify();
+    parent.notify(info.serial);
     return Void();
 }
 
diff --git a/radio/1.0/vts/functional/sap_callback.cpp b/radio/1.0/vts/functional/sap_callback.cpp
index fdcc15c..cce69d5 100644
--- a/radio/1.0/vts/functional/sap_callback.cpp
+++ b/radio/1.0/vts/functional/sap_callback.cpp
@@ -21,13 +21,13 @@
 Return<void> SapCallback::connectResponse(int32_t token, SapConnectRsp /*sapConnectRsp*/,
                                           int32_t /*maxMsgSize*/) {
     sapResponseToken = token;
-    parent.notify();
+    parent.notify(token);
     return Void();
 }
 
 Return<void> SapCallback::disconnectResponse(int32_t token) {
     sapResponseToken = token;
-    parent.notify();
+    parent.notify(token);
     return Void();
 }
 
@@ -40,7 +40,7 @@
                                        const ::android::hardware::hidl_vec<uint8_t>& /*apduRsp*/) {
     sapResponseToken = token;
     sapResultCode = resultCode;
-    parent.notify();
+    parent.notify(token);
     return Void();
 }
 
@@ -49,21 +49,21 @@
     const ::android::hardware::hidl_vec<uint8_t>& /*atr*/) {
     sapResponseToken = token;
     sapResultCode = resultCode;
-    parent.notify();
+    parent.notify(token);
     return Void();
 }
 
 Return<void> SapCallback::powerResponse(int32_t token, SapResultCode resultCode) {
     sapResponseToken = token;
     sapResultCode = resultCode;
-    parent.notify();
+    parent.notify(token);
     return Void();
 }
 
 Return<void> SapCallback::resetSimResponse(int32_t token, SapResultCode resultCode) {
     sapResponseToken = token;
     sapResultCode = resultCode;
-    parent.notify();
+    parent.notify(token);
     return Void();
 }
 
@@ -75,7 +75,7 @@
                                                            int32_t /*cardReaderStatus*/) {
     sapResponseToken = token;
     sapResultCode = resultCode;
-    parent.notify();
+    parent.notify(token);
     return Void();
 }
 
@@ -86,6 +86,6 @@
 Return<void> SapCallback::transferProtocolResponse(int32_t token, SapResultCode resultCode) {
     sapResponseToken = token;
     sapResultCode = resultCode;
-    parent.notify();
+    parent.notify(token);
     return Void();
 }
diff --git a/radio/1.0/vts/functional/sap_hidl_hal_api.cpp b/radio/1.0/vts/functional/sap_hidl_hal_api.cpp
index d0788dd..da78f41 100644
--- a/radio/1.0/vts/functional/sap_hidl_hal_api.cpp
+++ b/radio/1.0/vts/functional/sap_hidl_hal_api.cpp
@@ -20,7 +20,7 @@
  * Test ISap.connectReq() for the response returned.
  */
 TEST_F(SapHidlTest, connectReq) {
-    int32_t token = GetRandomSerialNumber();
+    token = GetRandomSerialNumber();
     int32_t maxMsgSize = 100;
 
     sap->connectReq(token, maxMsgSize);
@@ -32,7 +32,7 @@
  * Test IRadio.disconnectReq() for the response returned
  */
 TEST_F(SapHidlTest, disconnectReq) {
-    int32_t token = GetRandomSerialNumber();
+    token = GetRandomSerialNumber();
 
     sap->disconnectReq(token);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -43,7 +43,7 @@
  * Test IRadio.apduReq() for the response returned.
  */
 TEST_F(SapHidlTest, apduReq) {
-    int32_t token = GetRandomSerialNumber();
+    token = GetRandomSerialNumber();
     SapApduType sapApduType = SapApduType::APDU;
     android::hardware::hidl_vec<uint8_t> command = {};
 
@@ -61,7 +61,7 @@
  * Test IRadio.transferAtrReq() for the response returned.
  */
 TEST_F(SapHidlTest, transferAtrReq) {
-    int32_t token = GetRandomSerialNumber();
+    token = GetRandomSerialNumber();
 
     sap->transferAtrReq(token);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -77,7 +77,7 @@
  * Test IRadio.powerReq() for the response returned.
  */
 TEST_F(SapHidlTest, powerReq) {
-    int32_t token = GetRandomSerialNumber();
+    token = GetRandomSerialNumber();
     bool state = true;
 
     sap->powerReq(token, state);
@@ -94,7 +94,7 @@
  * Test IRadio.resetSimReq() for the response returned.
  */
 TEST_F(SapHidlTest, resetSimReq) {
-    int32_t token = GetRandomSerialNumber();
+    token = GetRandomSerialNumber();
 
     sap->resetSimReq(token);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -110,7 +110,7 @@
  * Test IRadio.transferCardReaderStatusReq() for the response returned.
  */
 TEST_F(SapHidlTest, transferCardReaderStatusReq) {
-    int32_t token = GetRandomSerialNumber();
+    token = GetRandomSerialNumber();
 
     sap->transferCardReaderStatusReq(token);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -124,7 +124,7 @@
  * Test IRadio.setTransferProtocolReq() for the response returned.
  */
 TEST_F(SapHidlTest, setTransferProtocolReq) {
-    int32_t token = GetRandomSerialNumber();
+    token = GetRandomSerialNumber();
     SapTransferProtocol sapTransferProtocol = SapTransferProtocol::T0;
 
     sap->setTransferProtocolReq(token, sapTransferProtocol);
diff --git a/radio/1.0/vts/functional/sap_hidl_hal_test.cpp b/radio/1.0/vts/functional/sap_hidl_hal_test.cpp
index 7720505..88fdd7b 100644
--- a/radio/1.0/vts/functional/sap_hidl_hal_test.cpp
+++ b/radio/1.0/vts/functional/sap_hidl_hal_test.cpp
@@ -30,23 +30,25 @@
 
 void SapHidlTest::TearDown() {}
 
-void SapHidlTest::notify() {
+void SapHidlTest::notify(int receivedToken) {
     std::unique_lock<std::mutex> lock(mtx);
     count++;
-    cv.notify_one();
+    if (token == receivedToken) {
+        cv.notify_one();
     }
+}
 
-    std::cv_status SapHidlTest::wait() {
-        std::unique_lock<std::mutex> lock(mtx);
+std::cv_status SapHidlTest::wait() {
+    std::unique_lock<std::mutex> lock(mtx);
 
-        std::cv_status status = std::cv_status::no_timeout;
-        auto now = std::chrono::system_clock::now();
-        while (count == 0) {
-            status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
-            if (status == std::cv_status::timeout) {
-                return status;
-            }
+    std::cv_status status = std::cv_status::no_timeout;
+    auto now = std::chrono::system_clock::now();
+    while (count == 0) {
+        status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
+        if (status == std::cv_status::timeout) {
+            return status;
         }
-        count--;
-        return status;
-    }
\ No newline at end of file
+    }
+    count--;
+    return status;
+}
diff --git a/radio/1.0/vts/functional/sap_hidl_hal_utils.h b/radio/1.0/vts/functional/sap_hidl_hal_utils.h
index fb142b7..8151b9d 100644
--- a/radio/1.0/vts/functional/sap_hidl_hal_utils.h
+++ b/radio/1.0/vts/functional/sap_hidl_hal_utils.h
@@ -92,7 +92,7 @@
     virtual void TearDown() override;
 
     /* Used as a mechanism to inform the test about data/event callback */
-    void notify();
+    void notify(int receivedToken);
 
     /* Test code calls this function to wait for response */
     std::cv_status wait();
@@ -102,4 +102,7 @@
 
     /* Sap Callback object */
     sp<SapCallback> sapCb;
-};
\ No newline at end of file
+
+    /* Token for sap request */
+    int32_t token;
+};
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_api.cpp b/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
index 17c2a83..90077dc 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
@@ -21,18 +21,57 @@
  * Test IRadio.setSimCardPower() for the response returned.
  */
 TEST_F(RadioHidlTest_v1_1, setSimCardPower_1_1) {
-    int serial = GetRandomSerialNumber();
+    /* Record the sim card state for the testing environment */
+    CardState cardStateForTest = cardStatus.cardState;
 
+    /* Test setSimCardPower power down */
+    serial = GetRandomSerialNumber();
     radio_v1_1->setSimCardPower_1_1(serial, CardPowerState::POWER_DOWN);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
     EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
+    ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_1->rspInfo.error,
+                                 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED,
+                                  RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE}));
+    /* Wait some time for setting sim power down and then verify it */
+    updateSimCardStatus();
+    auto startTime = std::chrono::system_clock::now();
+    while (cardStatus.cardState != CardState::ABSENT &&
+           std::chrono::duration_cast<chrono::seconds>(std::chrono::system_clock::now() - startTime)
+                   .count() < 80) {
+        /* Set 2 seconds as interval to check card status */
+        sleep(2);
+        updateSimCardStatus();
+    }
+    EXPECT_EQ(CardState::ABSENT, cardStatus.cardState);
 
-    if (cardStatus.cardState == CardState::ABSENT) {
-        ASSERT_TRUE(
-            CheckAnyOfErrors(radioRsp_v1_1->rspInfo.error,
-                             {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED,
-                              RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE}));
+    /* Test setSimCardPower power up */
+    serial = GetRandomSerialNumber();
+    radio_v1_1->setSimCardPower_1_1(serial, CardPowerState::POWER_UP);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
+    EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
+    ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_1->rspInfo.error,
+                                 {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED,
+                                  RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE}));
+
+    /**
+     * If the sim card status for the testing environment is PRESENT,
+     * verify if sim status is reset back.
+     */
+    if (cardStateForTest == CardState::PRESENT) {
+        /* Wait some time for resetting back to sim power on and then verify it */
+        updateSimCardStatus();
+        startTime = std::chrono::system_clock::now();
+        while (cardStatus.cardState != CardState::PRESENT &&
+               std::chrono::duration_cast<chrono::seconds>(std::chrono::system_clock::now() -
+                                                           startTime)
+                       .count() < 80) {
+            /* Set 2 seconds as interval to check card status */
+            sleep(2);
+            updateSimCardStatus();
+        }
+        EXPECT_EQ(CardState::PRESENT, cardStatus.cardState);
     }
 }
 
@@ -40,7 +79,7 @@
  * Test IRadio.startNetworkScan() for the response returned.
  */
 TEST_F(RadioHidlTest_v1_1, startNetworkScan) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     NetworkScanRequest request;
     request.type = ScanType::ONE_SHOT;
@@ -74,7 +113,7 @@
  * Test IRadio.startNetworkScan() for the response returned.
  */
 TEST_F(RadioHidlTest_v1_1, startNetworkScan_InvalidArgument) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     NetworkScanRequest request;
     request.type = ScanType::ONE_SHOT;
@@ -98,7 +137,7 @@
  * Test IRadio.stopNetworkScan() for the response returned.
  */
 TEST_F(RadioHidlTest_v1_1, stopNetworkScan) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio_v1_1->stopNetworkScan(serial);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -117,7 +156,7 @@
  * Test IRadio.setCarrierInfoForImsiEncryption() for the response returned.
  */
 TEST_F(RadioHidlTest_v1_1, setCarrierInfoForImsiEncryption) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     ImsiEncryptionInfo imsiInfo;
     imsiInfo.mcc = "310";
     imsiInfo.mnc = "004";
@@ -222,7 +261,7 @@
         }};
 
     for (auto req = requests.begin(); req != requests.end(); req++) {
-        int serial = GetRandomSerialNumber();
+        serial = GetRandomSerialNumber();
         radio_v1_1->startKeepalive(serial, *req);
         EXPECT_EQ(std::cv_status::no_timeout, wait());
         EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
@@ -238,7 +277,7 @@
  * Test IRadio.stopKeepalive() for the response returned.
  */
 TEST_F(RadioHidlTest_v1_1, stopKeepalive) {
-    int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     radio_v1_1->stopKeepalive(serial, 0xBAD);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_test.cpp b/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
index 488da2d..e18d075 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
@@ -32,22 +32,21 @@
 
     radio_v1_1->setResponseFunctions(radioRsp_v1_1, radioInd_v1_1);
 
-    int serial = GetRandomSerialNumber();
-    radio_v1_1->getIccCardStatus(serial);
-    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    updateSimCardStatus();
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
     EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
     EXPECT_EQ(RadioError::NONE, radioRsp_v1_1->rspInfo.error);
 
-    /* Vts Testing with Sim Absent only. This needs to be removed later in P when sim present
-     * scenarios will be tested. */
-    EXPECT_EQ(CardState::ABSENT, cardStatus.cardState);
+    /* Enforce Vts Testing with Sim Status Present only. */
+    EXPECT_EQ(CardState::PRESENT, cardStatus.cardState);
 }
 
-void RadioHidlTest_v1_1::notify() {
+void RadioHidlTest_v1_1::notify(int receivedSerial) {
     std::unique_lock<std::mutex> lock(mtx);
-    count++;
-    cv.notify_one();
+    if (serial == receivedSerial) {
+        count++;
+        cv.notify_one();
+    }
 }
 
 std::cv_status RadioHidlTest_v1_1::wait(int sec) {
@@ -64,3 +63,9 @@
     count--;
     return status;
 }
+
+void RadioHidlTest_v1_1::updateSimCardStatus() {
+    serial = GetRandomSerialNumber();
+    radio_v1_1->getIccCardStatus(serial);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+}
\ No newline at end of file
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h b/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
index a081ab9..3f5e559 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
+++ b/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
@@ -541,11 +541,17 @@
     std::condition_variable cv;
     int count;
 
+    /* Serial number for radio request */
+    int serial;
+
+    /* Update Sim Card Status */
+    void updateSimCardStatus();
+
    public:
     virtual void SetUp() override;
 
     /* Used as a mechanism to inform the test about data/event callback */
-    void notify();
+    void notify(int receivedSerial);
 
     /* Test code calls this function to wait for response */
     std::cv_status wait(int sec = TIMEOUT_PERIOD);
diff --git a/radio/1.1/vts/functional/radio_response.cpp b/radio/1.1/vts/functional/radio_response.cpp
index 400ef3c..c2edde8 100644
--- a/radio/1.1/vts/functional/radio_response.cpp
+++ b/radio/1.1/vts/functional/radio_response.cpp
@@ -25,7 +25,7 @@
                                                           const CardStatus& card_status) {
     rspInfo = info;
     cardStatus = card_status;
-    parent_v1_1.notify();
+    parent_v1_1.notify(info.serial);
     return Void();
 }
 
@@ -661,25 +661,25 @@
 Return<void> RadioResponse_v1_1::setCarrierInfoForImsiEncryptionResponse(
     const RadioResponseInfo& info) {
     rspInfo = info;
-    parent_v1_1.notify();
+    parent_v1_1.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse_v1_1::setSimCardPowerResponse_1_1(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent_v1_1.notify();
+    parent_v1_1.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse_v1_1::startNetworkScanResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent_v1_1.notify();
+    parent_v1_1.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse_v1_1::stopNetworkScanResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent_v1_1.notify();
+    parent_v1_1.notify(info.serial);
     return Void();
 }
 
@@ -687,12 +687,12 @@
                                                         const KeepaliveStatus& status) {
     rspInfo = info;
     keepaliveStatus = status;
-    parent_v1_1.notify();
+    parent_v1_1.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse_v1_1::stopKeepaliveResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent_v1_1.notify();
+    parent_v1_1.notify(info.serial);
     return Void();
 }
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
index 0febd38..9284fd8 100644
--- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
@@ -23,7 +23,7 @@
  * Test IRadio.startNetworkScan() for the response returned.
  */
 TEST_F(RadioHidlTest_v1_2, startNetworkScan) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     RadioAccessSpecifier specifier = {
         .radioAccessNetwork = RadioAccessNetworks::GERAN,
@@ -51,7 +51,7 @@
  * Test IRadio.startNetworkScan() with invalid specifier.
  */
 TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidArgument) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     ::android::hardware::radio::V1_2::NetworkScanRequest request = {.type = ScanType::ONE_SHOT,
                                                                     .interval = 60};
@@ -77,7 +77,7 @@
  * Test IRadio.startNetworkScan() with invalid interval (lower boundary).
  */
 TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidInterval1) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     RadioAccessSpecifier specifier = {
         .radioAccessNetwork = RadioAccessNetworks::GERAN,
@@ -113,7 +113,7 @@
  * Test IRadio.startNetworkScan() with invalid interval (upper boundary).
  */
 TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidInterval2) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     RadioAccessSpecifier specifier = {
         .radioAccessNetwork = RadioAccessNetworks::GERAN,
@@ -149,7 +149,7 @@
  * Test IRadio.startNetworkScan() with invalid max search time (lower boundary).
  */
 TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidMaxSearchTime1) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     RadioAccessSpecifier specifier = {
         .radioAccessNetwork = RadioAccessNetworks::GERAN,
@@ -185,7 +185,7 @@
  * Test IRadio.startNetworkScan() with invalid max search time (upper boundary).
  */
 TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidMaxSearchTime2) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     RadioAccessSpecifier specifier = {
         .radioAccessNetwork = RadioAccessNetworks::GERAN,
@@ -221,7 +221,7 @@
  * Test IRadio.startNetworkScan() with invalid periodicity (lower boundary).
  */
 TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidPeriodicity1) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     RadioAccessSpecifier specifier = {
         .radioAccessNetwork = RadioAccessNetworks::GERAN,
@@ -257,7 +257,7 @@
  * Test IRadio.startNetworkScan() with invalid periodicity (upper boundary).
  */
 TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidPeriodicity2) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     RadioAccessSpecifier specifier = {
         .radioAccessNetwork = RadioAccessNetworks::GERAN,
@@ -293,7 +293,7 @@
  * Test IRadio.startNetworkScan() with valid periodicity
  */
 TEST_F(RadioHidlTest_v1_2, startNetworkScan_GoodRequest1) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     RadioAccessSpecifier specifier = {
         .radioAccessNetwork = RadioAccessNetworks::GERAN,
@@ -328,7 +328,7 @@
  * Test IRadio.startNetworkScan() with valid periodicity and plmns
  */
 TEST_F(RadioHidlTest_v1_2, startNetworkScan_GoodRequest2) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     RadioAccessSpecifier specifier = {
         .radioAccessNetwork = RadioAccessNetworks::GERAN,
@@ -364,7 +364,7 @@
  * Test IRadio.setIndicationFilter_1_2()
  */
 TEST_F(RadioHidlTest_v1_2, setIndicationFilter_1_2) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setIndicationFilter_1_2(
         serial, static_cast<int>(::android::hardware::radio::V1_2::IndicationFilter::ALL));
@@ -382,7 +382,7 @@
  * Test IRadio.setSignalStrengthReportingCriteria() with invalid hysteresisDb
  */
 TEST_F(RadioHidlTest_v1_2, setSignalStrengthReportingCriteria_invalidHysteresisDb) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
         serial, 5000,
@@ -402,7 +402,7 @@
  * Test IRadio.setSignalStrengthReportingCriteria() with empty parameters
  */
 TEST_F(RadioHidlTest_v1_2, setSignalStrengthReportingCriteria_EmptyParams) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
         serial, 0, 0, {}, ::android::hardware::radio::V1_2::AccessNetwork::GERAN);
@@ -420,7 +420,7 @@
  * Test IRadio.setSignalStrengthReportingCriteria() for GERAN
  */
 TEST_F(RadioHidlTest_v1_2, setSignalStrengthReportingCriteria_Geran) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
         serial, 5000, 2, {-109, -103, -97, -89},
@@ -439,7 +439,7 @@
  * Test IRadio.setSignalStrengthReportingCriteria() for UTRAN
  */
 TEST_F(RadioHidlTest_v1_2, setSignalStrengthReportingCriteria_Utran) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
         serial, 5000, 2, {-110, -97, -73, -49, -25},
@@ -458,7 +458,7 @@
  * Test IRadio.setSignalStrengthReportingCriteria() for EUTRAN
  */
 TEST_F(RadioHidlTest_v1_2, setSignalStrengthReportingCriteria_Eutran) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
         serial, 5000, 2, {-140, -128, -118, -108, -98, -44},
@@ -477,7 +477,7 @@
  * Test IRadio.setSignalStrengthReportingCriteria() for CDMA2000
  */
 TEST_F(RadioHidlTest_v1_2, setSignalStrengthReportingCriteria_Cdma2000) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
         serial, 5000, 2, {-105, -90, -75, -65},
@@ -496,7 +496,7 @@
  * Test IRadio.setLinkCapacityReportingCriteria() invalid hysteresisDlKbps
  */
 TEST_F(RadioHidlTest_v1_2, setLinkCapacityReportingCriteria_invalidHysteresisDlKbps) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setLinkCapacityReportingCriteria(
         serial, 5000,
@@ -517,7 +517,7 @@
  * Test IRadio.setLinkCapacityReportingCriteria() invalid hysteresisUlKbps
  */
 TEST_F(RadioHidlTest_v1_2, setLinkCapacityReportingCriteria_invalidHysteresisUlKbps) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setLinkCapacityReportingCriteria(
         serial, 5000, 500,
@@ -538,7 +538,7 @@
  * Test IRadio.setLinkCapacityReportingCriteria() empty params
  */
 TEST_F(RadioHidlTest_v1_2, setLinkCapacityReportingCriteria_emptyParams) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setLinkCapacityReportingCriteria(
         serial, 0, 0, 0, {}, {}, ::android::hardware::radio::V1_2::AccessNetwork::GERAN);
@@ -556,7 +556,7 @@
  * Test IRadio.setLinkCapacityReportingCriteria() GERAN
  */
 TEST_F(RadioHidlTest_v1_2, setLinkCapacityReportingCriteria_Geran) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setLinkCapacityReportingCriteria(
         serial, 5000, 500, 100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000},
@@ -575,7 +575,7 @@
  * Test IRadio.setupDataCall_1_2() for the response returned.
  */
 TEST_F(RadioHidlTest_v1_2, setupDataCall_1_2) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
 
     ::android::hardware::radio::V1_2::AccessNetwork accessNetwork =
         ::android::hardware::radio::V1_2::AccessNetwork::EUTRAN;
@@ -635,7 +635,7 @@
  * Test IRadio.deactivateDataCall_1_2() for the response returned.
  */
 TEST_F(RadioHidlTest_v1_2, deactivateDataCall_1_2) {
-    const int serial = GetRandomSerialNumber();
+    serial = GetRandomSerialNumber();
     int cid = 1;
     ::android::hardware::radio::V1_2::DataRequestReason reason =
         ::android::hardware::radio::V1_2::DataRequestReason::NORMAL;
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_test.cpp b/radio/1.2/vts/functional/radio_hidl_hal_test.cpp
index 2c8b699..fd1876e 100644
--- a/radio/1.2/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.2/vts/functional/radio_hidl_hal_test.cpp
@@ -42,21 +42,24 @@
 
     radio_v1_2->setResponseFunctions(radioRsp_v1_2, radioInd_v1_2);
 
-    int serial = GetRandomSerialNumber();
-    radio_v1_2->getIccCardStatus(serial);
-    EXPECT_EQ(std::cv_status::no_timeout, wait());
+    updateSimCardStatus();
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
     EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial);
     EXPECT_EQ(RadioError::NONE, radioRsp_v1_2->rspInfo.error);
+
+    /* Enforce Vts Testing with Sim Status Present only. */
+    EXPECT_EQ(CardState::PRESENT, cardStatus.base.cardState);
 }
 
 /*
  * Notify that the response message is received.
  */
-void RadioHidlTest_v1_2::notify() {
+void RadioHidlTest_v1_2::notify(int receivedSerial) {
     std::unique_lock<std::mutex> lock(mtx_);
-    count_++;
-    cv_.notify_one();
+    if (serial == receivedSerial) {
+        count_++;
+        cv_.notify_one();
+    }
 }
 
 /*
@@ -76,3 +79,9 @@
     count_--;
     return status;
 }
+
+void RadioHidlTest_v1_2::updateSimCardStatus() {
+    serial = GetRandomSerialNumber();
+    radio_v1_2->getIccCardStatus(serial);
+    EXPECT_EQ(std::cv_status::no_timeout, wait());
+}
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h b/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h
index 09158ae..9086408 100644
--- a/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h
+++ b/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h
@@ -612,11 +612,17 @@
     std::condition_variable cv_;
     int count_;
 
+    /* Serial number for radio request */
+    int serial;
+
+    /* Update Sim Card Status */
+    void updateSimCardStatus();
+
    public:
     virtual void SetUp() override;
 
     /* Used as a mechanism to inform the test about data/event callback */
-    void notify();
+    void notify(int receivedSerial);
 
     /* Test code calls this function to wait for response */
     std::cv_status wait();
diff --git a/radio/1.2/vts/functional/radio_response.cpp b/radio/1.2/vts/functional/radio_response.cpp
index 85ec3e0..f6bead2 100644
--- a/radio/1.2/vts/functional/radio_response.cpp
+++ b/radio/1.2/vts/functional/radio_response.cpp
@@ -155,7 +155,7 @@
 Return<void> RadioResponse_v1_2::setupDataCallResponse(const RadioResponseInfo& info,
                                                        const SetupDataCallResult& /*dcResponse*/) {
     rspInfo = info;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
@@ -211,7 +211,7 @@
 
 Return<void> RadioResponse_v1_2::deactivateDataCallResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
@@ -320,7 +320,7 @@
     const RadioResponseInfo& info, const ::android::hardware::hidl_vec<RadioBandMode>& bandModes) {
     rspInfo = info;
     radioBandModes = bandModes;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
@@ -677,13 +677,13 @@
 
 Return<void> RadioResponse_v1_2::startNetworkScanResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse_v1_2::stopNetworkScanResponse(const RadioResponseInfo& info) {
     rspInfo = info;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
@@ -700,14 +700,14 @@
 Return<void> RadioResponse_v1_2::setSignalStrengthReportingCriteriaResponse(
     const RadioResponseInfo& info) {
     rspInfo = info;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
 Return<void> RadioResponse_v1_2::setLinkCapacityReportingCriteriaResponse(
     const RadioResponseInfo& info) {
     rspInfo = info;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
@@ -716,7 +716,7 @@
     const ::android::hardware::radio::V1_2::CardStatus& card_status) {
     rspInfo = info;
     cardStatus = card_status;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
@@ -724,7 +724,7 @@
     const RadioResponseInfo& info,
     const ::android::hardware::hidl_vec<::android::hardware::radio::V1_2::Call>& /*calls*/) {
     rspInfo = info;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
@@ -732,7 +732,7 @@
     const RadioResponseInfo& info,
     const ::android::hardware::radio::V1_2::SignalStrength& /*sig_strength*/) {
     rspInfo = info;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
@@ -740,7 +740,7 @@
     const RadioResponseInfo& info,
     const ::android::hardware::hidl_vec<::android::hardware::radio::V1_2::CellInfo>& /*cellInfo*/) {
     rspInfo = info;
-    parent_v1_2.notify();
+    parent_v1_2.notify(info.serial);
     return Void();
 }
 
