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 ee130f8..c2524e4 100644
--- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
@@ -30,10 +30,8 @@
         .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
         .channels = {1,2}};
 
-    V1_2::NetworkScanRequest request = {
-        .type = ScanType::ONE_SHOT,
-        .interval = 60,
-        .specifiers = {specifier}};
+    ::android::hardware::radio::V1_2::NetworkScanRequest request = {
+        .type = ScanType::ONE_SHOT, .interval = 60, .specifiers = {specifier}};
 
     Return<void> res = radio_v1_2->startNetworkScan_1_2(serial, request);
     ASSERT_OK(res);
@@ -42,9 +40,9 @@
     EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial);
 
     ALOGI("startNetworkScan, rspInfo.error = %s\n", toString(radioRsp_v1_2->rspInfo.error).c_str());
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::SIM_ABSENT}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::NONE}));
     }
 }
@@ -55,9 +53,8 @@
 TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidArgument) {
     const int serial = GetRandomSerialNumber();
 
-    V1_2::NetworkScanRequest request = {
-        .type = ScanType::ONE_SHOT,
-        .interval = 60};
+    ::android::hardware::radio::V1_2::NetworkScanRequest request = {.type = ScanType::ONE_SHOT,
+                                                                    .interval = 60};
 
     Return<void> res = radio_v1_2->startNetworkScan_1_2(serial, request);
     ASSERT_OK(res);
@@ -67,10 +64,10 @@
 
     ALOGI("startNetworkScan_InvalidArgument, rspInfo.error = %s\n",
           toString(radioRsp_v1_2->rspInfo.error).c_str());
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
                                      {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(
             CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
     }
@@ -87,7 +84,7 @@
         .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
         .channels = {1,2}};
 
-    V1_2::NetworkScanRequest request = {
+    ::android::hardware::radio::V1_2::NetworkScanRequest request = {
         .type = ScanType::ONE_SHOT,
         .interval = 4,
         .specifiers = {specifier},
@@ -103,10 +100,10 @@
 
     ALOGI("startNetworkScan_InvalidInterval1, rspInfo.error = %s\n",
           toString(radioRsp_v1_2->rspInfo.error).c_str());
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
                                      {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(
             CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
     }
@@ -123,7 +120,7 @@
         .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
         .channels = {1,2}};
 
-    V1_2::NetworkScanRequest request = {
+    ::android::hardware::radio::V1_2::NetworkScanRequest request = {
         .type = ScanType::ONE_SHOT,
         .interval = 301,
         .specifiers = {specifier},
@@ -139,10 +136,10 @@
 
     ALOGI("startNetworkScan_InvalidInterval2, rspInfo.error = %s\n",
           toString(radioRsp_v1_2->rspInfo.error).c_str());
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
                                      {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(
             CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
     }
@@ -159,7 +156,7 @@
         .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
         .channels = {1,2}};
 
-    V1_2::NetworkScanRequest request = {
+    ::android::hardware::radio::V1_2::NetworkScanRequest request = {
         .type = ScanType::ONE_SHOT,
         .interval = 60,
         .specifiers = {specifier},
@@ -175,10 +172,10 @@
 
     ALOGI("startNetworkScan_InvalidMaxSearchTime1, rspInfo.error = %s\n",
           toString(radioRsp_v1_2->rspInfo.error).c_str());
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
                                      {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(
             CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
     }
@@ -195,7 +192,7 @@
         .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
         .channels = {1,2}};
 
-    V1_2::NetworkScanRequest request = {
+    ::android::hardware::radio::V1_2::NetworkScanRequest request = {
         .type = ScanType::ONE_SHOT,
         .interval = 60,
         .specifiers = {specifier},
@@ -211,10 +208,10 @@
 
     ALOGI("startNetworkScan_InvalidMaxSearchTime2, rspInfo.error = %s\n",
           toString(radioRsp_v1_2->rspInfo.error).c_str());
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
                                      {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(
             CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
     }
@@ -231,7 +228,7 @@
         .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
         .channels = {1,2}};
 
-    V1_2::NetworkScanRequest request = {
+    ::android::hardware::radio::V1_2::NetworkScanRequest request = {
         .type = ScanType::ONE_SHOT,
         .interval = 60,
         .specifiers = {specifier},
@@ -247,10 +244,10 @@
 
     ALOGI("startNetworkScan_InvalidPeriodicity1, rspInfo.error = %s\n",
           toString(radioRsp_v1_2->rspInfo.error).c_str());
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
                                      {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(
             CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
     }
@@ -267,7 +264,7 @@
         .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
         .channels = {1,2}};
 
-    V1_2::NetworkScanRequest request = {
+    ::android::hardware::radio::V1_2::NetworkScanRequest request = {
         .type = ScanType::ONE_SHOT,
         .interval = 60,
         .specifiers = {specifier},
@@ -283,10 +280,10 @@
 
     ALOGI("startNetworkScan_InvalidPeriodicity2, rspInfo.error = %s\n",
           toString(radioRsp_v1_2->rspInfo.error).c_str());
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
                                      {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(
             CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
     }
@@ -303,7 +300,7 @@
         .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
         .channels = {1,2}};
 
-    V1_2::NetworkScanRequest request = {
+    ::android::hardware::radio::V1_2::NetworkScanRequest request = {
         .type = ScanType::ONE_SHOT,
         .interval = 60,
         .specifiers = {specifier},
@@ -319,10 +316,10 @@
 
     ALOGI("startNetworkScan_InvalidArgument, rspInfo.error = %s\n",
           toString(radioRsp_v1_2->rspInfo.error).c_str());
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
                                      {RadioError::NONE, RadioError::SIM_ABSENT}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::NONE}));
     }
 }
@@ -338,7 +335,7 @@
         .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
         .channels = {1,2}};
 
-    V1_2::NetworkScanRequest request = {
+    ::android::hardware::radio::V1_2::NetworkScanRequest request = {
         .type = ScanType::ONE_SHOT,
         .interval = 60,
         .specifiers = {specifier},
@@ -355,10 +352,10 @@
 
     ALOGI("startNetworkScan_InvalidArgument, rspInfo.error = %s\n",
           toString(radioRsp_v1_2->rspInfo.error).c_str());
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
                                      {RadioError::NONE, RadioError::SIM_ABSENT}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::NONE}));
     }
 }
@@ -369,8 +366,8 @@
 TEST_F(RadioHidlTest_v1_2, setIndicationFilter_1_2) {
     const int serial = GetRandomSerialNumber();
 
-    Return<void> res =
-        radio_v1_2->setIndicationFilter_1_2(serial, static_cast<int>(IndicationFilter::ALL));
+    Return<void> res = radio_v1_2->setIndicationFilter_1_2(
+        serial, static_cast<int>(::android::hardware::radio::V1_2::IndicationFilter::ALL));
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -390,7 +387,7 @@
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
         serial, 5000,
         10,  // hysteresisDb too large given threshold list deltas
-        {-109, -103, -97, -89}, V1_2::AccessNetwork::GERAN);
+        {-109, -103, -97, -89}, ::android::hardware::radio::V1_2::AccessNetwork::GERAN);
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -407,8 +404,8 @@
 TEST_F(RadioHidlTest_v1_2, setSignalStrengthReportingCriteria_EmptyParams) {
     const int serial = GetRandomSerialNumber();
 
-    Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(serial, 0, 0, {},
-                                                                      V1_2::AccessNetwork::GERAN);
+    Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
+        serial, 0, 0, {}, ::android::hardware::radio::V1_2::AccessNetwork::GERAN);
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -426,7 +423,8 @@
     const int serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
-        serial, 5000, 2, {-109, -103, -97, -89}, V1_2::AccessNetwork::GERAN);
+        serial, 5000, 2, {-109, -103, -97, -89},
+        ::android::hardware::radio::V1_2::AccessNetwork::GERAN);
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -444,7 +442,8 @@
     const int serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
-        serial, 5000, 2, {-110, -97, -73, -49, -25}, V1_2::AccessNetwork::UTRAN);
+        serial, 5000, 2, {-110, -97, -73, -49, -25},
+        ::android::hardware::radio::V1_2::AccessNetwork::UTRAN);
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -462,7 +461,8 @@
     const int serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
-        serial, 5000, 2, {-140, -128, -118, -108, -98, -44}, V1_2::AccessNetwork::EUTRAN);
+        serial, 5000, 2, {-140, -128, -118, -108, -98, -44},
+        ::android::hardware::radio::V1_2::AccessNetwork::EUTRAN);
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -480,7 +480,8 @@
     const int serial = GetRandomSerialNumber();
 
     Return<void> res = radio_v1_2->setSignalStrengthReportingCriteria(
-        serial, 5000, 2, {-105, -90, -75, -65}, V1_2::AccessNetwork::CDMA2000);
+        serial, 5000, 2, {-105, -90, -75, -65},
+        ::android::hardware::radio::V1_2::AccessNetwork::CDMA2000);
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -500,7 +501,8 @@
     Return<void> res = radio_v1_2->setLinkCapacityReportingCriteria(
         serial, 5000,
         5000,  // hysteresisDlKbps too big for thresholds delta
-        100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, V1_2::AccessNetwork::GERAN);
+        100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000},
+        ::android::hardware::radio::V1_2::AccessNetwork::GERAN);
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -520,7 +522,8 @@
     Return<void> res = radio_v1_2->setLinkCapacityReportingCriteria(
         serial, 5000, 500,
         1000,  // hysteresisUlKbps too big for thresholds delta
-        {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, V1_2::AccessNetwork::GERAN);
+        {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000},
+        ::android::hardware::radio::V1_2::AccessNetwork::GERAN);
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -537,8 +540,8 @@
 TEST_F(RadioHidlTest_v1_2, setLinkCapacityReportingCriteria_emptyParams) {
     const int serial = GetRandomSerialNumber();
 
-    Return<void> res = radio_v1_2->setLinkCapacityReportingCriteria(serial, 0, 0, 0, {}, {},
-                                                                    V1_2::AccessNetwork::GERAN);
+    Return<void> res = radio_v1_2->setLinkCapacityReportingCriteria(
+        serial, 0, 0, 0, {}, {}, ::android::hardware::radio::V1_2::AccessNetwork::GERAN);
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -557,7 +560,7 @@
 
     Return<void> res = radio_v1_2->setLinkCapacityReportingCriteria(
         serial, 5000, 500, 100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000},
-        V1_2::AccessNetwork::GERAN);
+        ::android::hardware::radio::V1_2::AccessNetwork::GERAN);
     ASSERT_OK(res);
     EXPECT_EQ(std::cv_status::no_timeout, wait());
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
@@ -574,7 +577,8 @@
 TEST_F(RadioHidlTest_v1_2, setupDataCall_1_2) {
     const int serial = GetRandomSerialNumber();
 
-    V1_2::AccessNetwork accessNetwork = V1_2::AccessNetwork::EUTRAN;
+    ::android::hardware::radio::V1_2::AccessNetwork accessNetwork =
+        ::android::hardware::radio::V1_2::AccessNetwork::EUTRAN;
 
     DataProfileInfo dataProfileInfo;
     memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
@@ -600,7 +604,8 @@
     bool roamingAllowed = false;
     bool isRoaming = false;
 
-    V1_2::DataRequestReason reason = V1_2::DataRequestReason::NORMAL;
+    ::android::hardware::radio::V1_2::DataRequestReason reason =
+        ::android::hardware::radio::V1_2::DataRequestReason::NORMAL;
     std::vector<hidl_string> addresses = {""};
     std::vector<hidl_string> dnses = {""};
 
@@ -613,12 +618,12 @@
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
     EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial);
 
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(
             radioRsp_v1_2->rspInfo.error,
             {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_ARGUMENTS,
              RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW, RadioError::REQUEST_NOT_SUPPORTED}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(CheckAnyOfErrors(
             radioRsp_v1_2->rspInfo.error,
             {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_ARGUMENTS,
@@ -632,7 +637,8 @@
 TEST_F(RadioHidlTest_v1_2, deactivateDataCall_1_2) {
     const int serial = GetRandomSerialNumber();
     int cid = 1;
-    V1_2::DataRequestReason reason = V1_2::DataRequestReason::NORMAL;
+    ::android::hardware::radio::V1_2::DataRequestReason reason =
+        ::android::hardware::radio::V1_2::DataRequestReason::NORMAL;
 
     Return<void> res = radio_v1_2->deactivateDataCall_1_2(serial, cid, reason);
     ASSERT_OK(res);
@@ -641,13 +647,13 @@
     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type);
     EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial);
 
-    if (cardStatus.cardState == CardState::ABSENT) {
+    if (cardStatus.base.cardState == CardState::ABSENT) {
         ASSERT_TRUE(CheckAnyOfErrors(
             radioRsp_v1_2->rspInfo.error,
             {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_CALL_ID,
              RadioError::INVALID_STATE, RadioError::INVALID_ARGUMENTS,
              RadioError::REQUEST_NOT_SUPPORTED, RadioError::CANCELLED, RadioError::SIM_ABSENT}));
-    } else if (cardStatus.cardState == CardState::PRESENT) {
+    } else if (cardStatus.base.cardState == CardState::PRESENT) {
         ASSERT_TRUE(CheckAnyOfErrors(
             radioRsp_v1_2->rspInfo.error,
             {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_CALL_ID,
@@ -709,4 +715,4 @@
     ASSERT_TRUE(CheckAnyOfErrors(
         radioRsp_v1_2->rspInfo.error,
         {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::NOT_PROVISIONED}));
-}
+}
\ No newline at end of file
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 d74d077..edac1aa 100644
--- a/radio/1.2/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.2/vts/functional/radio_hidl_hal_test.cpp
@@ -17,14 +17,18 @@
 #include <radio_hidl_hal_utils_v1_2.h>
 
 void RadioHidlTest_v1_2::SetUp() {
-    radio_v1_2 = ::testing::VtsHalHidlTargetTestBase::getService<V1_2::IRadio>(
-        RadioHidlEnvironment::Instance()->getServiceName<V1_2::IRadio>(
-            hidl_string(RADIO_SERVICE_NAME)));
+    radio_v1_2 =
+        ::testing::VtsHalHidlTargetTestBase::getService<::android::hardware::radio::V1_2::IRadio>(
+            RadioHidlEnvironment::Instance()
+                ->getServiceName<::android::hardware::radio::V1_2::IRadio>(
+                    hidl_string(RADIO_SERVICE_NAME)));
     if (radio_v1_2 == NULL) {
         sleep(60);
-        radio_v1_2 = ::testing::VtsHalHidlTargetTestBase::getService<V1_2::IRadio>(
-            RadioHidlEnvironment::Instance()->getServiceName<V1_2::IRadio>(
-                hidl_string(RADIO_SERVICE_NAME)));
+        radio_v1_2 = ::testing::VtsHalHidlTargetTestBase::getService<
+            ::android::hardware::radio::V1_2::IRadio>(
+            RadioHidlEnvironment::Instance()
+                ->getServiceName<::android::hardware::radio::V1_2::IRadio>(
+                    hidl_string(RADIO_SERVICE_NAME)));
     }
     ASSERT_NE(nullptr, radio_v1_2.get());
 
@@ -71,4 +75,4 @@
     }
     count_--;
     return status;
-}
+}
\ No newline at end of file
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 c61913c..2703ca5 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
@@ -22,14 +22,14 @@
 #include <condition_variable>
 #include <mutex>
 
-#include <android/hardware/radio/1.1/IRadioIndication.h>
-#include <android/hardware/radio/1.1/IRadioResponse.h>
 #include <android/hardware/radio/1.2/IRadio.h>
+#include <android/hardware/radio/1.2/IRadioIndication.h>
+#include <android/hardware/radio/1.2/IRadioResponse.h>
 #include <android/hardware/radio/1.2/types.h>
 
 #include "vts_test_util.h"
 
-using namespace ::android::hardware::radio;
+using namespace ::android::hardware::radio::V1_2;
 using namespace ::android::hardware::radio::V1_1;
 using namespace ::android::hardware::radio::V1_0;
 
@@ -44,10 +44,10 @@
 #define RADIO_SERVICE_NAME "slot1"
 
 class RadioHidlTest_v1_2;
-extern CardStatus cardStatus;
+extern ::android::hardware::radio::V1_2::CardStatus cardStatus;
 
 /* Callback class for radio response v1_2*/
-class RadioResponse_v1_2 : public V1_1::IRadioResponse {
+class RadioResponse_v1_2 : public ::android::hardware::radio::V1_2::IRadioResponse {
    protected:
     RadioHidlTest_v1_2& parent_v1_2;
 
@@ -57,8 +57,9 @@
     RadioResponse_v1_2(RadioHidlTest_v1_2& parent_v1_2);
     virtual ~RadioResponse_v1_2() = default;
 
-    Return<void> getIccCardStatusResponse(const RadioResponseInfo& info,
-                                          const CardStatus& cardStatus);
+    Return<void> getIccCardStatusResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::radio::V1_0::CardStatus& cardStatus);
 
     Return<void> supplyIccPinForAppResponse(const RadioResponseInfo& info,
                                             int32_t remainingRetries);
@@ -81,8 +82,9 @@
     Return<void> supplyNetworkDepersonalizationResponse(const RadioResponseInfo& info,
                                                         int32_t remainingRetries);
 
-    Return<void> getCurrentCallsResponse(const RadioResponseInfo& info,
-                                         const ::android::hardware::hidl_vec<Call>& calls);
+    Return<void> getCurrentCallsResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<::android::hardware::radio::V1_0::Call>& calls);
 
     Return<void> dialResponse(const RadioResponseInfo& info);
 
@@ -104,14 +106,17 @@
     Return<void> getLastCallFailCauseResponse(const RadioResponseInfo& info,
                                               const LastCallFailCauseInfo& failCauseInfo);
 
-    Return<void> getSignalStrengthResponse(const RadioResponseInfo& info,
-                                           const SignalStrength& sigStrength);
+    Return<void> getSignalStrengthResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::radio::V1_0::SignalStrength& sigStrength);
 
-    Return<void> getVoiceRegistrationStateResponse(const RadioResponseInfo& info,
-                                                   const VoiceRegStateResult& voiceRegResponse);
+    Return<void> getVoiceRegistrationStateResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::radio::V1_0::VoiceRegStateResult& voiceRegResponse);
 
-    Return<void> getDataRegistrationStateResponse(const RadioResponseInfo& info,
-                                                  const DataRegStateResult& dataRegResponse);
+    Return<void> getDataRegistrationStateResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::radio::V1_0::DataRegStateResult& dataRegResponse);
 
     Return<void> getOperatorResponse(const RadioResponseInfo& info,
                                      const ::android::hardware::hidl_string& longName,
@@ -310,8 +315,9 @@
     Return<void> getVoiceRadioTechnologyResponse(const RadioResponseInfo& info,
                                                  RadioTechnology rat);
 
-    Return<void> getCellInfoListResponse(const RadioResponseInfo& info,
-                                         const ::android::hardware::hidl_vec<CellInfo>& cellInfo);
+    Return<void> getCellInfoListResponse(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<::android::hardware::radio::V1_0::CellInfo>& cellInfo);
 
     Return<void> setCellInfoListRateResponse(const RadioResponseInfo& info);
 
@@ -406,27 +412,33 @@
 
     Return<void> setLinkCapacityReportingCriteriaResponse(const RadioResponseInfo& info);
 
-    Return<void> getIccCardStatusResponse_1_2(const RadioResponseInfo& info,
-                                              const CardStatus& card_status);
+    Return<void> getIccCardStatusResponse_1_2(
+        const RadioResponseInfo& info,
+        const ::android::hardware::radio::V1_2::CardStatus& card_status);
 
-    Return<void> getCurrentCallsResponse_1_2(const RadioResponseInfo& info,
-                                             const ::android::hardware::hidl_vec<Call>& calls);
+    Return<void> getCurrentCallsResponse_1_2(
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<::android::hardware::radio::V1_2::Call>& calls);
 
-    Return<void> getSignalStrengthResponse_1_2(const RadioResponseInfo& info,
-                                               const SignalStrength& sig_strength);
+    Return<void> getSignalStrengthResponse_1_2(
+        const RadioResponseInfo& info,
+        const ::android::hardware::radio::V1_2::SignalStrength& sig_strength);
 
     Return<void> getCellInfoListResponse_1_2(
-        const RadioResponseInfo& info, const ::android::hardware::hidl_vec<CellInfo>& cellInfo);
+        const RadioResponseInfo& info,
+        const ::android::hardware::hidl_vec<::android::hardware::radio::V1_2::CellInfo>& cellInfo);
 
     Return<void> getVoiceRegistrationStateResponse_1_2(
-        const RadioResponseInfo& info, const V1_2::VoiceRegStateResult& voiceRegResponse);
+        const RadioResponseInfo& info,
+        const ::android::hardware::radio::V1_2::VoiceRegStateResult& voiceRegResponse);
 
     Return<void> getDataRegistrationStateResponse_1_2(
-        const RadioResponseInfo& info, const V1_2::DataRegStateResult& dataRegResponse);
+        const RadioResponseInfo& info,
+        const ::android::hardware::radio::V1_2::DataRegStateResult& dataRegResponse);
 };
 
 /* Callback class for radio indication */
