diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp
index c6b2579..98ea0d2 100644
--- a/radio/aidl/vts/radio_modem_test.cpp
+++ b/radio/aidl/vts/radio_modem_test.cpp
@@ -55,6 +55,15 @@
     ASSERT_NE(nullptr, radio_config.get());
 }
 
+bool RadioModemTest::shouldTestCdma() {
+    int32_t aidl_version = 0;
+    ndk::ScopedAStatus aidl_status = radio_modem->getInterfaceVersion(&aidl_version);
+    EXPECT_TRUE(aidl_status.isOk());
+    if (aidl_version < 2) return true;  // < RADIO_HAL_VERSION_2_1
+
+    return !telephony_flags::cleanup_cdma();
+}
+
 /*
  * Test IRadioModem.setRadioPower() for the response returned.
  */
@@ -244,6 +253,10 @@
  * Test IRadioModem.nvReadItem() for the response returned.
  */
 TEST_P(RadioModemTest, nvReadItem) {
+    if (!shouldTestCdma()) {
+        GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
+    }
+
     serial = GetRandomSerialNumber();
 
     radio_modem->nvReadItem(serial, NvItem::LTE_BAND_ENABLE_25);
@@ -261,6 +274,10 @@
  * Test IRadioModem.nvWriteItem() for the response returned.
  */
 TEST_P(RadioModemTest, nvWriteItem) {
+    if (!shouldTestCdma()) {
+        GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
+    }
+
     serial = GetRandomSerialNumber();
     NvWriteItem item;
     memset(&item, 0, sizeof(item));
diff --git a/radio/aidl/vts/radio_modem_utils.h b/radio/aidl/vts/radio_modem_utils.h
index aa99ea3..21481bd 100644
--- a/radio/aidl/vts/radio_modem_utils.h
+++ b/radio/aidl/vts/radio_modem_utils.h
@@ -119,6 +119,8 @@
   public:
     void SetUp() override;
 
+    bool shouldTestCdma();
+
     /* radio modem service handle */
     std::shared_ptr<IRadioModem> radio_modem;
     /* radio modem response handle */
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index 9a3a429..439d268 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -78,6 +78,15 @@
     ASSERT_NE(nullptr, radio_config.get());
 }
 
+bool RadioNetworkTest::shouldTestCdma() {
+    int32_t aidl_version = 0;
+    ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
+    EXPECT_TRUE(aidl_status.isOk());
+    if (aidl_version < 4) return true;  // < RADIO_HAL_VERSION_2_3
+
+    return !telephony_flags::cleanup_cdma();
+}
+
 void RadioNetworkTest::stopNetworkScan() {
     serial = GetRandomSerialNumber();
     radio_network->stopNetworkScan(serial);
@@ -1775,6 +1784,9 @@
  * Test IRadioNetwork.getAvailableBandModes() for the response returned.
  */
 TEST_P(RadioNetworkTest, getAvailableBandModes) {
+    if (!shouldTestCdma()) {
+        GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
+    }
     if (telephony_flags::enforce_telephony_feature_mapping()) {
         if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
             GTEST_SKIP() << "Skipping getAvailableBandModes "
@@ -2019,6 +2031,9 @@
  * Test IRadioNetwork.setBandMode() for the response returned.
  */
 TEST_P(RadioNetworkTest, setBandMode) {
+    if (!shouldTestCdma()) {
+        GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
+    }
     if (telephony_flags::enforce_telephony_feature_mapping()) {
         if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
             GTEST_SKIP() << "Skipping setBandMode "
@@ -2043,6 +2058,10 @@
  * Test IRadioNetwork.setLocationUpdates() for the response returned.
  */
 TEST_P(RadioNetworkTest, setLocationUpdates) {
+    // While setLocationUpdates is not CDMA-related, it's guarded by the same release flag.
+    if (!shouldTestCdma()) {
+        GTEST_SKIP() << "Skipping testing of deprecated setLocationUpdates method";
+    }
     if (telephony_flags::enforce_telephony_feature_mapping()) {
         if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
             GTEST_SKIP() << "Skipping setLocationUpdates "
diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h
index 17c0896..3387dec 100644
--- a/radio/aidl/vts/radio_network_utils.h
+++ b/radio/aidl/vts/radio_network_utils.h
@@ -263,6 +263,8 @@
   public:
     void SetUp() override;
 
+    bool shouldTestCdma();
+
     /* radio network service handle */
     std::shared_ptr<IRadioNetwork> radio_network;
     /* radio network response handle */
diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp
index 2823977..aaccb21 100644
--- a/radio/aidl/vts/radio_sim_test.cpp
+++ b/radio/aidl/vts/radio_sim_test.cpp
@@ -52,6 +52,15 @@
     ASSERT_NE(nullptr, radio_config.get());
 }
 
+bool RadioSimTest::shouldTestCdma() {
+    int32_t aidl_version = 0;
+    ndk::ScopedAStatus aidl_status = radio_sim->getInterfaceVersion(&aidl_version);
+    EXPECT_TRUE(aidl_status.isOk());
+    if (aidl_version < 4) return true;  // < RADIO_HAL_VERSION_2_3
+
+    return !telephony_flags::cleanup_cdma();
+}
+
 void RadioSimTest::updateSimCardStatus() {
     serial = GetRandomSerialNumber();
     radio_sim->getIccCardStatus(serial);
@@ -935,6 +944,13 @@
  * Test IRadioSim.iccCloseLogicalChannel() for the response returned.
  */
 TEST_P(RadioSimTest, iccCloseLogicalChannel) {
+    int32_t aidl_version;
+    ndk::ScopedAStatus aidl_status = radio_sim->getInterfaceVersion(&aidl_version);
+    ASSERT_OK(aidl_status);
+    if (aidl_version >= 2) {  // >= RADIO_HAL_VERSION_2_1
+        GTEST_SKIP() << "Skipping iccCloseLogicalChannel (deprecated)";
+    }
+
     if (telephony_flags::enforce_telephony_feature_mapping()) {
         if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
             GTEST_SKIP() << "Skipping iccCloseLogicalChannel "
@@ -1176,6 +1192,9 @@
  * Test IRadioSim.setUiccSubscription() for the response returned.
  */
 TEST_P(RadioSimTest, setUiccSubscription) {
+    if (!shouldTestCdma()) {
+        GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
+    }
     if (telephony_flags::enforce_telephony_feature_mapping()) {
         if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
             GTEST_SKIP() << "Skipping setUiccSubscription "
diff --git a/radio/aidl/vts/radio_sim_utils.h b/radio/aidl/vts/radio_sim_utils.h
index 7cbcc58..eb3efb2 100644
--- a/radio/aidl/vts/radio_sim_utils.h
+++ b/radio/aidl/vts/radio_sim_utils.h
@@ -198,6 +198,8 @@
   public:
     void SetUp() override;
 
+    bool shouldTestCdma();
+
     /* Override updateSimCardStatus in RadioServiceTest to not call setResponseFunctions */
     void updateSimCardStatus();
 