-class RadioIndication_v1_2 : public V1_1::IRadioIndication {
+class RadioIndication_v1_2 : public ::android::hardware::radio::V1_2::IRadioIndication {
    protected:
     RadioHidlTest_v1_2& parent_v1_2;
 
@@ -435,26 +447,33 @@
     virtual ~RadioIndication_v1_2() = default;
 
     /* 1.2 Api */
-    Return<void> networkScanResult_1_2(RadioIndicationType type,
-                                       const V1_2::NetworkScanResult& result);
+    Return<void> networkScanResult_1_2(
+        RadioIndicationType type,
+        const ::android::hardware::radio::V1_2::NetworkScanResult& result);
 
-    Return<void> cellInfoList_1_2(RadioIndicationType type,
-                                  const ::android::hardware::hidl_vec<V1_2::CellInfo>& records);
+    Return<void> cellInfoList_1_2(
+        RadioIndicationType type,
+        const ::android::hardware::hidl_vec<::android::hardware::radio::V1_2::CellInfo>& records);
 
-    Return<void> currentLinkCapacityEstimate(RadioIndicationType type,
-                                             const V1_2::LinkCapacityEstimate& lce);
+    Return<void> currentLinkCapacityEstimate(
+        RadioIndicationType type,
+        const ::android::hardware::radio::V1_2::LinkCapacityEstimate& lce);
 
     Return<void> currentPhysicalChannelConfigs(
         RadioIndicationType type,
-        const ::android::hardware::hidl_vec<V1_2::PhysicalChannelConfig>& configs);
+        const ::android::hardware::hidl_vec<
+            ::android::hardware::radio::V1_2::PhysicalChannelConfig>& configs);
 
-    Return<void> currentSignalStrength_1_2(RadioIndicationType type,
-                                           const V1_2::SignalStrength& signalStrength);
+    Return<void> currentSignalStrength_1_2(
+        RadioIndicationType type,
+        const ::android::hardware::radio::V1_2::SignalStrength& signalStrength);
 
     /* 1.1 Api */
     Return<void> carrierInfoForImsiEncryption(RadioIndicationType info);
 
-    Return<void> networkScanResult(RadioIndicationType type, const NetworkScanResult& result);
+    Return<void> networkScanResult(
+        RadioIndicationType type,
+        const ::android::hardware::radio::V1_1::NetworkScanResult& result);
 
     Return<void> keepaliveStatus(RadioIndicationType type, const KeepaliveStatus& status);
 
@@ -480,8 +499,9 @@
                                   const ::android::hardware::hidl_string& nitzTime,
                                   uint64_t receivedTime);
 
-    Return<void> currentSignalStrength(RadioIndicationType type,
-                                       const SignalStrength& signalStrength);
+    Return<void> currentSignalStrength(
+        RadioIndicationType type,
+        const ::android::hardware::radio::V1_0::SignalStrength& signalStrength);
 
     Return<void> dataCallListChanged(
         RadioIndicationType type, const ::android::hardware::hidl_vec<SetupDataCallResult>& dcList);
@@ -539,8 +559,9 @@
 
     Return<void> voiceRadioTechChanged(RadioIndicationType type, RadioTechnology rat);
 
-    Return<void> cellInfoList(RadioIndicationType type,
-                              const ::android::hardware::hidl_vec<CellInfo>& records);
+    Return<void> cellInfoList(
+        RadioIndicationType type,
+        const ::android::hardware::hidl_vec<::android::hardware::radio::V1_0::CellInfo>& records);
 
     Return<void> imsNetworkStateChanged(RadioIndicationType type);
 
@@ -575,7 +596,9 @@
         static RadioHidlEnvironment* instance = new RadioHidlEnvironment;
         return instance;
     }
-    virtual void registerTestServices() override { registerTestService<V1_2::IRadio>(); }
+    virtual void registerTestServices() override {
+        registerTestService<::android::hardware::radio::V1_2::IRadio>();
+    }
 
    private:
     RadioHidlEnvironment() {}
@@ -598,11 +621,11 @@
     std::cv_status wait();
 
     /* radio service handle */
-    sp<V1_2::IRadio> radio_v1_2;
+    sp<::android::hardware::radio::V1_2::IRadio> radio_v1_2;
 
     /* radio response handle */
     sp<RadioResponse_v1_2> radioRsp_v1_2;
 
     /* radio indication handle */
     sp<RadioIndication_v1_2> radioInd_v1_2;
-};
+};
\ No newline at end of file
diff --git a/radio/1.2/vts/functional/radio_indication.cpp b/radio/1.2/vts/functional/radio_indication.cpp
index 57f5cb0..eba9dc0 100644
--- a/radio/1.2/vts/functional/radio_indication.cpp
+++ b/radio/1.2/vts/functional/radio_indication.cpp
@@ -20,29 +20,33 @@
 
 /* 1.2 Apis */
 Return<void> RadioIndication_v1_2::networkScanResult_1_2(
-    RadioIndicationType /*type*/, const V1_2::NetworkScanResult& /*result*/) {
+    RadioIndicationType /*type*/,
+    const ::android::hardware::radio::V1_2::NetworkScanResult& /*result*/) {
     return Void();
 }
 
 Return<void> RadioIndication_v1_2::cellInfoList_1_2(
     RadioIndicationType /*type*/,
-    const ::android::hardware::hidl_vec<V1_2::CellInfo>& /*records*/) {
+    const ::android::hardware::hidl_vec<::android::hardware::radio::V1_2::CellInfo>& /*records*/) {
     return Void();
 }
 
 Return<void> RadioIndication_v1_2::currentLinkCapacityEstimate(
-    RadioIndicationType /*type*/, const V1_2::LinkCapacityEstimate& /*lce*/) {
+    RadioIndicationType /*type*/,
+    const ::android::hardware::radio::V1_2::LinkCapacityEstimate& /*lce*/) {
     return Void();
 }
 
 Return<void> RadioIndication_v1_2::currentPhysicalChannelConfigs(
     RadioIndicationType /*type*/,
-    const ::android::hardware::hidl_vec<V1_2::PhysicalChannelConfig>& /*configs*/) {
+    const ::android::hardware::hidl_vec<
+        ::android::hardware::radio::V1_2::PhysicalChannelConfig>& /*configs*/) {
     return Void();
 }
 
 Return<void> RadioIndication_v1_2::currentSignalStrength_1_2(
-    RadioIndicationType /*type*/, const V1_2::SignalStrength& /*signalStrength*/) {
+    RadioIndicationType /*type*/,
+    const ::android::hardware::radio::V1_2::SignalStrength& /*signalStrength*/) {
     return Void();
 }
 
@@ -51,8 +55,9 @@
     return Void();
 }
 
-Return<void> RadioIndication_v1_2::networkScanResult(RadioIndicationType /*type*/,
-                                                     const NetworkScanResult& /*result*/) {
+Return<void> RadioIndication_v1_2::networkScanResult(
+    RadioIndicationType /*type*/,
+    const ::android::hardware::radio::V1_1::NetworkScanResult& /*result*/) {
     return Void();
 }
 
@@ -101,8 +106,9 @@
     return Void();
 }
 
-Return<void> RadioIndication_v1_2::currentSignalStrength(RadioIndicationType /*type*/,
-                                                         const SignalStrength& /*signalStrength*/) {
+Return<void> RadioIndication_v1_2::currentSignalStrength(
+    RadioIndicationType /*type*/,
+    const ::android::hardware::radio::V1_0::SignalStrength& /*signalStrength*/) {
     return Void();
 }
 
@@ -224,7 +230,8 @@
 }
 
 Return<void> RadioIndication_v1_2::cellInfoList(
-    RadioIndicationType /*type*/, const ::android::hardware::hidl_vec<CellInfo>& /*records*/) {
+    RadioIndicationType /*type*/,
+    const ::android::hardware::hidl_vec<::android::hardware::radio::V1_0::CellInfo>& /*records*/) {
     return Void();
 }
 
@@ -276,4 +283,4 @@
 Return<void> RadioIndication_v1_2::modemReset(RadioIndicationType /*type*/,
                                               const ::android::hardware::hidl_string& /*reason*/) {
     return Void();
-}
+}
\ No newline at end of file
diff --git a/radio/1.2/vts/functional/radio_response.cpp b/radio/1.2/vts/functional/radio_response.cpp
index 9195689..2977ed6 100644
--- a/radio/1.2/vts/functional/radio_response.cpp
+++ b/radio/1.2/vts/functional/radio_response.cpp
@@ -16,13 +16,14 @@
 
 #include <radio_hidl_hal_utils_v1_2.h>
 
-CardStatus cardStatus;
+::android::hardware::radio::V1_2::CardStatus cardStatus;
 
 RadioResponse_v1_2::RadioResponse_v1_2(RadioHidlTest_v1_2& parent) : parent_v1_2(parent) {}
 
 /* 1.0 Apis */
-Return<void> RadioResponse_v1_2::getIccCardStatusResponse(const RadioResponseInfo& /*info*/,
-                                                          const CardStatus& /*card_status*/) {
+Return<void> RadioResponse_v1_2::getIccCardStatusResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::radio::V1_0::CardStatus& /*card_status*/) {
     return Void();
 }
 
@@ -62,7 +63,8 @@
 }
 
 Return<void> RadioResponse_v1_2::getCurrentCallsResponse(
-    const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_vec<Call>& /*calls*/) {
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::hidl_vec<::android::hardware::radio::V1_0::Call>& /*calls*/) {
     return Void();
 }
 
@@ -107,18 +109,21 @@
     return Void();
 }
 
-Return<void> RadioResponse_v1_2::getSignalStrengthResponse(const RadioResponseInfo& /*info*/,
-                                                           const SignalStrength& /*sig_strength*/) {
+Return<void> RadioResponse_v1_2::getSignalStrengthResponse(
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::radio::V1_0::SignalStrength& /*sig_strength*/) {
     return Void();
 }
 
 Return<void> RadioResponse_v1_2::getVoiceRegistrationStateResponse(
-    const RadioResponseInfo& /*info*/, const VoiceRegStateResult& /*voiceRegResponse*/) {
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::radio::V1_0::VoiceRegStateResult& /*voiceRegResponse*/) {
     return Void();
 }
 
 Return<void> RadioResponse_v1_2::getDataRegistrationStateResponse(
-    const RadioResponseInfo& /*info*/, const DataRegStateResult& /*dataRegResponse*/) {
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::radio::V1_0::DataRegStateResult& /*dataRegResponse*/) {
     return Void();
 }
 
@@ -515,7 +520,7 @@
 
 Return<void> RadioResponse_v1_2::getCellInfoListResponse(
     const RadioResponseInfo& /*info*/,
-    const ::android::hardware::hidl_vec<CellInfo>& /*cellInfo*/) {
+    const ::android::hardware::hidl_vec<::android::hardware::radio::V1_0::CellInfo>& /*cellInfo*/) {
     return Void();
 }
 
@@ -704,8 +709,9 @@
     return Void();
 }
 
-Return<void> RadioResponse_v1_2::getIccCardStatusResponse_1_2(const RadioResponseInfo& info,
-                                                              const CardStatus& card_status) {
+Return<void> RadioResponse_v1_2::getIccCardStatusResponse_1_2(
+    const RadioResponseInfo& info,
+    const ::android::hardware::radio::V1_2::CardStatus& card_status) {
     rspInfo = info;
     cardStatus = card_status;
     parent_v1_2.notify();
@@ -713,32 +719,37 @@
 }
 
 Return<void> RadioResponse_v1_2::getCurrentCallsResponse_1_2(
-    const RadioResponseInfo& info, const ::android::hardware::hidl_vec<Call>& /*calls*/) {
+    const RadioResponseInfo& info,
+    const ::android::hardware::hidl_vec<::android::hardware::radio::V1_2::Call>& /*calls*/) {
     rspInfo = info;
     parent_v1_2.notify();
     return Void();
 }
 
 Return<void> RadioResponse_v1_2::getSignalStrengthResponse_1_2(
-    const RadioResponseInfo& info, const SignalStrength& /*sig_strength*/) {
+    const RadioResponseInfo& info,
+    const ::android::hardware::radio::V1_2::SignalStrength& /*sig_strength*/) {
     rspInfo = info;
     parent_v1_2.notify();
     return Void();
 }
 
 Return<void> RadioResponse_v1_2::getCellInfoListResponse_1_2(
-    const RadioResponseInfo& info, const ::android::hardware::hidl_vec<CellInfo>& /*cellInfo*/) {
+    const RadioResponseInfo& info,
+    const ::android::hardware::hidl_vec<::android::hardware::radio::V1_2::CellInfo>& /*cellInfo*/) {
     rspInfo = info;
     parent_v1_2.notify();
     return Void();
 }
 
 Return<void> RadioResponse_v1_2::getVoiceRegistrationStateResponse_1_2(
-    const RadioResponseInfo& /*info*/, const V1_2::VoiceRegStateResult& /*voiceRegResponse*/) {
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::radio::V1_2::VoiceRegStateResult& /*voiceRegResponse*/) {
     return Void();
 }
 
 Return<void> RadioResponse_v1_2::getDataRegistrationStateResponse_1_2(
-    const RadioResponseInfo& /*info*/, const V1_2::DataRegStateResult& /*dataRegResponse*/) {
+    const RadioResponseInfo& /*info*/,
+    const ::android::hardware::radio::V1_2::DataRegStateResult& /*dataRegResponse*/) {
     return Void();
-}
+}
\ No newline at end of file
